11-21-2008 09:55 AM
Hello,
I like write a program to use AO and AI in the same program.
In this program write a timer a voltage to a AO port and after then it should read a voltage.
I know how I write voltage to a AO port and read a voltage on a AI port, but not in a the same program.
The read- and the write-Task, should work as soon as possible (<=1ms).
(My timer have 100us ticks)
what should I inilize for the PCI6229 card, to use AO and AI and in which order?
Can I have a example or pseudocode?
Best regards
Heiko Mayer
11-24-2008 09:43 AM
Hi Heiko,
because I don't know, which Software you are using and which Version, I just made a Labview VI for Version 8.2.
With this example, you can change the analog output value every loop duration.
You can control the duration time of te While loop by changing the
- Samples per channel and
- the rate.
At the moment you have a rate = 10000Hz and Samples per channel = 1000.
Because of that you loop will be executed every 0.1s (1000/10000).
Hope this helps
best regards
Dippi
11-24-2008 10:17 AM
Hello,
thank you for your reply.
>>because I don't know, which Software you are using and which Version, I just made a Labview VI for Version 8.2.
Sorry, I had forgotten this detail.
I program with C/C++ under the Realtime System INtime and I does not have LabView.
Have you got this example in C/C++ for me?
Best regards
Heiko Mayer
11-24-2008 10:25 AM
Hi Heiko,
perhaps this helps:
http://zone.ni.com/devzone/cda/epd/p/id/879
http://zone.ni.com/devzone/cda/epd/p/id/2352
http://zone.ni.com/devzone/cda/epd/p/id/2333
Best regards
Dippi
11-24-2008 10:37 AM
Hello Dippi,
thank you for your quick help, but I use this PCI6229 with the DDK drivers and not with DAQmx.
I need an example with DDK-instructions.
Best regards
Heiko Mayer
11-24-2008 10:46 AM
Hi Heiko-
There is very little overlap between the AO and AI examples, so you should be able to piece the code together pretty easily. I would offer these suggestions:
1. These lines should only be executed once, and they should be done before any AI or AO specific initialization is done:
configureTimebase (board);
pllReset (board);
analogTriggerReset (board);
2. It does not matter which order you perform the AI or AO initialization, but I would recommend waiting to unground the AO reference (by
board->AO_Calibration.writeAO_RefGround (kFalse);) until all of the AI and AO init is done. This will help to avoid any glitching on the AO lines. The only steps that should be saved until after ungrounding the reference are the Start operations for AI and AO (depending on the AO mode you use, there may not be a specific Start operation to call. Consult the MHDDK examples for more info about the required steps).
Hopefully this helps-
11-26-2008 11:27 AM
the program worked for me
AO_AI()
{
test( bus ) ; // function from aoex1.cpp
test( bus ); // function from aiex1.cpp
}