04-14-2011 07:44 AM
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.
04-14-2011 08:18 AM
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.
04-14-2011 09:51 PM
The serial port is sending multiple points (0,1,2) which is inside an infinite while loop.
04-14-2011 10:19 PM
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?
04-14-2011 10:33 PM
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.
04-14-2011 10:37 PM
Each value is separated by a line feed (0x0A)
04-14-2011 10:45 PM
Then how do you know which value is related to which datapoint?
04-14-2011 11:28 PM
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.
04-15-2011 09:46 AM - edited 04-15-2011 09:54 AM
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.
04-16-2011 11:50 AM
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.