Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

DAQmxCfgSampClkTiming linker error

Hi guys!


I am using DAQPad-6016 (USB) and I am working on a controlling programm in ANSI-C. This programm should read out digital ports from an angular encoder and set voltage values to an analog output for a servo motor. (Some kind of velocity control)

I found out how to compile an ANSI-C programm with gcc under cygwin.

So what did was:

echo EXPORTS > NIDAQmx.def
nm NIDAQmx.lib | grep ' T _' | sed 's/.* T _//' >> NIDAQmx.def

dlltool -- def NIDAQmx.des -- dllname NIDAQmx.lib --output-lib NIDAQmx.a


After I had written the code in myProg.c

I compiled in this way :

gcc -o myProg.exe myProg.c -L./ -lNIDAQmx


I created a software loop which realizes single state enquiries on digital input ports. This method works fine with slow revolution speed. But if I increase the motor speed, the data acquisition of single state enquiries became to slow (8ms per loop). This was the moment when I decided to measure hardware-sampled bit sequences.

I created functions to initialize tasks and to start them. Therefore, I used the examples of the NI folders as templates:


initialize(){
...

DAQmxErrChk (DAQmxCreateTask("",&currentTaskNumber));
DAQmxErrChk (DAQmxCreateDIChan(currentTaskNumber,usedDIPort,"",DAQmx_Val_ChanForAllLines));
   
DAQmxErrChk (DAQmxCfgSampClkTiming(currentTaskNumber,"",100.0,DAQmx_Val_Rising,DAQmx_Val_FiniteSamps,3));
       
DAQmxErrChk (DAQmxStartTask(currentTaskNumber));
taskNumDIPort = currentTaskNumber;


...
}

int readPort(){
...

DAQmxErrChk (DAQmxReadDigitalU32(taskNumDIPort,3,10.0,DAQmx_Val_GroupByChannel,lowByte,3,&numRead,NULL));

...
return valueOfAngle;
}


These functions work well - but only with out the
DAQmxCfgSampClkTiming
function. However, I want to adjust these sample parameters for the measurement. If I use this red line I get an ld linker error: undefined reference to `_DAQmxCfgSampClkTiming@28'

I don't know if this problem depends on cygwin or not. Does anybody know how to handle/solve this problem?

Thank you for your attention and help!

Alex

0 Kudos
Message 1 of 3
(3,298 Views)
Alex,

i got some bad news for you: USB 6016 does not support timing operations for DIOs. DIOs on this device are not "clocked" and therefore you cannot set any sample clock. Why you get this rather strange error-message, i don't really understand but nevertheless this would be an operation you will never be able to get to work to your needs.
Benchmarks revealed, that the reading of DIO is done within about 4 ms with an 2.4 GHz PC 512 MB RAM. So if you read and write another DIO within your loop, the stated 8 ms are "ok" and you will not have the possiblity to get faster with this device.

Norbert B.
NI Germany

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 2 of 3
(3,258 Views)
Thank you Nobert for your answer!
I was already helped by the NI support Germany. Sorry, I should have reply myself to the question at forum. I changed the hardware - now I'm using NI PCI 6229 which provides digital sampling.

Best regards

Alex


0 Kudos
Message 3 of 3
(3,190 Views)