How to display ASCII number to String

Discuss issues and ideas you have to configuring displays with PowerVision
quantum
Posts: 1
Joined: Wed Jul 03, 2013 6:49 pm

How to display ASCII number to String

Post by quantum » Wed Dec 10, 2014 8:04 pm

Hello all

I need to display the Part number which is transmitted via CAN and received as a number.
I need to display it on the screen as ASCII characters.

Please advice how I can do this. I have no clue at present

Thanks,
Anand
stalley
Enovation Controls Development
Enovation Controls Development
Posts: 618
Joined: Tue Mar 18, 2014 12:57 pm

Re: How to display ASCII number to String

Post by stalley » Thu Dec 11, 2014 10:09 am

Hello Anand,

If your incoming message is a multi-packet with a specific format that will fit with the Free Form Data Messages, it will do the conversions for you and you can just display the variable that you specify in the String Buffer setting. Your incoming message needs to have the Length Byte, Sequence Byte, Start Byte and End Byte. This works very nice. It works well with the standard J9193 software version message, xFEDA. If your incoming message does not have this format, then you will need to do your own.

There are some posts here viewtopic.php?f=7&t=728&p=1888&hilit=ASCII#p1888 that describe one way to convert the incoming ASCII codes to a string variable in a script. After the incoming ASCII codes have been converted to a string variable, you can store in a reserved string that is displayable.

Code: Select all

 cultureSetString(StringIDs.DisplayString, convertedString, true);
You could also use a list with a column that is a char array. These posts viewtopic.php?f=7&t=1033 have useful information, including a some sample configurations about using lists.

Lists and scripts are available on color displays. If your display is monochrome, it is possible, but you will need to be clever. You can use an activity program to convert each of the codes to a character. Depending on the size of the parameter, you might be able to use enums. If you have a monochrome display, let me know and we can work on something more specific.
Sara Talley
Software Engineer
Enovation Controls