Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

Exception with status code -200552 while adding an Analog ai/ao channel

Hi All,
 
While trying to add AI channel in the NI DAQmx i am getting following exception. The funny part is that earlier i was having another VS solution. There this string value is working perfectly fine. However later i created a new solution and borrowed some classes from the previous solution. hence the code is just Ditto! and with the new solution i am getting this exception.
 
I searched for this error code but it just says that there is some invalid character. The position that the character is pointed to is 7. assuming 0 index it is '/' in the string "Device1/ai0".
Please tell me what is the fault. I have tried adding other channels than ai0 and same error and same popsition is getting reported.
 

Measurements: Specified string is not valid, because it contains an invalid character.
Position of Invalid Character: 7
Invalid String: Device1/ai0
Task Name: PrimaryAIReader
Status Code: -200552
 
Look forward to some solution,
 
Alok Damle.


Message Edited by Alok Damle on 05-01-2008 12:01 PM
0 Kudos
Message 1 of 3
(3,627 Views)

Hi Alok,

Have you used your DAQ hardware with the Traditional NI-DAQ drivers recently? If you have you must reset the Traditional NI-DAQ drivers before using the card with NI-DAQmx. Sometimes if this reset has not been done it can cause the error you are seeing. To reset the Traditional NI-DAQ drivers, open Measurement and Automation Explorer (MAX). Under Devices and Interfaces, Right-click on Traditional NI-DAQ (Legacy) Devices and select Reset driver for Traditional NI-DAQ.

If this does not apply to you I have a few questions to help me get a better picture of what's going on.

  1. What DAQ card are you using?
  2. What version of NI-DAQmx are you using?
  3. What programming language are you developing in (i.e. VB or C#)?
  4. What development environment are you using (i.e VS2003 or 2005)?
  5. Can you post a simple version of your code that causes this error?

Let me know if you have any questions and have a great weekend.

Thanks,

Nathan
NI Chief Hardware Engineer
0 Kudos
Message 2 of 3
(3,612 Views)

Hi Nathan,

It was a very silly mistake from my end.

The Task.AIChannel.Addchannel function takes two arguments. One is the physical channel and other is its name. In my earlier code i was passing "" as the channel name. whereas while copying the code to the new solution, i changed the parameter to be equal to the channel itself. Hence for channel Device1/ai0, the name was also Device1/ai0.

it seems that '/' is an invalid character for the name of the channel and hence the error. Whereas it is valid character for physical channel involved.

By the way, I am using C# VS2003 and NI DAQMx 7.3. Also the device is PXI 4461 whose channel I was trying to add.

Thanks for your time and apologies for this silly quest.

Regards,

Alok Damle.

 

 

 

 

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