LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

RS232 data split

Solved!
Go to solution

Hi, new Labview user!

 

I am trying to split a stream of bytes that come from VISA Read, these values are for 3 sensors but they came together to read the values in the same time.
the stream is just like this ABCABCABCABC......
Any tips please?

0 Kudos
Message 1 of 12
(2,840 Views)

Hi sveirq,

 

use StringSubset with length=3 and offset= multiple of 3 😄

 

Are there no delimiters between data bytes or even messages?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 12
(2,835 Views)

It would help to know what the devices are.  A link to the maunual would be even more helpfulSmiley Wink but we can usually google that.


"Should be" isn't "Is" -Jay
0 Kudos
Message 3 of 12
(2,822 Views)

Thanks for replying

I used StringSubset but it doesn't work. I used it in wrong way maybe Smiley Frustrated

can you show me how will this wired?

 

0 Kudos
Message 4 of 12
(2,799 Views)
Solution
Accepted by topic author sveirq

Hi sveirq,

 

in your picture you don't use StringSubset. You convert your string to an U8 array and divide by another array (constant). Don't know what you want to achieve this way...

 

You really need help in using StringSubset?

check.png

 

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 5 of 12
(2,790 Views)

That isn't string subset. String subset is in the string palette, can split a string, based on different criteria. If there are delimiters between the data "packets" that can be used, if the data comes in a set length that can be used. Then the resulting individual data pieces can be "translated" to numeric values (if that is what they represent) by other LabVIEW functions. It would help if you can show us the returned string, and identify which piece represents which sensor.

 

 

Ah, Gerd types faster than I!

 

 

Putnam
Certified LabVIEW Developer

Senior Test Engineer North Shore Technology, Inc.
Currently using LV 2012-LabVIEW 2018, RT8.5


LabVIEW Champion



0 Kudos
Message 6 of 12
(2,786 Views)

thanks for your help guys! Thats right, i would just to show you the wavefrom chart that shows all of the data. the whole ide is how to split the data that come VISA Read to show these on three different waveform charts.

if i thinking right, do i need three Stringsubset to pick out each of three data?

0 Kudos
Message 7 of 12
(2,772 Views)

Hi sveirq,

 

provide a "real" example string and you will get "real" help...

 

From what you told by now I would guess 3 StringSubset functions can do the job.

A FOR loop using just one StringSubset might work too (with the help of DecimateArray)...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 8 of 12
(2,767 Views)

How do you know when the sequence begins?  How do you know if haven't started reading right in the middle of the stream?  This is important because this affects which graph the each piece of data will go to.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
Message 9 of 12
(2,752 Views)

Thanks guys you are great!

But do i have some mistakes here, i am trying to pick out bytes with odd index, but the chart shows noting Smiley Sad

 

Thanks alot again

0 Kudos
Message 10 of 12
(2,707 Views)