cancel
Showing results for 
Search instead for 
Did you mean: 

RS232 data split

SOLVED
sveirq
Member
Solved!

RS232 data split

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?

11 REPLIES 11
GerdW
Knight of NI

Re: RS232 data split

Hi sveirq,

 

use StringSubset with length=3 and offset= multiple of 3 Smiley Very Happy

 

Are there no delimiters between data bytes or even messages?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
JÞB
Knight of NI

Re: RS232 data split

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
sveirq
Member

Re: RS232 data split

Message contains an attachment

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?

 

GerdW
Knight of NI
Solution

Re: RS232 data split

Message contains an image

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
LV_Pro
Trusted Enthusiast

Re: RS232 data split

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



sveirq
Member

Re: RS232 data split

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?

GerdW
Knight of NI

Re: RS232 data split

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
billko
Proven Zealot

Re: RS232 data split

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.
sveirq
Member

Re: RS232 data split

Message contains an attachment

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