Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

what Include files are to be included/used to run a C code in VC++ using NIDAQmx for PCI-6704

sir,
Following are the details of softwares i am using for running my c code to read a data from text file as a single sample on demand mode.Some linker error came when i tried to built it in VC.
 
VC++ version - 6.0 (98)
NIDAQmx -       8.0
Files included : NIDAQmx.h,NIDAQmx.lib
Error Reported : LNK2001: Undefined external  _WN16@..
Functions used: DAQmxCreateTask(...),DAQmxStartTask(....),another function to generate an analog ouput voltage(float64) signal.
I would like to know if some other files are also required to run such codes using a DAQ card PCI-6704 or if make file or dll file has to be created to run it?
 
0 Kudos
Message 1 of 9
(4,612 Views)
 

Hi,

The first things to check is that you're correctly configuring your project. There is a KnowledgeBase article that describes how to program DAQmx in Visual C++ 6.0. Please follow the instructions in the "Visual C++ 6.0 without Measurement Studio" section, and if you still have problems, please share what happened, and we'll continue from there.

 
Joe Friedchicken
NI Configuration Based Software
Get with your fellow OS users
[ Linux ] [ macOS ]
Principal Software Engineer :: Configuration Based Software
Senior Software Engineer :: Multifunction Instruments Applications Group (until May 2018)
Software Engineer :: Measurements RLP Group (until Mar 2014)
Applications Engineer :: High Speed Product Group (until Sep 2008)
0 Kudos
Message 2 of 9
(4,596 Views)
Sir,
 
I am reading voltage values from a text file using C - code in VC++ & writing the values to my PCI-6704 card using DAQmx 8.6 to its 9 voltage output channels.The C-code which i m using is example program given in documentation for ANSI-C dev in DAQmx for updating channel values using software timing with some modifications for accomodating 9 channels.
                                          Now the problem is that during the execution of code, the values my DAQ card is giving as ouput are correct but at the end of execution,  the value on all the channels is not the last value given to individual channel but the last value given to the last channel..i.e. 9th channel. I dont have any idea why this problem is coming.
                                           I am updating the values on the channel every 25ms.Secondly, I am trying to use a C-function to update my all channel values simultaneously on demand but it is showing that this function is not supported by my card although my card supports 'On Demand' mode.
               
0 Kudos
Message 3 of 9
(4,558 Views)
Hi,

Most likely, there is a small quirk your algorithm or code. I can take a look at your code to see if I can find what's going wrong, but I think you'll be able to find it with some testing. If you do want me to look at your code, please simplify and comment it so that it's the shortest possible program that still exhibits this behavior. It will be even better if you can make only one or two modifications to a shipping example.
Joe Friedchicken
NI Configuration Based Software
Get with your fellow OS users
[ Linux ] [ macOS ]
Principal Software Engineer :: Configuration Based Software
Senior Software Engineer :: Multifunction Instruments Applications Group (until May 2018)
Software Engineer :: Measurements RLP Group (until Mar 2014)
Applications Engineer :: High Speed Product Group (until Sep 2008)
0 Kudos
Message 4 of 9
(4,547 Views)
I have attached the code which i am using for my application..i tried finding the bug but no success..This code is giving correct values till the end but at the end of file,it is giving 9th channel value to all the other channels too.Thus, last value which i am getting on all channels is the 9th channel value not individual channel value... 
0 Kudos
Message 5 of 9
(4,506 Views)
 

Hi,

I compiled your code, created my own volt.txt file, and could not recreate your problems. The contents of my volt.txt file were:


volt.txt
0 .5 1.0 1.5 2.0 2.5 3.0 3.5 4.0
0 .5 1.0 1.5 2.0 2.5 3.0 3.5 4.0
0 .5 1.0 1.5 2.0 2.5 3.0 3.5 4.0
0 .5 1.0 1.5 2.0 2.5 3.0 3.5 4.0
0 .5 1.0 1.5 2.0 2.5 3.0 3.5 4.0

It is possible that some kind of hardware failure happened with your board. If you would like to explore having your board repaired, please contact National Instruments technical support at https://www.ni.com/my-support/s/service-requests . When you speak with an engineer, please mention this thread and she or he can contact me for additional background information.

However, if you wish to continue troubleshooting, please describe how you measured the voltages on each channel at the end of your program. I took my measurements using an SCB-68 and a hand-held DMM and measured the voltage between pin 33 (AO GND) and pins 34, 66, 31, 63, 28, 60, 25, 57, and 22. Each analog output channel had the correct output voltage.

 
Joe Friedchicken
NI Configuration Based Software
Get with your fellow OS users
[ Linux ] [ macOS ]
Principal Software Engineer :: Configuration Based Software
Senior Software Engineer :: Multifunction Instruments Applications Group (until May 2018)
Software Engineer :: Measurements RLP Group (until Mar 2014)
Applications Engineer :: High Speed Product Group (until Sep 2008)
0 Kudos
Message 6 of 9
(4,480 Views)
Sir,
I have solved the problem. The problem was not with DAQ card but with the text file. Actually, in the text file from which i was reading the input values, after the last input value, there was some space left before end of file.When i deleted that space from my file, problem got solved. I recreated that space again to just confirm and that problem again surfaced.So  it was not a DAQ problem. Now my card is working just fine. Hence,there must not be any space left in the input file while perform read operation using C-function  for reading of DAQmx.

0 Kudos
Message 7 of 9
(4,451 Views)
sir,
I am trying to time my DAQ output using software C 'delay()' function. But the timing is not accurate as it is varying by 2 ms which can give wrong result. Thus, i would like to know if there is any hardware clock or any such hardware timing signal present with in PCI 6704 which i can use to time my application using my C code. Timing is of the order of 25 ms. 
0 Kudos
Message 8 of 9
(4,331 Views)
 
 

space_abhi,

The PCI-6704 only has software timing capability since it is a static analog voltage output board.  I took a look at your code and see that you are starting and stopping the task independent of the while loop.  The fluctuation in delay is probably system dependent, though.  If hardware timing is needed to tighten your delay time, then you may want to consider purchasing another card.  If 9 channels are a must then you might consider a card like PCI-6723.  If you could lower the channel count to 8 then a card like PCI-6722 might be a possibility as well.  If these cards are of interest to you, please let me know and we can get you in contact with NI support.



Message Edited by G Lo on 05-29-2008 02:43 PM

0 Kudos
Message 9 of 9
(4,315 Views)