Measurement Studio for VC++

cancel
Showing results for 
Search instead for 
Did you mean: 

getting started with VC++ for DAQ programming

Hello friends,
I want to program S series PIC6123 DAQ using VC++. I am new to VC++. Can you guide me how should i start to learn VC++ and to get started to develope the application
0 Kudos
Message 1 of 11
(6,116 Views)
Hi Dv,

To start with DAQmx applications and Visual C I would suggest looking at the shipping examples found at: C:\Program Files\National Instruments\NI-DAQ\Examples\DAQmx ANSI C if you used the defaults when you loaded NI-DAQmx.

As for starting with VC++ I would suggest using Microsoft's Visual C++ Development Center and  Microsoft's Visual C++ Tutorials.  Also, Google is a very useful tool for Tutorials.

Good luck!
Micaela N
National Instruments
0 Kudos
Message 2 of 11
(6,096 Views)
Dv,

You'll also find the DAQmx Help files useful, they are located STart >> National Instruments >> NI-DAQ.  The NI-DAQmx C Reference Help and the NI-DAQmx C API Visual Basic 6.0 may be the most useful.

Thanks,
Micaela N
National Instruments
0 Kudos
Message 3 of 11
(6,095 Views)

As you said in my thread for appilcation note for ANSI C. Can you please give me referance to any DAQ mx programming in ANSI C application note. For your referance i am once again repeating.. i have studied all help files provided with the installation CD and some example programs too... but there are application note using Labview.. can you provide me such examples in ANSI C.

Thank you.

0 Kudos
Message 4 of 11
(6,071 Views)
Hi Dv,

There aren't any application notes per se that are written directly for programming a DAQmx task in C, but once you include all of your DAQmx library files in your project (as discussed in the following KB: http://digital.ni.com/public.nsf/websearch/0087C1E20920F7B986256D9B0061DEE2?OpenDocument ), you should be able to make the same DAQmx function calls in the same order that they mention in the DAQmx with LabVIEW app notes.  All of the functions you would call in LabVIEW are called in C in the same order as they would appear in LabVIEW.

In addition to this, you should be able to find a programming example that is similar to what you are trying to accomplish.  If you specify what you are trying to accomplish with your PCI-6123, we may be able to direct you to a good example to start with.

Thaison V
Applications Engineer
National Instruments

0 Kudos
Message 5 of 11
(6,057 Views)
Hi,
I am using 4472, and the timer 6602 as external clock, the output of 6602 is connected to channel(0) of 4472, I implemented the timing function of 4472 as following:
 
DAQmxCfgSampClkTiming(handle,"Dev1/a0", sample_rate, activeEdge,samplemode,sampPerChanToAcquire);
 
but  I got an error code about the terminal name ,"Dev1/a0", I don't know what is the problem,
also, I want to store the acquired data on disk, I couldn't find the appropriate function in NI-DAQmx C reference.
 
thanks for helping
Amna
0 Kudos
Message 6 of 11
(6,045 Views)

hi Thaison V

Thank you for your suggessions. I will follow the interrelations you provided between Labview examples and trying the same in C.

Regarding my application: I am using NI PCI 6123 for acquiring three current signals from induction motor and i will be doing FFT analysis of this currents. Based on the FFT analysis i will display the output on screen. Would you like to have more information to make the topic clear please let me know.

Once again..Thank you

Dhaval

0 Kudos
Message 7 of 11
(6,037 Views)

Hello Amna,

The terminal name you are using is incorrect, it should be "Dev1/ai0".  Why are you trying to use an analog input channel as the source for your sample clock?  This is not supported functionality.  In fact, DSA devices do not support using an external clock at all

DAQmx does not provide File I/O functions, you will have to look at the documentation for the programming language you are using to find these functions. 

Perhaps if you could give us more information about what you are doing we could recommend a different approach.

Thanks,

Laura

0 Kudos
Message 8 of 11
(6,016 Views)
Hello,
 
Thank you for your replying,
I tried what you suggessted but I am still receiving the same error, the reason why I am using 6602 with 4472 is, The counter 6602 as pulse generation to synchronouse the source of the signals (mm-wave generator) and the 4472 which reads these signals, in my project both devices should be synchronoused with same clock.
Thank you in advance!!
 
 
 
0 Kudos
Message 9 of 11
(6,006 Views)

Hello Dhaval,

There are examples that show you how to do analog input in the folder that Micaela referenced above.  I would suggest starting with a current example and then modifying it to do the FFT analysis that you need.  Be sure to read all of the instructions in the example, because you will need to use an external shunt resistor to do the current measurement.  You can reference this KnowledgeBase article for more information. 

Regards,

Laura

0 Kudos
Message 10 of 11
(5,999 Views)