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: 

how can i select elements in an array using decimate ID array function to plot a multiplot waveform chart?

Hi!

I am acquiring data from three different sources and sending them via VISA to labview. I need to seperate the elements so that i can plot a multiplot waveform chart. I have tried using 1D decimate array but it does not seem to be working. I have attached a screen shot of the vi. Any help would be greatly appreciated. Thank you.  

0 Kudos
Message 1 of 13
(3,189 Views)

You are creating an array with a single point, then trying to get three points out of it with the decimate array, then converting the resulting single point arrays to clusters.  It might help to back up and look at the original data coming from your serial port.  What does it look like?  Is it a single point or is it multiple points (how long is that string)?  Your conversion implies a single point.

0 Kudos
Message 2 of 13
(3,181 Views)

The serial port is sending multiple points (0,1,2) which is inside an infinite while loop.

0 Kudos
Message 3 of 13
(3,169 Views)

Then you can't convert the string to a single number.  You will have to use a function like scan from string to get the 3 values at once.  How are the 3 points separated from each other in the string you receive?

0 Kudos
Message 4 of 13
(3,165 Views)

I included an indicator right after the BUILD ARRAY (before the 1D decimate array) and while running it indicated 0,1,2 in a loop for array 1.

0 Kudos
Message 5 of 13
(3,163 Views)

Each value is separated by a line feed (0x0A)

0 Kudos
Message 6 of 13
(3,162 Views)

Then how do you know which value is related to which datapoint?

0 Kudos
Message 7 of 13
(3,158 Views)

I tried plotting the waveform right after the conversion (hexadecimal to number) and it plotted just fine. But now i want to separate the elements so i can make three waveforms. If the build array function holds 0,1,2,0,1,2 and so on shouldn't the decimate 1d array function form three subarrays with 0's, 1's and 2's? Also with the current vi all three waveforms plot only 0's.

0 Kudos
Message 8 of 13
(3,154 Views)

Yes.   But as DFGray said, you don't have an array.  You are reading a single point at a time.  You may be building that into an array, but it is a single element array.

 

Please upload your latest VI, and also an example of the data of how it is coming in from the serial device read by read.

0 Kudos
Message 9 of 13
(3,138 Views)

Here is the vi. Yes you are right i think it is being accepted as a single point. From the serial port i am transmitting each value one after the other with a small delay inbetween. I am quite new to labview and i can't seem to figure it out. Do take a look at the vi. I haven't made any changes to it. Also i can't use scan from string as the data will be coming from a sensor and it will be uknown.

0 Kudos
Message 10 of 13
(3,122 Views)