Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Unknown channel or repeated capability name N6700

Solved!
Go to solution

I am using the IVI-C driver for the N6700 power supply (http://sine.ni.com/apps/utf8/niid_web_display.model_page?p_model_id=7695). I am using LabWindows / CVI to create a DLL and TestStand to controll it. I have successfully used this driver to intialize, power up, readback values, power down, and close. However, I am  having an intermittent problem revolving around the error "Unknown channel or repeated capability name." It occurs randomly on any function call.

 

I attached some of the files I'm using for reference.

 

Any Ideas?

0 Kudos
Message 1 of 6
(5,630 Views)

BB102613,

 

This seems to be a naming issue.  Review this posting that seems to be similar to your issue.  Let me know how it pans out.

 

http://forums.ni.com/t5/Instrument-Control-GPIB-Serial/Unknown-channel-or-repeated-capability-name-M...

Wayne T. | Application Engineer | National Instruments
0 Kudos
Message 2 of 6
(5,584 Views)

That's kind of the conclusion that I came to as well. When I hardcode, in CVI, a "1" or "2" or "3" or "4" as the channel name into my function call, this error doesn't seem to occur. However, when i try to pass in a value from TestStand, where it is a variable in CVI, i get the problem intermittently.  Here's how I set up the variable in CVI...

 

ViChar      slotName[1] = "0";

slotName[0] = slotName[0] + slotNumber;

 

 

where slotName[] is passed as the channel number,and slotNumber is an int passed from teststand. I then pass the entire array, slotName, as the variable to the function. Performing it this way I get an intermittent error. Is there a better way to do this?

0 Kudos
Message 3 of 6
(5,569 Views)

I'm not sure what is happening when you add a char and an integer ( "0" + 1 for example).  The mixing of data types could be your problem.  All you really need to do is format your integer into a character and pass that down.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 4 of 6
(5,564 Views)
Solution
Accepted by topic author BB102613

What i think happens, in CVI, is that it converts the char into an integer, adds one and converts back to a char. So in decimal, "1" = 49, "2" = 50. That's how i came up with what i did there.

The problem with formatting an integer into a char is the function isn't looking for a char, it's looking for an array of chars... i.e. a poor mans string.

 

I have tried a couple diffferent solutions but i have been getting no luck as far as converting the integer into the string. One method i performed that I still think should work is the following

ViChar *slotName[1];

Fmt(slotName, "%d", slotNumber);

 

But this doesn't work either, it gives me an error stating that it's looking for a ViConstString. This makes me think that I can't pass this parameter in as a variable, the "const" part screams constant only. So my work around is just going to be to make a case statement that looks at the int slotNumber, and then hardcodes the "1", "2", "3", or "4".

 

Thanks for the help.

 

 

0 Kudos
Message 5 of 6
(5,558 Views)

@BB102613 wrote:

What i think happens, in CVI, is that it converts the char into an integer, adds one and converts back to a char. So in decimal, "1" = 49, "2" = 50. That's how i came up with what i did there.

The problem with formatting an integer into a char is the function isn't looking for a char, it's looking for an array of chars... i.e. a poor mans string.

 

I have tried a couple diffferent solutions but i have been getting no luck as far as converting the integer into the string. One method i performed that I still think should work is the following

ViChar *slotName[1];

Fmt(slotName, "%d", slotNumber);

 

But this doesn't work either, it gives me an error stating that it's looking for a ViConstString. This makes me think that I can't pass this parameter in as a variable, the "const" part screams constant only. So my work around is just going to be to make a case statement that looks at the int slotNumber, and then hardcodes the "1", "2", "3", or "4".

 

Thanks for the help.

 

 


Or a very simple way is to add 0x30 (48) to the integer and cast that as a char.  Instant ASCII conversion.

 

ViChar *slotName[1];

slotName[0] = char(slotNumber + 0x30);


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 6 of 6
(5,547 Views)