SLC 5/04 ASCII string parsing question

Join Date
Mar 2008
Location
Rochester, NY
Posts
2
Hi all,

I am reading in serial data from a Cognex Dataman 2D matrix reader into a SLC 5/04 serial port (channel 0 - user). I have successfully transmitted the data into the string register created for the information. However, I am having some trouble figuring out how to parse the data out. Currently my delimeter is a comma, however it can be something else. I cannot use the AEX (ASCII extract) instruction because the entire string of data can vary in character length. I would appreciate any advice that you guys may be able to give.

Here is an example of what my string looks like in my ST register:

122206811347A010744AA513,346,342,345,265,270,266,271,343,18^M^J
 
You can use the AEX, but first you need to know the length of the portion you want to extract.

To find that length, search for your delimiter using the ASC command. Then subtract (or add) 1 to it and store that value in a register that will become the "number" of characters to extract in the AEX command.

Paul
 

Similar Topics

Am I trying to do something that is already done for me? We are setting up communications between a SLC 5/04 and an Opto 22 Brain using serial...
Replies
3
Views
6,747
Hi, I'm new into AB controllers and I'm trying to find how to handle rs232 communication on slc 05/4. I know that I need to configure channel 0...
Replies
5
Views
3,093
Hi there everyone! Long time lurker, first time poster. I am doing an SLC-5/03 to CompactLogix migration and am having an issue with a barcode...
Replies
1
Views
1,051
Hello, I have a slc 5/04 and a dataman dm302 barcode camera via channel 0. I'm using AWA + CR/LF to send commands to swap focal lengths. Also I'm...
Replies
2
Views
1,730
Hi all- first timer here. I am a process control tech assigned a new to me task. Since i am not a true programmer am having trouble with the...
Replies
1
Views
2,127
Back
Top Bottom