LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to seperate serial data from different channels

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.

0 Kudos
Message 1 of 11
(2,013 Views)

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

CLD; LabVIEW since 8.0, Currently have LabVIEW 2015 SP1, 2018SP1 & 2020 installed
0 Kudos
Message 2 of 11
(2,011 Views)

Hi,

 

Thanks for reply.

 

Can you send me any example please.

 

 

0 Kudos
Message 3 of 11
(2,009 Views)

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:

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 4 of 11
(1,986 Views)

 


@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?🤔

CLD; LabVIEW since 8.0, Currently have LabVIEW 2015 SP1, 2018SP1 & 2020 installed
0 Kudos
Message 5 of 11
(1,971 Views)

is it a array subset.

 

Deepti_Singh_0-1641563244341.png

 

0 Kudos
Message 6 of 11
(1,967 Views)

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)…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 7 of 11
(1,964 Views)

No E is not part of the channel 7.Its a string from A to E.

0 Kudos
Message 8 of 11
(1,963 Views)

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

 

0 Kudos
Message 9 of 11
(1,937 Views)

Can you please tell me what different I did.I tried the same example.

 

Deepti_Singh_1-1641570151492.png

 

0 Kudos
Message 10 of 11
(1,927 Views)