LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

buffer problem with software lock-in

Hi,

I have trouble using the Multichannel lock-in DAQmx. I would like to measure two signals and the reference with USB 6009 and the LabVIEW DAQmx lock-in. I know that it is not simaltenous sampling board but since I do not need the phase, it should be fine. The problem is that I have two signals sometimes swap with each other. It happens in the first run of the while loop when the lock-in VIs are initialized. It correlates with appearing of extra samples available after the DAQmx Read.vi. If the swap between the channels happens it persists in the while loop but the timing gets twice as big. I guess that there might be some samples stuck in the buffer but I do not know how to reset it. I tried to run task stop and then task run VIs but it did not help. Reducing the sampling speed and increasing the buffer size did not help either.

My setup is following. The mechanical chopper running at 25 Hz modulates the IR radiation and it is detected by two detectors. One is used as a calibration, the other for the measurement. I need both signals. I sample between 5000 and 14000 S/s in order to take care of the aliasing. The reference signal from the chopper is connected to the first pair of differential analog input, the two signals to the next two pairs of the differential inputs.

Please advise on how to reset the buffer (resetting the board does not help too).

nia2
0 Kudos
Message 1 of 5
(3,212 Views)
What VIs are you using, I am not familiar with lock-in VIs except when relating to our simultaneous sampling cards. You said it flips your inputs, so are you seeing the data you usually see on channel 2 on channel 1 and visa vee?
-Marshall R
0 Kudos
Message 2 of 5
(3,174 Views)
I am using the MultiChannel LockIn - DAQmx.vi. It comes in the 25010.zip archive. I use also the USB 6009 DAQ board. Reference puses are connected to the AI0-4, channel 1 to the AI1-5, channel 2 to the AI2-6 (differential input). Sometimes channel 1 appears in place of channel 2 and then channel 2 appears in place of channel 1 in the read VI.

I found the temporary workaround. Before the main lock-in loop I start the task, read the channels and read number of available samples after it. If this number is larger than 1000, I clear the task and repeat. When there are fewer than 1000 samples available, I enter the main lock-in loop. The previously read data I desregard and read again. In this way the channels come in the right sequence. I suppose that somewhere one channel reading gets lost resulting in the shift of the data. Somehow it correlates with the data left in the buffer. For some misterious reason it happens in the first run of the lock-in loop (may be due to the initialization of the lock-in VIs).
0 Kudos
Message 3 of 5
(3,171 Views)
I think the developer zone article you are referring to is  found here.  These VIs are ment exclusively for the simultaneous sampling cards and not for the 6009. The features that these VIs use are moot on any other boards. I would suggest just starting with one our multiple channel analog question examples in the example finder >> Hardware Input and Output >> DAQmx >> Analog Input.  What features were you trying to utilize from the code you found online?
-Marshall R
0 Kudos
Message 4 of 5
(3,152 Views)
I am using the software lock-in VIs for my application. Since I do not need the exact phase information (only the signal at the reference frequency), I used the cheap 6009 card with the multiplexer. I might need to upgrade to 9215a, which has 4 simalteneous sampling channels. But still I am puzzled by this channel flipping behavior. I have to place the computer away from the testing area due to the radiation level and this is why I opted for USB DAQ.

nia2
0 Kudos
Message 5 of 5
(3,148 Views)