01-29-2015 03:20 PM - edited 01-29-2015 03:21 PM
Can a single 9401 digital IO board be connected to more than a single counter (for quadrature decoding) in a 9174 chasis using Measurement Studio (not Labview VI) and ContinuousInputDaqComponent "component" (mxb) model? When I create a second component I get an Initialization Error (Device cannot be configured for input and output because lines and/or terminals on this device are in use by another task or route. ... Status Code: -201133
I tried moving the PFIs around with no success. Added Reserve code to Task with no success as well. This is a 1 Sample (On Demand) MXB generated component model.
If there is an example of multiple decoder code (in C#, C++ or ever VB) somewhere not using the component model
Snippet Below:
myLinearEncoder = new MotorLinearEncoderComponent(); myLinearEncoder.TaskReserve(); myLinearEncoder.TaskCommit(); myLinearEncoder.DataReady += OnLinearEncoderCounterDataReady; myRotaryEncoder = new MotorRotaryEncoderComponent(); myRotaryEncoder.DataReady += OnRotaryE ncoderCounterDataReady; myLinearEncoder.StartRead(); <--- fails here myRotaryEncoder.StartRead();
01-30-2015 07:42 AM
Never mind. The reserved task needs to be started last thus the following works:
myLinearEncoder = new MotorLinearEncoderComponent(); myLinearEncoder.TaskReserve(); myLinearEncoder.DataReady += OnLinearEncoderCounterDataReady; myRotaryEncoder = new MotorRotaryEncoderComponent(); myRotaryEncoder.DataReady += OnRotaryEncoderCounterDataReady; myRotaryEncoder.StartRead(); myLinearEncoder.StartRead();
and in user code for component
public void TaskReserve()
{
Task.Control(TaskAction.Reserve); //locks GPIO
}