Welcome to the new Schneider Electric Community

It's your place to connect with experts and peers, get continuous support, and share knowledge.

Close
Important Announcement: WELCOME to the new Schneider Electric Community! Community is now no longer part of Exchange, and is now rebranded under se.com. If you have any bookmarks and links saved, we request you to update them to ensure that you continue accessing our community from this new location. For any issues that you might encounter as part of this change, please reach out to SchneiderCommunity.Support@se.com, and the team will help to get your issues resolved.
Invite a Co-worker
Send a co-worker an invite to the Exchange portal.Just enter their email address and we’ll connect them to register. After joining, they will belong to the same company.
Send Invite Cancel
82534members
350140posts

INT_to_CHAR Function

EcoStruxure Geo SCADA Expert Forum

Find out how SCADA systems and networks, like EcoStruxure Geo SCADA Expert, help industrial organizations maintaining efficiency, processing data for smarter decision making with IoT, RTU and PLC devices.

tcookson
Crewman
Crewman
0 Likes
1
523

INT_to_CHAR Function

Is there a pre-existing function to convert a integer/byte (0-255) into an string containing a single ASCII character?  BYTE_TO_STRING is close, but I want the value 65 to return "A", not "65".

 

Seems like maybe there could be, but I can't find it.  I'm looking to display ASCII values stored as INTs in a ScadaPack and read as Modbus into a string variable in Geo SCADA Expert (CS2017

1 Reply 1
BevanWeiss
Spock
Spock
0 Likes
0
517

Re: INT_to_CHAR Function

I suspect unfortunately you might have to write you own Logic Library for this.

 

Geo SCADA Expert doesn't have the concept of a 'CHAR' data type, it's just a single element STRING.DATA HIERARCHY.png

So if you create a ST Library, and then have a CHAR or CHR function defined within it that took an INT (or BYTE) and returned a single element STRING, then you'd be able to do what you're looking for.

 

You'd just want your function to have a big CASE block... one condition for every character you want to map.

Or I guess you could do it with an array and then a lookup into the array, this might actually be nicer,

or even a STRING with all the characters, and then use MID to pull out the right value.

 


Lead Control Systems Engineer for Alliance Automation (VIC).
All opinions are my own and do not represent the opinions or policies of my employer, or of my cat..