Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Vi sampling rate changes?

Hi,I am using a NI PCI-6221 card to output a voltage step by step to change the wavelength of a laser,at each voltage step,I use a GPIB card on the PC to get some data points and then average them,at the same time the PC reads datas from a RS232 port.After finishing that,the voltage goes to the next step till I stop the VI manually.
Normally the VI should always run at the same speed,and it did last night when finished it.But today it runs quite fast at first,and then slow down to the normal speed as last night.For example I want to get 100 points after averaging,now the VI get the first 50 points quite fast and then it slows down to a normal speed to get the rest 50 points.And what is bad is the first 50 points seems wrong,because the wavelength does not change.
I am new to Labview.I guess there are some data buffers for the GPIB and RS232,so when I stop the VI,the data continue written into the buffer,so when I run the VI again,the VI read data points from the buffers instead of the card ports,so it runs quite fast at first and when the buffer is clear it slow down.Am I right?
I want the VI run step by step stablely.So how to deal with such case?Anyone kind can help me?Thanks in advance!


帖子被coz在01-01-2008 01:58 AM时编辑过了
0 Kudos
Message 1 of 4
(3,596 Views)
Hi,coz.
 
I guess the problem maybe because of the dataflow of the three part in you VI(gpib, 6221 and RS232), but I'm not sure.
Can you post your VI here for detailed help? or you can call our AE in China: 800-8203633 ext.2144 for personal support.
 
0 Kudos
Message 2 of 4
(3,583 Views)
Hi,Jessica
Thanks for your suggestion.
I found there is really something strange with the RS232 port.Sometimes the VI is ok,it runs normally,at normal speed,but sometimes there is an error with the RS232 port just as shown on the picture attached.This error happened occasionally but quite frequently.When there is an error like this and I continue the VI,the VI runs at a trange speed,while when the RS232 is read out normally,the VI runs normally.
The dataflows on the GPIB ports are quite fast,while the dataflow on the RS232 port is quite slow,the refresh rate of the instrument connected to the RS232 port is about 1Hz.Maybe the error above is from here.
So do you have any suggestion for me to resolve that?
0 Kudos
Message 3 of 4
(3,576 Views)
It looks like that the VI read from the RS232 so slowly that the old data was overwritten by the new arrived data. My suggestion is checking the execution sequence of your block diagram, make sure the read rate is fast enough.
0 Kudos
Message 4 of 4
(3,552 Views)