Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

timestamping ADC values and seperation

 i have a question, im am trying to timstamp my adc values from my microntroller via uart. so i have ADC values and timestamp from uart as one string ACSII. The data send sets of 512 numbers of adc and then the timestamp every second. The data sends as follows

 

$ADC Values,$time,$ADC Values,$time,$ADC Values  

 

and so forth, repeats same pattern. You can see the values in th read buffer from the pictures i attached the last picture of the buffer is the time. I initially use the visa termination character to catach the dollar sign then i  use a "Scan from String" to get the time and then have that output to the "to" of the build waveform. then i have the remaining string go into a "spreadsheet string to array" to get comma out and convert to double. I guess i could probably expand the "Scan from string" and separate both using that instread of using the "spreadsheet string to array". I also get this error from " Scan from string"

 "LabVIEW:  An input parameter is invalid. For example if the input is a path, the path might contain a character not allowed by the OS such as ? or @."

 

If you can please help that would be great i have attached my code and pictures of read buffer.

0 Kudos
Message 1 of 4
(3,804 Views)

here is my code

0 Kudos
Message 2 of 4
(3,801 Views)
I can't look at your VI right now and you did not attach an image of the VISA code. I mentioned before the asynchronous nature of serial communication. You simply cannot depend on the order of the bytes that you read if the micro is just spewing out data. You should have the micro programmed to only send when you send a specific request for it. For example, send the character A when you want the amplitude array and send T when you want the time.
0 Kudos
Message 3 of 4
(3,779 Views)
I have programmed the micro to send in the order I expect I can plot the voltage values fine and get the amp and rms but now I integrated gps to time stamp values and just can't separate the time from voltage as I said.
0 Kudos
Message 4 of 4
(3,764 Views)