ascII code and another question

How can I return the charactor’s ascII code,and vice versa,for example ,retrun 65 from ‘a’,and ‘a’ from 65
by the way ,another question:
How can I only read a OPC tag 's value only once at any time?

 Thank you

You would have to use a script using the ord() and chr() functions. There is no way to do it in an expression.

As for your tag issue, perhaps if you can give a few details as to what you are trying to do…

Okay, not strictly true. There is a way to do it but it’s rather more complex.
I created a script module called ascii. withing the module I created functions duplicating the original python functions.

You can call the scripts from an expression using the runScript() function. Examples:

runScript(concat([color=#0000FF]“app.ascii.chr(”[/color],[color=#FF0000]{Root Container.Numeric Text Field.intValue}[/color],[color=#0000FF]")"[/color]))

runScript(concat([color=#0000FF]‘app.ascii.ord("’[/color],[color=#FF0000]{Root Container.Text Field.text}[/color],[color=#0000FF]’")’[/color]))

Thanks, I want to l read a opc-tag value only once because when it was read a time,the devise state changed,when it was read again ,the devise state changed again,so I do not want it was read by scan-class because it read again and again.

Answered here.