Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

DigitalSingleChannelWriter vs DigitalMultiChannelReader

Thanks for your reply.

 

I can leave the digitalInSycTask out of the class, it will still throw the same exception about the busy resource.

 

I started working on a digitalInSycTask where I could read on a regular basis by the NI engine thread. Then I can keep control of when output and input tasks are executed. If I would launch the digitalInSycTask with a 100ms interval using a handler, I'm worried that it could run the same time while another thread is updating an output. The same exception would occur.

 

Does anybody have a working example were async handler is waiting for inputs level changes while you are updating the outputs? I can't even do that via the test panel via NI max.

 

0 Kudos
Message 11 of 14
(2,187 Views)

MeasurementStudioFan wrote:

Does anybody have a working example were async handler is waiting for inputs level changes while you are updating the outputs? I can't even do that via the test panel via NI max.

 


I created a simulated USB-6525 in NI-MAX.

I created Task1 for the digital outputs and Task2 for the digital inputs. Two is all you really need.

I configured Task2 for Acquisition Mode = Continuous Samples; Samples to Read = 100; Sample Clock Type  = Change Detection

 

I am able to run both tasks and I am able to change the digital outputs.

0 Kudos
Message 12 of 14
(2,180 Views)

Your task2 is generating a stream that is handled by a DigitalMultiChannelReader. You started it async with BeginReadMultiSamplePortUInt32(..) and meanwhile you're changing the outputs. Please post your code.

0 Kudos
Message 13 of 14
(2,173 Views)

@MeasurementStudioFan wrote:

Your task2 is generating a stream that is handled by a DigitalMultiChannelReader. You started it async with BeginReadMultiSamplePortUInt32(..) and meanwhile you're changing the outputs. Please post your code.


As I wrote, I did this in NI-MAX, which you wrote you were not able to do.

 

 

 

0 Kudos
Message 14 of 14
(2,165 Views)