You are not registered yet. Please click here to register!


 
 
plc storereviewsdownloads
This board is for PLC Related Q&A ONLY. Please DON'T use it for advertising, etc.
 
Try our online PLC Simulator- FREE.  Click here now to try it.

---------->>>>>Get FREE PLC Programming Tips

New Here? Please read this important info!!!


Go Back   PLCS.net - Interactive Q & A > PLCS.net - Interactive Q & A > LIVE PLC Questions And Answers

PLC training tools sale

Reply
 
Thread Tools Display Modes
Old March 27th, 2009, 01:51 PM   #1
boilermaker711
Member
United States

boilermaker711 is offline
 
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
  Reply With Quote
Old March 27th, 2009, 02:05 PM   #2
Ken Moore
Member
United States

Ken Moore is offline
 
Ken Moore's Avatar
 
Join Date: May 2004
Location: Upstate South Carolina
Posts: 2,325
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

  Reply With Quote
Old March 27th, 2009, 02:07 PM   #3
OkiePC
Lifetime Supporting Member
United States

OkiePC is offline
 
OkiePC's Avatar
 
Join Date: Mar 2005
Location: ENE of Nowhere Oklahoma
Posts: 7,514
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."
  Reply With Quote
Old March 30th, 2009, 12:58 PM   #4
boilermaker711
Member
United States

boilermaker711 is offline
 
Join Date: Mar 2008
Location: Rochester, NY
Posts: 2
Thanks guys. That was exactly the help I was looking for.
  Reply With Quote
Reply
Jump to Live PLC Question and Answer Forum

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

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


All times are GMT -5. The time now is 12:54 PM.


.