Ascii in RSLogix5000

Maswork

Member
Join Date
Jun 2005
Posts
7
I need to convert ascii data scanned in on Devicenet serial (1734-232ASC) to individual Integer values. Perform math and convert integer values back to ascii characters. The Ascii Serial Port instructions do not work with Devicenet Ascii. When I convert the Ascii input to a String so it can be parsed to individual characters the String value makes no sense to me? For instance an ascii value of 0264 converted to a String is 80859704? Ascii data is used to assemble a barcode.
 
When I convert the Ascii input to a String

Describe precisely what instructions you used to accomplish that, and maybe somebody can help you.

Hint: When you're creating a String tag from scratch, the Length value must go into the .LEN subelement, and the characters themselves go into the .DATA[x] subelements.
 
When I convert Ascii string

The serial input comes in on the devicenet mapped address at Local:2:I.Data[8] through Local:2:I.Data[11]. The data comes in accurately in either Ascii or hex format and each address is a DINT. For each of these addresses I use a DTOS (DINT to STRING), to convert the incoming data to a String. This is just an intermediate step so I can use the MID command to parse out each character and may be a mistake as it does not appear to be usable data.

If I input data to DTOS and then DTOS to STOD to convert the data back to Ascii the data integrity is good. Input is 0264, DTOS is 80857704 and STOD returns 0264. Problem is if I parse any digits out from the DTOS and try to convert back to Ascii the return does not appear meaningful.

This may be the wrong way around to accomplish what I need?

Ultimate goal is to Parse each ascii character to a holding register, convert each character to an integer, perform the math, convert result back to an ascii character.
 
The input is ascii code - don't convert it!
ascii "0264" fits in one dint with hex pattern 30323634 which when viewed as an integer has decimal value 80857704.

COPy the input dint(s) to a string tag if you want to do string manipulation. Don't forget to set the length.
 

Similar Topics

Hey, i've been working on getting some add-on instructions defaulted in the company i work in. i am currently trying to create a string which...
Replies
7
Views
3,076
hi, I tring to mov Ascii in RSLogix5000 to a string at structured text code: for example: if temp=5 then string_tag = [3,'abc'] end_if but I...
Replies
4
Views
2,964
This might be a simple question. I have a red lion display which i can communicate over rs232 or 485. I am needing to get information from a plc...
Replies
2
Views
1,542
Using Controllogix PLC and RSlogix5000 to scan in data over devicenet ascii module (1734-232ASC). Data scans in and displays correctly. I need to...
Replies
2
Views
4,037
Hi, We couldn’t find anything specific, so am starting a new thread. I’m trying to migrate a config from a ML1400 to a micro820 & am experiencing...
Replies
1
Views
104
Back
Top Bottom