I'm trying to use the current outputs of a 6704 and read the voltage inputs of a 6052E board from Visual C# .Net. Both cards are in a PXI rack, and my PC connects to them over RDA.
Both cards work perfectly from within Labview and MAX test panels.
I added the CWAOPoint and CWAIPOint controls to the form and called them AI1 and AO1. In properties I configured them to device 1 and 3 (the device numbers in MAX).
Then I use the following code:
// Write
float[] target = new float[16];
for (int i=0; i< 16; i++)
target[i] = i; // from 1 to 16 mA
AO1.ChannelString = "16..31";
AO1.SingleWrite(target, true);
// Read
object result = null;
float[] results = new float[5];
float lowerlimit = 0.0F;
float upperlimit = 5.0F;
fl
oat timelimit = 1.0F;
AI1.Channels.RemoveAll();
ChannelString = "0, 1, 2, 3, 4, 5, 8, 9, 10, 11, 12, 13";
AI1.Channels.Add(ChannelString, upperlimit, lowerlimit, CWAIInputModes.cwaiDefaultInputMode, CWAICouplings.cwaiDC);
ChannelString = "6, 7"; AI1.Channels.Add(ChannelString, upperlimit, lowerlimit, CWAIInputModes.cwaiDIFF, CWAICouplings.cwaiDC);
AI1.SingleRead(ref result, timelimit);
results = (float[])result;
Both the SingleRead and SingleWrite lines produce an exception:
System.Runtime.IneropServicdes.COMException(0x800A28A1): Configuring channels. The specified device is not a National Instruments product, the driver does not support the device (for example, the driver was released before the device was supported), or the device has not been configured using the Measurement & Automation Explorer. at ...
"Configuring channels." is only shown for the AI1.SingleRead call.
Somebody knows what I could be doing wrong here?