From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

DAQmx initialize digital read with 8255 handshaking

I want to configure 6536B device for digital read with 8255 handshaking. 

 

myTask = new Task();
myTask.DIChannels.CreateChannel("Dev1/port0_32", "", ChannelLineGrouping.OneChannelForAllLines);

 

// triggers
myTask.Triggers.HandshakeTrigger.Interlocked.Source = "PFI0";
myTask.Triggers.HandshakeTrigger.Type = HandshakeTriggerType.Interlocked;
myTask.Triggers.HandshakeTrigger.Interlocked.AssertedLevel = InterlockedHandshakeTriggerAssertedLevel.Low;

 

// events

myTask.ExportSignals.HandshakeEventOutputTerminal = "PFI1";
myTask.ExportSignals.HandshakeEventOutputBehavior = HandshakeEventOutputBehavior.Interlocked;
myTask.ExportSignals.HandshakeEventInterlockedAssertedLevel = HandshakeEventInterlockedAssertedLevel.Low;
// - not supported!   myTask.ExportSignals.HandshakeEventInterlockedAssertOnStart = true;

 

// Timing
myTask.Timing.ConfigureHandshaking(SampleQuantityMode.ContinuousSamples, 4096);
myTask.Timing.HandshakeDelayAfterTransfer = 0.0;
// - not supported!    myTask.Timing.HandshakeSampleInputDataCondition = HandshakeSampleInputDataCondition.HandshakeTriggerAsserts;

 

reader = new DigitalSingleChannelReader(myTask.Stream);

myTask.Control(TaskAction.Verify);
myTask.Start();

digitalCallback = new AsyncCallback(DigitalCallback);

reader.BeginReadMultiSamplePortUInt32(5, digitalCallback, myTask);

 

and later...

 

private void DigitalCallback(IAsyncResult ar)
{

     data = reader.EndReadMultiSamplePortUInt32(ar); 

 

   ...

}

 

reader throws 'timeout' exception. 

 

This code has been created after old C++ based code for NI 6533 device which works fine. Two code lines labeled 'not supported' cause 'not supported' exceptions for NI 6536B device.

Can somebody point me to example for digital read with 8255 handshaking?

 

Thank you,

 

 

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

Hi lmeyerovich,

 

First, all of this appears to be C# but for sake of verification, are you writing this in C#?

 

I was able to confirm the unsupported exceptions you're seeing are because the 6536B does not support those two properties, while the 6533 does.  I confirmed this in LabVIEW by configuring tasks for both cards and looking at the available properties for their respective tasks. The properties were available in the DAQmx property node for the 6533 but not the 6535B. Presumably, there is a different assertion mechanism for the 6536B, though I'm not yet sure exactly what that is yet.

 

 

I think the reader is likely throwing a timeout because of the lack of an assertion mechanism so the krux of the situation appears to be initiating the start of the task.

 

I haven't been able to find any examples in C# that apply to the hardware you're using, but I will update if I find any.

Regards,
Message 2 of 5
(3,958 Views)

Thanks for confirming that 6536 doesn't support these properties. Yes, I need to implement it in .NET. BTW, is there any way (information) to check if device supports some particular  properties? I didn't find how to do it without writing the code. The only example I have found is for burst handshaking, but I my connected device implements 8255 protocol.

 

Thanks, 

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

Hi,

I think you will have a lot more luck if you post this to the NI Discussion Forums (http://forums.ni.com) - there is a very active community on the forums that may be able to provide some help. This may be a question for the specific MultifunctionDAQ forum (http://forums.ni.com/t5/Multifunction-DAQ/bd-p/250)
I hope that helps! Good luck getting things working!
Alberto
NI Community Team"

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

I usually just set up a task in LabVIEW and use a property node to look at the available properties.  The DAQmx driver is smart enough to filter the properties based on the selected device, so it's an easy and quick way to check.  I was also able to confirm this in Visual Studio as well by checking available members but it's a bit less obvious there.

Regards,
0 Kudos
Message 5 of 5
(3,906 Views)