Jump to content

DAQMX event on digital input


atk_nut

Recommended Posts

QUOTE(crelf @ Jul 13 2007, 01:51 PM)

This would be a great place to use "user" events - have a parallel loop watching the DAQ card and fire a user event when it sees the transition. Try "Find Examples" for "user event".

Attached is an image of a test program I built for just that purpose. I defined an AI task named Monitor and register it as a User Event. You have a few choices of Events to choose from, I selected Done. Then register this event with the event structure. Hook your button up to the PFI line and when the button is pushed it will start this acquisition and when the acquisition is done, the event will fire.

In my case, I use PFI0 to start my acquisition (an external trigger from an MRI) and then switch over to PFI1 to register each button push from a test subject (PFI1 is the wired-OR response of four push buttons, and after getting this trigger my task checks all four buttons to see which has been pushed). My AI task acquires 10 points at 1 kHz, so the event is 'Done' 10 ms after the trigger.

Link to comment

QUOTE(crelf @ Jul 13 2007, 08:38 PM)

Can you please post the code so we can see what's in the other cases?

Here is the code. The other case is where I would put the code to process the button data, so the vi doesn't contribute too much more than the image did.

Link to comment

QUOTE(rpursley @ Jul 14 2007, 12:50 PM)

...the vi doesn't contribute too much more than the image did.

:thumbup: Thanks! I know it's only a bit more info, but I think it was important to round it out, especially when people search the forums for it.

Link to comment
  • 1 month later...

Hi All-

This might be a good application for using a change detection signal event. What type of hardware are you using? If you are using a plugin M Series or an industrial DIO board that supports change detection you can use the example I posted here. The only other requirements are that you use LabVIEW 8.0 (or later) and NI-DAQmx 8.0 (or later)

Hopefully this helps-

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.