when recieving data from a device how do u pick data u want/ Ignore the rest

Snide

Member
Join Date
Oct 2005
Location
Pittsburgh
Posts
73
I need to grab data out of an array string for example, I'm reading in MYArray.ReadString[0], for example reading...

MYArray.ReadString[0] *
[1] a1
[2] a2
[3] g
[4] k
[5] _
[6]a number
[7]a number
[8] CR
[9] lf

I need to read [3] to [7] i don't care about the rest of the returned data. how do i grab just that data?

Amy
 
Does the data always show up in 3-7 orm can it show up in other locations? If it is always in 3-7 you can copy out of the base array into another array. For example:


COP(MYArray.ReadString[3], ArrayEvalString[0], 5)

If you don't know where the data string is but it starts with a known character, you can use the FIND instruction to locate the beginning of the data and use that as the base array element for your copy.

Keith
 
I know where the data is coming in for exp:
Data.ReadString[0]
about the 3 to 7 all the time no, each question i ask gives a different response, different lenghts, i do know the start and end of every string.
I know what part i want to grab, also, the string comes in at Dat.ReadString [0], could you show me an example of a copy, if that's what you suggest exp sorce= dest= length= i tried some stuff but i'm not sure i'm doing it right.

thanks amy
 
I'm sorry, i see your example

oh, i think i get it except i want to make sure on one thing the Dest...how did you set that in the User-Defined data types?? what would you pick for setting?
 
Last edited:

Similar Topics

Hi, i don't know if this is a right place for this but does any one have an idea on how i can receive messages from a phone to a PC, send the data...
Replies
2
Views
1,753
I'm using ICX HWC35 cellular gateway with Allen Bradley 1769 L33ER PLC for messaging purpose Already upload the AOI instruction to the project...
Replies
3
Views
4,390
Hi All, Has anyone worked o a project with a master plc and other remote plc that talk to each other using sms and or GPRS and sms as backup...
Replies
5
Views
1,989
Hello all! I have a micro 1100 and am trying to recieve a string from a cognex dataman barcode reader. I am not very familar with the ascii...
Replies
7
Views
4,602
Hi Hope you all are doing well. Iam working on a project with some AOI. I also hate no online edits... lol. My problem occurs when I use a UDT...
Replies
1
Views
40
Back
Top Bottom