08-01-2008 03:20 AM - edited 08-01-2008 03:21 AM
Dear Sir,
I find that a problem that NI DAQmxBaseReadAnalogF64() has conflict with Linux Inter-Process Communication (IPC).
DAQmxbase 3.2 on Mandriva 2007. Hardware USB 6218.
(1) Description
I need one process to read analogue data and send them to another process. Based on the sample program contAcquireNChan.c (provided in DAQmxbase examples), I add a few lines to enable one process (CLIENT) to receive Linux queue message from another process(SERVER). That is, SERVER sends out a message at a fixed speed, CLIENT wait for the message, and call DAQmxBaseReadAnalogF64() to get the analogue data. A very simple idea, but we need it for our project.
//SERVER
While(1){
Send one message
Sleep(DELAY)
}
//CLIENT
While(1){
Receive the message
Call DAQmxBaseReadAnalogF64() and print the result.
}
(2) Problem
Without the linux IPC, the contAcquireNChan works very well.
Once the linux IPC is involved, the converted analogue data is totally incorrect. I tested two situations.
i. If the delay in SERVER is 1s, the converted data seems to keeps at the initial value, which may change a little bit (just a few mV), but cannot follow the change of the input voltage.
ii. If the delay in SERVER is 10ms, the converted data sometime can follow the input voltage, but sometimes is incorrect. That is, I fixed the input voltage and test. For the first few seconds, the converted data are correct, but after a few seconds, the output will change dramatically, which is incorrect. But after another few seconds, the data restore to the correct values. And such process, correct -> incorrect -> correct -> incorrect, goes on and on.
Is there possible that the NI DAQmxbase conflicts with Linux IPC?
Would you please give me a sample on how to implement such IPC function together with NI DAQ?
08-01-2008 03:32 AM - edited 08-01-2008 03:34 AM
08-04-2008 12:29 PM
Hi,
I was able to recreate the first case when the delay in the SERVER in 1s, but when the delay is 10ms , it worked fine.
Can u please double check the connections, and if I may ask why are you using this SERVER approach to transfer data?
Regards,
Faris
08-05-2008 12:27 AM
08-06-2008 09:52 AM
08-22-2008 12:29 AM