01-07-2022 05:16 AM
A K0: 83 227 K1: 0 0 K2: 0 0 K3: 0 0 K4: 0 0 K5: 0 0 K6: 0 0 K7: 0 0 E
This is the serial data that I am receiving from 7different channels but from one device. I want to seperate each channel and also two values eg:83 and 227.I can seperate data by string subset but offset and lengh is not always same.
Can someone help me with this.
Thanks in advance.
01-07-2022 05:22 AM
Looks like 8 channels to me.
you need to provide more info on the protocol, but from the string provided I would start by using K%d: as a match pattern in a FOR loop and grab the data that way. (wrap the data after out into the input of the next loop and run it 8 times and index out the data before.
then look at what you need to change to get it working better for you.
(I'm sure there is a cleaner RegEx but I can never be bothered to confuse myself with those)
James
01-07-2022 05:27 AM
Hi,
Thanks for reply.
Can you send me any example please.
01-07-2022 06:39 AM - edited 01-07-2022 06:40 AM
Hi Singh,
@Deepti_Singh wrote:
This is the serial data that I am receiving from 7different channels but from one device. I want to seperate each channel and also two values eg:83 and 227.I can seperate data by string subset but offset and lengh is not always same.
You don't need StringSubset. You should not use it to parse strings…
See this:
01-07-2022 07:41 AM
@GerdW wrote:
Hi Singh,
@Deepti_Singh wrote:
This is the serial data that I am receiving from 7different channels but from one device. I want to seperate each channel and also two values eg:83 and 227.I can seperate data by string subset but offset and lengh is not always same.
You don't need StringSubset. You should not use it to parse strings…
See this:
is it really that simple? I thought E was part of the response from K7 given the statement that the strings were of different lengths.
How did I miss that?🤔
01-07-2022 07:48 AM
is it a array subset.
01-07-2022 07:52 AM
Hi Singh,
@Deepti_Singh wrote:
is it a array subset.
It's an array function so you better carefully look into the array functions palette!
James_W wrote:
is it really that simple? I thought E was part of the response from K7 given the statement that the strings were of different lengths
The string starts with "A" and ends with "E", like German "Anfang" and "Ende". I guess those two chars are used instead of ASCII STX/ETX (or in addition to LF/CR to end the line of text)…
01-07-2022 07:53 AM
No E is not part of the channel 7.Its a string from A to E.
01-07-2022 09:14 AM
Hi,
Yes its the start and end of the string.
Is it possible to send the Vi that you already created or just name the labels.
It is very helpful for me.
Thank you so much.
Regards
Deepti Singh
01-07-2022 09:43 AM
Can you please tell me what different I did.I tried the same example.