the function of expressing ,(Comma) every thousand (cicode & ciVBA)

Hi, Everyone. I'm Kang.

I'm testing the function of expressing ,(Comma) every thousand in analog data.

Through several samples, I checked the functionality.

However, I've to use this function in Super Genie.

I created a function that uses ciVBA in cicode.
The return value of this function does not work normally, so it is not displayed on the screen.

Could you please help me if I have written something wrong

STRING
FUNCTION Test_Format(STRING sTag)

STRING sInput ;

STRING sOutput ;

REAL rPE = TagRead(sTag);

sInput = rPE ;
sOutput = VbCallReturn(VbCallRun(VbCallOpen("FormatTheReal", sInput)));
RETURN sOutput;

END

Function FormatTheReal (Byval iInVal As Single) As string
Dim sFormattedValue As String
Dim iTagValue As Single
iTagValue = iInVal
sFormattedValue = Format (iTagValue, "Standard")
FormatTheReal = sFormattedValue
End Function

Parents
  • Hi Kang,

    Your formatting function is blocking because of the TagRead command.
    Citect does not allow blocking functions to be used in graphics pages as foreground animation expressions.

    Please remove the TagRead call and pass the value of your tag to your Test_format function instead of the tag name.

    Also, I'm not sure if calls to VBA are also blocking or not. If so, you have to program this functionality using cicode only.

    Best regards,
    Patrick
Reply
  • Hi Kang,

    Your formatting function is blocking because of the TagRead command.
    Citect does not allow blocking functions to be used in graphics pages as foreground animation expressions.

    Please remove the TagRead call and pass the value of your tag to your Test_format function instead of the tag name.

    Also, I'm not sure if calls to VBA are also blocking or not. If so, you have to program this functionality using cicode only.

    Best regards,
    Patrick
Children
No Data