SA Faceplate - Use of Pulse Function

Hi,

Can Pulse function be used for an Button on the SA Faceplate, when referencing to an equipment [?__Equipment?]? 

If not any tip on how to get an pulse function from the SA Faceplate? 

Thanks For any input,

Rune

  • Rune, the Pulse function is not best practice, as writes cannot be guaranteed and frequently the behaviour of the logic if the off pulse does not arrive at the controller is not defined.
  • Hi Rune, I totally agree with Stuart. One of the interesting things with the faceplate command buttons is the pattern we use to notify the operator whether the command has succeeded. With a func like Pulse, that just isn't possible.


    To answer your question though, no you cannot use the Pulse function with super genie associations. But you can use its underlying function "Pulser" (Include/tag.ci). The reason for this is that the Pulse label does a "arg = arg" and the compiler doesn't support association resolution in that situation.

    So:

    1. Add a button_base genie from the sa_controls_common library on your faceplate and configure the "Click Command" to:
    Pulser(?__EquipmentName?.YourDigital, "", VarToArrayIndex(?__EquipmentName?.YourDigital))
    2. Add a button_label_12 genie over the button and give it an appropriate label. Link the label's background AN genie parameter to the AN of the rectangle object in the button named "Background".

    This will compile and "work" at runtime. But... what Stuart said!

    cheers,

    bradley

  • Hi Bradley,
    Thanks for the tip and solution, using your button_base genie. This seems to cover our need.

    One other question that comes due to your replay. How do I tell that this function Pulse (or any other function) is not compatible with a Super Genie associations? When reading the help file for the Pulse function there is no such information.

    Your comment:
    The reason for this is that the Pulse label does a "arg = arg" and the compiler doesn't support association resolution in that situation.
    **
    Where can I find this information outside this Forum?

    Regards
    Rune
  • Most functions take arguments as tag names. So in place of a tag name, you should get the tag name from the association.
    Simply look at the help, and if the function requires a tag name, it needs the string, and a super genie association will not do.

    I replace the tag name with this function - AssGetProperty(%Tag Association%, "TagName",1))
    The function above will return the tag name so it can be passed to any function. I would normally button genies that I use in super genies which have this function used in it. Hence the %Tag Association% is replaced with the number of the assignment.

    As for pulse function, I avoid using it. It is always better to set 1 to a bit used in the PLC, and the PLC resets to 0 after it is used.
  • The compiler treats "partial/dynamic associations" as a string, which is why I can pass ?__EquipmentName?.MyDigital straight through. This avoids the need to do another func call such as AssGetProperty.

    Search the topic "Dynamic Associations" (first hit) in the help about where dynamic associations can be used / not used. As you can see this particular situation is not listed. I would say if the "function" is actually a label wrapper (see Labels view in Citect Studio and change Project filter to display "Include), then you may run into trouble if the label does things such as "arg = arg. You were the first to find this particular case. Mainly because we all avoid Pulse :)