03-19-2008 03:35 AM
03-19-2008 03:49 AM
Sorry,
here the rest from my source example:
// endles loop
while ( 1 )
{
iStatus = DAQmxReadAnalogF64( TaskHandle,
1, 5.0,
DAQmx_Val_GroupByChannel,
ReadBuffer, // float64 ReadBuffer[40000];
READ_BUFFERSIZE, // 40000
&ValuesRead,
NULL);
// Validate
if ( iStatus ........
......
}
Now the problem:
from time to time the read returns with error -200019.
It was not possible to reproduce the errror.
1.) Can anybody tell me if I understood the triggering right and the way I build the source is OK?
2.) When the error occur I have to stop and restart the analogin task to recover the problem. Are there other ways to do that?
Thanks in advanced for your help!
Alex
03-20-2008 05:33 AM
There is an example installed with the NI-CAN driver, that shows how to synchronize CAN and DAQmx. You can find it here:
...\National Instruments\NI-CAN\MS Visual C\Channel API examples\CAN and DAQmx Waveform Input
Additionally I attached the .c File
03-20-2008 07:12 AM
Hi,
first, i could fix the problem!
In my prev. post I forgot to write one important thing.
We have to measure all signals nearly in 'realtime', so buffers are not usable. In that time
when the CAN object does not exist (no ECU connected) we switch the RTSI trigger to
the CTR0 of the 6621 card to sample the analogs signals continously
I made the mistake that I opened the CAN object (with RTSI trigger configured) in a time when
the RTSI line was also connected to the CTR0. Now it was possible that there were two triggers
on the RTSI in a real short time (> 10kHz).
Was really a silly error, because normally the disconnect was done in only a view 'code steps' after
the CAN object was created and the first frames were received.
Thanks to Andre for the code example, maybe I can use it in the future!
Regards
Alex