09-24-2015 03:27 PM
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.
09-24-2015 07:58 PM
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.
09-25-2015 12:38 AM
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.
09-25-2015 08:33 AM
@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.