Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

DigitalChangeDetection initial values

Hi,
we are using a PCI-6518 for digital I/O to handle in a C# program. With DigitalChangeDetection ist works so far. But one problem is to get the initial values after starting the Task. In this case we do not expect a change, we only want to know the actual state of all input ports. We tryed to use the method ReadSingleSampleMultiLine( ) but it seems that the buffer is initial empty and this method  comes in a timeout.

Is there a method to get the initial values from this I/O card?
0 Kudos
Message 1 of 6
(4,359 Views)

@dki55 wrote:
Hi,
we are using a PCI-6518 for digital I/O to handle in a C# program. With DigitalChangeDetection ist works so far. But one problem is to get the initial values after starting the Task. In this case we do not expect a change, we only want to know the actual state of all input ports. We tryed to use the method ReadSingleSampleMultiLine( ) but it seems that the buffer is initial empty and this methodà   comes in a timeout.

Is there a method to get the initial values from this I/O card?





Hi dki55,

when configuring the DIO change detection, your read function will be halted to the timeout as the trigger has not detected a change and - as you stated correctly - there simply are no samples to read....

One possible solution might be to firstly configure the read task to read the initial line states without triggering information. After successfully reading your digital lines, stop the task, insert the change detection for triggering and start the task again.

There is one drawback in this solution: you will lose some information in the period between stopping and restarting the task.

Hope this still helps,
Sebastian
0 Kudos
Message 2 of 6
(4,327 Views)
Thanks Sebastian! Meanwhile I'm trying to do so. But You'r right: The Time between initial read and starting changedetection task is lost. May be the gap ist very small but there is a gap. I'm afraid that we must live with this looseness.

Or ... ist there anybody with a better solution without a gap?
0 Kudos
Message 3 of 6
(4,323 Views)
Hi dki55,

if the advice SFK gave you does not work you should try to use the first channel read in an own task. So you have to create a new task before the changededection task.

Kind Regards, Chris
0 Kudos
Message 4 of 6
(4,321 Views)

I don't know that particular hardware, but do you have any extra change-sensitive DI bits available and perhaps a spare DO bit somewhere?  If so, you could fire off an initial change yourself with the spare DO wired directly to the spare DI.

(I faced this problem before, needing to know the initial state prior to the first detected change.  In my case, I had control of the environment enough that I could do a static port read, then stop and reconfigure for change detection without missing anything.  Your case sounds different.)

-Kevin P.

ALERT! LabVIEW's subscription-only policy came to an end (finally!). Unfortunately, pricing favors the captured and committed over new adopters -- so tread carefully.
0 Kudos
Message 5 of 6
(4,313 Views)
One possible solution is to switch to a PCIe/PXIe-6536/7.  When it starts (from a start trigger or immediately), it samples the current value as its first sample, then it starts recording changes.   The 6536/7 doesn't have digital filtering, but you can configure its clock (use an external clock, or use a slower internal clock) to approximate digital filtering.

Jeff

@dki55 wrote:
Thanks Sebastian! Meanwhile I'm trying to do so. But You'r right: The Time between initial read and starting changedetection task is lost. May be the gap ist very small but there is a gap. I'm afraid that we must live with this looseness.

Or ... ist there anybody with a better solution without a gap?



0 Kudos
Message 6 of 6
(4,292 Views)