Applies To: |
|
Summary: |
I'm calling a Cicode function in the Alarm Desc field of an Advanced Alarm which returns a string. The function gets called but only 2 characters are displayed. What is the problem and how can I fix it? |
Solution: | ||||||||||||||||||||||||||||||
The problem here is Citect does not know
what the format of the return value from the function is, so we
have to trick Citect into thinking that it is 255 characters. To do
this you can configure a variable tag of the STRING datatype and
use this variable in the Alarm Desc field. This String tag is going
to be null and will be concatenated to the function return value.
For example:
Configure the following Variable Tag:
Associate it to a memory device and leave it null, unless you wish to concatenate a string to the beginning of the Alarm Description. Then configure the Advanced Alarm and Alarm Category forms as follows:
This will log the appropriate description on the alarm summary page based on the value of the tag named Code. Note: String formatters can also be used - ie. {MyFunc():12} - if 12 characters are needed. This removes the need for declaring dummay variables. See also KB Article Q2383 |
Keywords: |
Related Links
Attachments