Jump to content

How to read the state of a digital output?


patufet_99

Recommended Posts

Hello,

When using standard multifunction NI-DAQ cards (as the M series), is there a way to know the status of a digital output?

When executing a VI, at initialisation I would need to know the actual status of the digital outputs without having to changing it.

Thanks for your help.

Hello it's quite easy, have a look at following example:

post-1396-1166519411.png?width=400

So just use DAQmx Read to read an Digital Output.

But be careful if you invert a DO Task, and you read the DO Task with DAQmx Read, the result is not inverted!!

I don't now if this is a bug or if this has to be. In my opinion it's probably a bug...

Because if I configure a Task as Inverted, I expect also the read to be inverted (if I use the Task Name and don't read direct a DO over it's DO number (port etc.)

Link to comment

Hello Martin,

Thanks for your reply. As you noted is quite easy! I was just disturbed by the fact that digital ports can be used as inputs as well as outputs.

Merry Christmas and thanks again.

Regards.

Patufet

Hello it's quite easy, have a look at following example:

post-1396-1166519411.png?width=400

So just use DAQmx Read to read an Digital Output.

But be careful if you invert a DO Task, and you read the DO Task with DAQmx Read, the result is not inverted!!

I don't now if this is a bug or if this has to be. In my opinion it's probably a bug...

Because if I configure a Task as Inverted, I expect also the read to be inverted (if I use the Task Name and don't read direct a DO over it's DO number (port etc.)

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
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
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.