ASCII and Decimal value displays

bxg1983

Member
Join Date
Nov 2022
Location
Virginia
Posts
3
Hello,

I have a SINT array I am receiving and one of the positions of this array contains the direction of the product.

Inside the ladder logic the value corresponding to the position of this array displays as a decimal. What would be the most efficient way of getting the ASCII value equivalent inside the ladder logic instead of the decimal?
 
What does "Inside the ladder logic" mean?

Are you looking at an element of a SINT array in the online mode of some RSLogix 5/500/5000 or Studio 5000, and that element is displayed as a integer value between -128 and +127?


And what does "ASCII value equivalent" mean?

Is the value of the SINT array element (above) displayed as the integer 49, and you want to see the ASCII character '1' or summat similar?
 
That last part of your message summarizes it the best, I am getting back the integer values and would like to see the ASCII returned.
 
I assume this is Rockwell/Allen-Bradley, Logix because that has SINTs.

So, a string tag, call it the_string, in Logix is a structure with two parts:

  • the_string.LEN - An INT that is length of the string
  • the_string.DATA[] - An array of SINTs that contain the data - i.e. ASCII characters - for the string.
So if you MOV the SINT element from your array to the_string.DATA[0], and MOV a length of 1 into the_string.LEN, then the string tag called "the_string" might contain what you are looking for.


Cf. here and Example 2 here.
 

Similar Topics

Hello everyone!, I am having a problem encoding decimals to ASCII, I need to store all 256 decimal characters (0-255) but ASCII encoded in Sting...
Replies
12
Views
3,619
If there are any Excel guys there that know how to convert a decimal value from ControlLogix to Ascii in Excel I sure would appreciate it.
Replies
25
Views
5,034
Do any of you Excel gurus know of a VB code or function that will convert ASCII text into it's decimal equivalent? I'm not VB savy at all. I...
Replies
3
Views
5,841
I am using a ControlLogix processor to serially readback data from a QuickSilver servo drive. The ASCII response I get back is as follows: # 01...
Replies
1
Views
3,297
H
Dear all, i have to convert ASCII code into decimal or hexadecimal in my twido PLC using ladder diagram because the data that i send from my pc...
Replies
0
Views
4,423
hosana
H
Back
Top Bottom