From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

RS232 comunication

Hello everybody!


Here is my problem: I have a frame of data from ADC (atmega 32) in 16 - bit array: 165|90|2|counter|byteADC 1| byteADC 2| byteADC 3| byteADC 4. How can I extract data (byteADC 1 etc.) from this frame? 'I' is a separator. I tried to save this frame to array of strings but with no further result. Have you any idea how to do this? On the end I want to present data in real time on chart. 

0 Kudos
Message 1 of 9
(2,489 Views)

I would use the Spreadsheet String to Array function with "|" as the delimiter.  Then it is a simple matter of just indexing out the data you want.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 9
(2,481 Views)
The Spreadsheet String to Array works and all you have to do is index the array. Post an image of your block diagram if you still have problems after doing this.
0 Kudos
Message 3 of 9
(2,478 Views)

labview.png

Okay, I'd like to extract a counter from my data frame and view number of count in each iteration. But it doesn't work. 

0 Kudos
Message 4 of 9
(2,467 Views)

Wire in a 1D array to the type input of the Spreadsheet String to Array function.  Then you will just have a scaler coming out after you index the element you need.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 5 of 9
(2,450 Views)
You're going to have to be a bit more precise. A simple statement of 'it doesn't work' is pretty meaningless.
0 Kudos
Message 6 of 9
(2,449 Views)

Yeah, sorry for that. Ok, I'm going to improve my program, but how can i limit incoming data to array? 165|90|2 it's a starting index, and in that way i recognise where frame starts. Should I try something like cyclic buffer or prepare 'for' statement? Which solution is better? Thanks for your past answers. 

0 Kudos
Message 7 of 9
(2,441 Views)
You are already limiting the data. The read is set to automatically terminate with s termination character so the byte count just had to be set for some arbitrarily high number.
0 Kudos
Message 8 of 9
(2,432 Views)

It's AMAZING how simply it is! 🙂 It really works, thank you a lot! 

0 Kudos
Message 9 of 9
(2,416 Views)