07-18-2012 01:47 AM
I have some basic questions:
1. I have Serial communication from PXI to device. When I read the string of 26characters, continously, on Hypertermianl. It is fast enough. But when I read in the VI program, simple VISA read.
The reading is very slow. The VISA read one character at a time and take time to make a string of 26characters. Visa read is very slow, Why?
The baud rate is 1152K and rate is 32 updates per second, which is super fast in hyperterminal but very slow in Labview VI.
2. Second I need the extract the some data from my string at different positions on a string of 26 characters. I already made the subVI for reading it but since the VISA read is slow to read it gives wrong values from the string.
So I thought I can make an array and ask the subvi to read the the second (i.e n-1 value) 26 characters which are ready rather than first one which is being formed. But there is no arrays for string.How can I do that? also my concern is if I read n-1 value, it is not real time value.
:8 -0582 n value Visa read slowly
:000000 -0076U 0008 -0582 n-1 value
:000000 -0074U 0008 -0582 n-2 value
:000000 -0075U 0008 -0582 n-3 value
3. I will extract the 74, 76, 77 etc say the value as AA. I want to plot the graph of value AA versus Seconds? How can generate Seconds on my X-axis?
07-18-2012 02:07 AM
Please the attached.
07-18-2012 10:30 AM
The VISA property node makes no sense and the enum you have wired to the TermChar property makes even less sense. The termination character is enabled/disabled with the VISA Configure Serial Port as is the actual termination character. I don't know where you got the enum for the actual termination character but it is wrong. You just can't make things up like this. As you can see in the VISA Configure Serial Port, the default termination character is a 0xA (LF). If you had left things alone, your read would terminate when that is seen and your buffer would have only the 26 characters instead of the 2400 that it has now.
07-19-2012 05:20 AM
Thank you for suggestion!
Now I am receiving data continuosly.
1. As mentioned previously, I wish to plot the heave value on real time basis, I saw the shipping example, modified my VI.
The plot is not correct, as the heave value increases and decreases linearly but there is strange graph.
2. Also I have one more question, actually if I want to find out the heave value, device once moved up 10cm and brought back to 0 level again. Its not instant as the design of the device says it takes 2 secs to get back to the zero state again. The heave is read from 10, 9, 8,7 6, 5, etc. It takes 10 steps to come back to normal value, zero value.
I just need to plot the 0 and 10cm or may be next might be -5cm, I need to capture the final data. How can i do that?
07-19-2012 11:09 AM
Why are you converting the scalar to an array and why are you using a graph instead of a chart? With a graph, you are throwing away all previous readings. Drop the for loop and just wire the output of the scaled value to a chart.
07-20-2012 04:27 AM
I submitted the wrong file before. Please see the attach.
IThe focus is that the heave value which I will receive is very random. The range is from -10 to 1m. First I set zero state by setting the offset of x, y, z axis. Heave is the vertical movement, up and down.
I just move the sensor up and down suppose 0 to 5cm but the value comes down linearly 5, 4,3,2,1 ,0, which takes some time interval of 2sec. But I just want the value 5cm which has to fed to next machine.
So which is the right approach to catch the realtime heave value display it in graph:
three ways I thought which way is the best ?:
1. Real time heave Vs time
2. Maximum and minimum value graph
3. Running Avverage
4. Peak detection
07-20-2012 10:03 AM
You are still not making any sense. You take a single value and make it into an array and then wire it to the min/max and mean functions. That is just silly. You have an array with 10 identical elements!
You need to learn how to use a shift register and the build array function. You also need to learn the basics of charts an XY graph. If you want time on the x axis, adding time as the second plot of chart is not even close to being correct. Look at the example called Real Time Chart to see how you can plot time on the x axis. Or, use an XY graph.
You've been a registered user for quite a while but perhaps it is time to take the basic LabVIEW tutorial.
08-02-2012 01:50 AM
Yes I am still struggling with basics at times, as I am not constantly updating my knowledge.
I have now brushed up my basics and have come up with the VI attached to give the Heave Vs.Time(sec) chart. I am not sure its right or wrong?
But still the question is:
The analog sensor which I am dealing with is giving me not a single point value but gives a linear values, suppose I move the instrument from 0 to 5 cm the value I receive is 0,1,2,3,4,5.
Generally, in with a time interval .
How should I analyze the data? I read the actual heave value like 0 and 5cm.
08-03-2012 12:38 PM
If your goal is to update your chart every time you read a single value from your device, you should closely follow the Real-Time Chart example brought up earlier. With that example, you just feed one sample at a time to your chart and it takes care of updating the display properly.
I think what you're trying to do with the code you posted is add every new data point you read to an array, but you are not doing it correctly. You need to use a shift register to keep track of the array between iterations of the loop. But I recommend you instead look at using a chart, which you can update with each individual value instead of giving it a new array each time.