Jump to content

One DAQmx task with both input and ouput channel


Novice

Recommended Posts

QUOTE(Novice @ Sep 13 2007, 03:48 AM)

Hello,

Can someone tell me if it is possible to create one DAQmx task with both an input and an output channel?

And if so, how to write and read to those channels?

Thanks in advance.

Regards,

Novice.

Novice,

I haven't actually had to do this - use both AI and AO at the same time. It is certainly possible to take a reading and then place a change on an output and switch back and forth between the two operations. But it does not look to be possible within one DAQmx task. When you create a task you have to choose between one or the other. That does not mean there is no way to get the same result.

I assume you are asking because you do not know how assemble a VI that involves more than making a single task and running it.

That is what you are going to need to do - create a more complex program that runs at least 2 tasks.

You can certainly put two tasks on the block diagram, and if your hardware supports it, you can perform both input and output at the same time. It is that simple if your hardware will do it. Usually there is a lot more to the job than this if it is not simply an acedemic exersize. Often a DAQ card cannot do input and output simultaneously. Sometimes you need to have two serarate cards running simultaneously. Maybe simultaneous operation is not really needed... Maybe if the operations happen nearly at the same time that is good enough...

So perhaps you should tell us what hardware you are using. CPU, OS, version of LV, what DAQ card or other card are you using, signal conditioning equipment, etc. Then say more about the job you are trying to do. What will you be reading specifically (what sort of transducer, what range of voltage, how fast you need to read it, how long to read it?). What sort of output do you need to produce? What system will receive it and what is its purpose? And perhaps most important of all, what do you hope to learn from the exersize and what decisions do you need to make? Do you need only to tabulate or graph the data? Do you need to analyze the data? Perform some action directly based on the analysis, or simply store the information for later use? All these things can have an impact on the sort of VI design you should use.

If you answer these questions, then any effort we make to answer will have a better effect and be more worth the time to write the answer.

Best regards,

Mike

Link to comment

I think most, if not all, NI DAQ cards can do simultaneous input and output. But the DAQmx API was not designed to handle this as a single task. The main trick you want to use is to make both tasks share the same sample clock and starting signal when you are configuring them.

There is an example VI at <labview>\examples\DAQmx\Synchronization\Multi-Function.llb\Multi-Function-Synch AI-AO.vi, however that VI only has common start signal rather than forcing the sample clock to be shared as well. That should be good enough, but it is also pretty easy to share the sample clock with the same type of DAQmx property nodes.

Link to comment

QUOTE(jdunham @ Sep 13 2007, 04:11 PM)

I think most, if not all, NI DAQ cards can do simultaneous input and output. But the DAQmx API was not designed to handle this as a single task. The main trick you want to use is to make both tasks share the same sample clock and starting signal when you are configuring them.

There is an example VI at <labview>\examples\DAQmx\Synchronization\Multi-Function.llb\Multi-Function-Synch AI-AO.vi, however that VI only has common start signal rather than forcing the sample clock to be shared as well. That should be good enough, but it is also pretty easy to share the sample clock with the same type of DAQmx property nodes.

I am just learning the ins and outs of DAQmx so I may be off base here (BS warning). I think you can run E Series cards under DAQmx, but they have only one DMA channel so the simultaneity is compromised. I think the M Series cards will do it though.

Like most advise this is highly dependent on what hardware is used and what job is really to be done. Things we don't know about yet.

Mike

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.