![]() |
||
|
This board is for PLC Related Q&A ONLY. Please DON'T use it for advertising, etc. |
||
| ||
New Here? Please read this important info!!!
|
|
#1 |
|
Member
![]() Join Date: Mar 2008
Location: Rochester, NY
Posts: 2
|
SLC 5/04 ASCII string parsing question
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,2 71,343,18^M^J |
|
|
|
#2 |
|
Member
|
Take a look at this previous thread:
http://www.plctalk.net/qanda/showthread.php?t=38944
__________________
"To give real service you must add something that cannot be bought or measured with money; and that is sincerity and integrity." - Donald A. Adams |
|
|
|
#3 |
|
Lifetime Supporting Member
|
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
__________________
It's not all the variables I am most concerned with, it's the undiscovered constants. "You can lead a horse to water but if he's got his head up his as$ he may die of thirst anyway." |
|
|
|
#4 |
|
Member
![]() Join Date: Mar 2008
Location: Rochester, NY
Posts: 2
|
Thanks guys. That was exactly the help I was looking for.
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Topics
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| ASCII string validation with SLC 5/04 | firebrd10 | LIVE PLC Questions And Answers | 3 | January 19th, 2005 12:11 PM |
| AB CTC units..with 2 SLC 5/04 DH+ | Russ | LIVE PLC Questions And Answers | 4 | December 15th, 2004 04:02 PM |
| SLC 5/04 to PanelMate Power Pro 3000 through AIC+ | hhuong | LIVE PLC Questions And Answers | 5 | December 10th, 2004 08:08 AM |
| SLC 5/03 and SLC 5/04 | hhuong | LIVE PLC Questions And Answers | 2 | November 19th, 2004 12:42 PM |
| Repeat of ALB 1397 & SLC 5/04 question | chickman69 | LIVE PLC Questions And Answers | 5 | October 6th, 2003 08:29 AM |