Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

After DAQMx event set cannot access digital input

I setup a DAQMx event and event structure to trigger when a digital input goes high to low, that works great in the event structure but once I configure that in the beginning of the application I cannot see the state of that same digital input. Pleas share how to do that after the DAQ event is setup.

Thanks

0 Kudos
Message 1 of 5
(3,341 Views)

Hi Mike,

 

What hardware are you using? Can you detect the change event fine? You should still be able to read those lines after configuring them for change detection; I was able to verify here at my desk. What are you ultimately trying to accomplish?

Matt
Applications Engineer
National Instruments
0 Kudos
Message 2 of 5
(3,320 Views)

Using a PCI 6221 but I have the event structure in one while loop which pushes states onto a message Queue for the upper loop to do the work, (based off producer/consumer framework), not sure if makes a difference.

 

All I want to do is setup the daq event on p0.0 for a high to low transition caught in the event structure (works fine) but in the timeout (100ms) of the event structure, I want to look at that same p0.0 line for it's status. Whenever I try to put the daq read in the timeout of the event it seems to hang the app.

 

see attached app.

0 Kudos
Message 3 of 5
(3,314 Views)

Hi Mike,

 

It looks like you have your digital task’s sample clock configured as “Change Detection”, therefore when a change is detected all your lines configured in the task are sampled and you can then read them in your event structure. In the timeout case of your event structure your digital read will time out because there was no sample clock pulse and therefore no samples to read.  

Matt
Applications Engineer
National Instruments
0 Kudos
Message 4 of 5
(3,298 Views)

I will try that but I'm pretty sure if I put that digital read in the state machine loop, the read fails but I will try both and report, thanks!

0 Kudos
Message 5 of 5
(3,290 Views)