Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

Incorrect DI readings with change detection events and USB-6229

Simon,

 

I understand your suggestion but it would require that I duplicate my hardware (PXI Cards don't come Cheap) adding an oncost to each my systems of around $750, so.. No, not an option.  I would Revert back to the original Polled system and pay for it with a balance between latency and cpu overhead.

 

I am working with a 6521 and a 6280

 

6521 doesn't support data transfer mechanism property, 6280 won't work without it.

I am going to have to write some cunning code to detect the type and decide which method to use.

 

 

Tim L.

iTm - Senior Systems Engineer
uses: LABVIEW 2012 SP1 x86 on Windows 7 x64. cFP, cRIO, PXI-RT
0 Kudos
Message 21 of 25
(953 Views)

Timmar,

 

Here's a trick you can use *after* the first change has been detected.  For initial state, you may still have to do the little dance where you first query the digital states in an unbuffered task, then reprogram for a buffered change-detection task. 

 

Since you are normally reading all available, here's the special code to call to see the current state.  It actually reads the most recently buffered state, but since that represents the last change the current state should still be the same.

 

read most recent.png

 

 

I've used this kind of construct a lot for other data acq tasks where I just need a snapshot of

recent data.  (You may need to use a diff version of DAQmx read to match your port size or

channel config in case you're using bool arrays, dig waveforms).

 

-Kevin P

CAUTION! New LabVIEW adopters -- it's too late for me, but you *can* save yourself. The new subscription policy for LabVIEW puts NI's hand in your wallet for the rest of your working life. Are you sure you're *that* dedicated to LabVIEW? (Summary of my reasons in this post, part of a voluminous thread of mostly complaints starting here).
Message 22 of 25
(941 Views)

Kevin,

 

This is a masterpiece, Most impressive

 

I have Given you a Kudos for finding a way to do that,

Not quite a solution, but impressive none the least.

I am going to keep this in my amory for just such an occasion.

 

At this point I am doing a standard, asynchronus read during task setup, this gets me 9/10ths of the way there.

 

I am still exposed if there is a change between my pre-sample and program "Main" starts.

 

If only there was a way to force/trigger this..........

 

 

Tim L

iTm - Senior Systems Engineer
uses: LABVIEW 2012 SP1 x86 on Windows 7 x64. cFP, cRIO, PXI-RT
0 Kudos
Message 23 of 25
(930 Views)

What about a device reset?

iTm - Senior Systems Engineer
uses: LABVIEW 2012 SP1 x86 on Windows 7 x64. cFP, cRIO, PXI-RT
0 Kudos
Message 24 of 25
(928 Views)

Hi folks,

 

I’m working with a PCI-6229 card and was running into same issues. I’ve three digital inputs, where I can toggle one easily. The other ones are connected to relays, which I don’t want to switch around too much.

 

I tested different approaches and was able to reconstruct the issue, that there were more samples acquired than events generated.
My intention was basically to react on input change with sending a message to another actor (using the actor framework). So I want to ignore bouncing inputs and just need the actual state. For this I basically do what Kevin said: “don't just read 1 sample”. I read multiple samples, until I have the last one. So far it seems to be working pretty well for me.

 

A small note:
The two other inputs I wasn’t toggling that much are by default one high and one low. I recognized that the low input was floating while I was toggling my test input. But this might be a ground issue with the external system. Don’t know how this is set up.

0 Kudos
Message 25 of 25
(851 Views)