Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

simultaneous analog input and output PCI 6321

I need to simultaneously execute an analog output to generate a waveform and then collect two channels of analog input.  I've tried a couple of things that I found in the NI help but I couldn't get them to work.  Any advice would be appreciated!  Thanks!

0 Kudos
Message 1 of 10
(4,431 Views)

Hi hhuds,

Please post the code you are having problems with so we can edit it and help!

Regards,

John McLaughlin
Academic Account Manager
National Instruments UK & Ireland
0 Kudos
Message 2 of 10
(4,413 Views)

Hello hhuds,

I might be a good idea to take a step back and look at some of the examples that ship with DAQmx. If you look in the Example Finder in LabVIEW and navigate to Hardware Input and Output»DAQmx»Synchronization»Multi-Function. There are a couple of examples that you could find useful in this directory, the Multi-Function-Synch AI-AO.vi being the simplest.

Examples.png

Regards,
Dan King

Message 3 of 10
(4,406 Views)

Hi John,

 

I've now attached the two programs I am trying to integrate. One that has the output and the other has the inputs.  Thank you!

 

Hannah

0 Kudos
Message 4 of 10
(4,375 Views)

Hey Dan,

 

I'll try the multi-function sync AI- AO like you've suggested.  Thank you for letting me know about that. 

 

Hannah

0 Kudos
Message 5 of 10
(4,374 Views)

Hey hhuds,

The Multi-funct Sync AI-AO example is very useful as Dan suggested, it should be very helpful for what you are after. Thanks for posting your code also!

If you have anymore questions don't hesitate to post!

Regards,

John McLaughlin
Academic Account Manager
National Instruments UK & Ireland
0 Kudos
Message 6 of 10
(4,370 Views)

I've got the programs integrated together but I keep getting an error about buffering.  I am unsure in this case how to fix this in my program.  I've attached the combined program with the buffering problem.  I think this program would work aside from that.  Thanks!

0 Kudos
Message 7 of 10
(4,334 Views)

Also I just ran the program and before I got error 200292 (buffer error) I put probes on my task wires and none of my tasks had executed.  I have no idea where to go from here, any advice would be fantastic.  Thanks!

0 Kudos
Message 8 of 10
(4,331 Views)

Hi hhuds,

Have you tried wiring a constant to the 'samples per channel' node on your bottom sample clock? Also try wiring a constant to your 'DAQmx Read - Number of samples per channel' node. this seem to sometimes to do the trick as your buffer is simply running out of space.

If these suggestions don't work then try adding a small timing function (Wait ms) in your while loop.

Let me know if this helps!

 

John McLaughlin
Academic Account Manager
National Instruments UK & Ireland
Message 9 of 10
(4,316 Views)

Any idea why I don't have all those examples that Dan_K listed? I have DAQmx installed and I also have folder named DAQmx -> Synchronization but with only 2 examples 😞

Michał Bieńkowski
CLA, CTA

Someone devote his time to help solve your problem? Appreciate it and give kudos. Problem solved? Accept as a solution so that others can find it faster in the future.
Make a contribution to the development of TestStand - vote on TestStand Idea Exchange.
0 Kudos
Message 10 of 10
(3,822 Views)