06-22-2009 12:06 PM
Hello,
I'm trying to use the provided ANSI C example codes to test PCI 6601 card. The example code is in following path: usr/local/natinst/nidaqmx/examples/ansi_c/Digital/ReadValues/ReadDigChan
there are 3 files in the folder: Makefile, NIDAQmx.h, ReadDigChan.c
i'm trying to complie ReadDigChan.c by using "gcc" command.
However i recevied the following message:
/temp/ccosRed4.o(.text+0x52): In funtion 'main':
: undefined reference to 'DAQmxCreateTask'
/temp/ccosRed4.o(.text+0x77): In funtion 'main':
: undefined reference to 'DAQmxCreateChan'
/temp/ccosRed4.o(.text+0x93): In funtion 'main':
: undefined reference to 'DAQmxStartTask'
/temp/ccosRed4.o(.text+0xd8): In funtion 'main':
: undefined reference to 'DAQmxReadDigitalLines'
/temp/ccosRed4.o(.text+0x149): In funtion 'main':
: undefined reference to 'DAQmxGetExtendedErrorInfo'
/temp/ccosRed4.o(.text+0x15d): In funtion 'main':
: undefined reference to 'DAQmxStopTask'
.
.
.
I just wonder how to fix the above errors ? is there any step I have to do before I complie ReadDigChan ? How does Makefile work ?
I'm very new to linux system. I dun actaully know how to "create task" like the "Steps" mentioned in the ReadDigChan.c
if possible, can you provide me an example code ?
The OS I'm using is SUSE 9.2
Thanks a lot,
Kevin
06-23-2009 05:07 PM
Hi Kevin,
Based on the error messages you are receiving, it looks like you have not downloaded DAQmx. You should be able to use this driver: http://joule.ni.com/nidu/cds/view/p/id/1194/lang/en
Here are a couple of links that may be helpful:
Makefiles: http://www.wlug.org.nz/MakefileHowto
GCC: http://www.faqs.org/docs/Linux-HOWTO/GCC-HOWTO.html
06-24-2009 05:32 PM
hello,
thanks for quick reply. I think I fixed that problem already. but I'm having the other problem regarding the power supply pin of PCI 6601.
I have a lieanr encoder connect to the power supply pin of PCI 6601. However, it seems that the encoder not received any voltage from that particular pin ( I think it is "pin 1" on PCI 6601). I just wonder whether there is any power control bit that i have to turn on first or the power trace supported to be connect to encoder directly regardless.
Kevin
06-26-2009 12:29 AM
Hi Kevin,
There is no bit that you have to turn for the 5 V pin. This is connected to the power supply from the computer, so it is always on, always high.
What linear encoder are you using, can you link the specifications? Do you know what the current draw of the encoder is? Looking at the Power section of the 6601 specifications page, it looks like the 6601 has 4.75-5.25 V at 1 A available at the IO connector.
Do you have a handheld DMM or another measurement device that you can use to measure and verify that the 5 V pin is outputting? It is possible for this pin to be bent or damaged while the rest of the card works, so that is something to check.
Regards,
Mallori
06-26-2009 07:02 PM
hi !
thanks a for the quick reply again! i found out that the fues was burned ! but we fixed that.
Kevin
07-02-2009 03:39 PM
hello,
I just wondering where I can find the ANSI_C function definition and body ?
Kevin
07-06-2009 05:10 PM
07-07-2009 03:39 PM
hi,
I'm trying to figure out whether provided c - functions for PCI 6601 are able to exectue the following instuctions:
(1) First, I want to open a terminal and create a program to run "count" commands for linear encoder ( the progam runs 24 hours a day and 7 days a week ), it keeps counting
the positions of linear codes regardless and runs like a background program. but not "retriving" or "reading" positions from memory.
(2) second, open the other terminal to "read" current position (access the memory where it is located) whenever it is needed without closing the "counting" terminal. Meanwhile,
the "counting" program is still counting and updating the data for current position.
it is kinda like running two programs in parallel, and two of programs can access each other's. The reason why we want to do this is to prevernt the incorrect readings from linear codes happening. For example, linear encoders move accidently overnight.
if the described process is possibly to be done, what functions I suppose to use ? or is there any alternative way to achieve the above process ?
Kevin
07-10-2009 04:14 PM
07-13-2009 04:07 PM
hello Baker,
thanks for the reply. I'm write the code by applying multiThreadings concept. However i'm having touble to compling the code by using "make" commend.
It gives me a "segmentation fault" . is there any step required to modifiy the "Make" file in order to complie the ni ansi_c code with pthread.h lib ?
kevin