I need to remove characters from answer of device
2Fast
Posts: 90
My problem is, sometimes what I need is in the start of the answer .... sometimes in the end.
Like that:
NB07□□ID01,F02,ST0001111□ID02,F02,ST0000000□ID05,F02,ST1110110□
The size of the answers are variable, so I need to identify the start with ID02 and put in a variable the complete feedback.
Example: VARIABLE = ID02,F02,ST0000000
I don't know what instruction I hace to use in this case.
Thanks!
Like that:
NB07□□ID01,F02,ST0001111□ID02,F02,ST0000000□ID05,F02,ST1110110□
The size of the answers are variable, so I need to identify the start with ID02 and put in a variable the complete feedback.
Example: VARIABLE = ID02,F02,ST0000000
I don't know what instruction I hace to use in this case.
Thanks!
0
Comments
I imagine that □ is a return character? If so, you would probably need to nest a loop, pull off everything line by line
Then parse out myCmd
Obviously this would be in loops, you would have ID02 in one pass, F02 in the next, etc...
2Fast,
I know we have seen this string already in the forum, it may have been from you. The key to parsing this message is finding the delimiter or the "TAIL" of the message. I can only assume what the little "□" none-printable character is for this message. But it seems that is the delimiter or "TAIL" of each of these sections. For the code example I will assume that the none-printable character is a Carriage Return / $0D.
I don't need only one feedback, I need to divide in answers from specific devices in the "network" and I really don't know how....
feedback1=ID01,F02,ST1110016
feedback2=ID02,F02,ST0110013
feedback3=ID03,F02,ST0100014
If the size of the answer was the same every time I would read for positions ...
With theses examples I'm not understanting
I did not provide ALL the code!!!!!!! I am hoping people know how to create a buffer and declare a buffer!!!!!
I just thought you wouldn't remove the stuff you're referencing - maybe that's just me.
And please apologize - my ears hurt now.
Sorry again and thanks
No no - not dumb. No question is dumb and you're not disturbing us.
As far as the buffer thing goes - I was just joking with Jeff and was actually curious whether or not it was supposed to be used in the CREATE_BUFFER or some other technique such as a LOCAL_VAR in the data event and populating it from the DATA.TEXT, etc. etc.
I'll just assume it's done via CREATE_BUFFER.
James is right...
Thanks!