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 3
(3,569 Views)

When you say that it is not supported, what do you mean? Can you please attach a screenshot of the error that you are getting? What are you trying to handshake with? Can you give a little more background on this? 

 

You are right, the example is for 6533 and needs to be updated, however, if you are abiding by the 8255 standards, the code should work after a few tweaks. I will do a little more research in the mean time. 

 

Regards,

Sal H.
Applications Engineer
National Instruments
0 Kudos
Message 2 of 3
(3,549 Views)

NI support confirms that NI 6536B doesn't support 8255 handshaking, but NI 6536 does. That is why some properties are not supported.

 

Thanks,

0 Kudos
Message 3 of 3
(3,547 Views)