Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Lag in polling DIO

Solved!
Go to solution

hi there,

 

Im am polling a DIO used as a trigger. So basically when the digital line goes high (true - boolean), my program acquires some AIs and performs two pulse width measurements using a counter. It appears that the counter outputs a wrong value for some reason for the first pulse duration measurement. Ive tried measureing the pulse width separately - i.e. without polling the DI  - and it works fine but for some reason, when i poll the DI,  it stops the pulse width calc from working properly

 

any ideas?

 

cheers

don

 

 

0 Kudos
Message 1 of 5
(4,048 Views)

oh btw, im using a pcie 6259 DAq card and the digital input is a TTL from an SPDT relay.

 

thx.

don

0 Kudos
Message 2 of 5
(4,042 Views)

Hi DAQ_Newbie,

 

It would be great if you gave a detailed description of your application, as there may be a better/more efficient way of tackling the issue than the way you're trying to do it. I can tell you that what I think is wrong with this VI (besides the subVIs not being posted) is that when the DO line is asserted high you send the notification in software to a case structure, create the pulse width measurement,  and try to read a signal that has probably been gone for several milliseconds because of the delay in software and creating the task. Even if you could have the pulse width task start right away, it would still need the rising edge as a reference point for the measurement, but that is the very signal used to turn it on. 

 

In the meantime, here are some great links for DAQ beginners that would probably help you get up to speed on the most important topics. I hope this helps.

Getting Started with NI-DAQmx: Main Page
Learn 10 Functions in NI-DAQmx and Handle 80 Percent of Your Data Acquisition Applications

Mark E.
Precision DC Product Support Engineer
National Instruments

0 Kudos
Message 3 of 5
(4,019 Views)

hi mark,

thx for ur prompt reply.

 

Part of my application in essence, is to once a DI goes high, my app goes into first waiting for a trigger to start acquiring 10 AI channels, also waits for counter 0 to fire and measure the pulse width of a TTL signal twice.

What better way di u have in mind instead of polling the DI to trigger the case structure.

 

thx for helping

don

0 Kudos
Message 4 of 5
(4,010 Views)
Solution
Accepted by topic author DAQ_Newbie

Hi Don,

 

It seems that you could do arm start triggering using a counter. Searching ni.com for "arm start trigger' may be a good start to finding out more, but here are a few links as well.

Hardware Counter Start Trigger for Counter Synchronization

NI-DAQmx: Counter Input Start Trigger

Mark E.
Precision DC Product Support Engineer
National Instruments

Message 5 of 5
(3,999 Views)