NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

how to get parameter information on DLL function call (CVI) in TestStand?

Hi,

 

 I wrote a simple Instrument Driver in CVI, and it has 3 parameters Voltage, Current, Channel.

I made a DLL in order to call this function in TestStand as an action.

That works fine, the only problem I have is that it shows my function as DC_Conf (arg1, arg2, arg 3) and I only get the type information like double double int.

I do not get the parameter names Voltage, Current, Channel...

 

How can I get this information to be displayed in TestStand so I know which parameter arg 1-3 is Voltage,Current,Channel in case I forgot?

or 

Is there a way to display the help text of the driver in TestStand?

I tried clicking on the (?) button next to the function call but it did not do anything...

 

My TestStand is version 4.1

 

Thanks...Ness

0 Kudos
Message 1 of 9
(7,226 Views)

Ness -

 

Are you calling your DLL using the TestStand LabWindows/CVI Adapter or the TestStand C/C++ DLL Adapter?

Manooch H.
National Instruments
0 Kudos
Message 2 of 9
(7,224 Views)
I am using the LabWindows CVI adapter...Ness
0 Kudos
Message 3 of 9
(7,203 Views)

Ness -

 

I'm not sure why you're experiencing this problem. I've attached a simple example CVI DLL along with a TestStand sequence file that you should be able to open. As you can see, my parameter list popuplates automatically with the correct name. If you want to double check it, you can delete the steps and re-add them and you will see that the parameter list for the different function calls populate automatically with the correct name.

 

Hope this helps.

Manooch H.
National Instruments
0 Kudos
Message 4 of 9
(7,181 Views)

Hi Manooch,

 

  Thank you for your help...I was able to open it and see the names in TestStand. Attached is your same file but with the declarations as

 

myTestFunc (int, long)

int Mike;

long Manooch;

{

}

 

instead of

 

myTestFunc (int Mike, long Manooch)

{

}

 

Like they are declared in my drivers...and TestStand does not recognize the parameter types...?? I think this must be my problem -

OR

maybe because I only declare the types in the .h file without the name at all

(i.e. I would have void mytestfunc (int, long); in the .h file for a declaration without any mention of the names)??

 

Also, can I access the help text of the instrument driver in the .fp inside teststand?

When I make a help text for a driver there is alot of information that will help the user.

 

Thanks...Ness

0 Kudos
Message 5 of 9
(7,160 Views)

Ness -

 

I think you forgot to attach the files. Could you please do so, so that I may take a look?

Manooch H.
National Instruments
0 Kudos
Message 6 of 9
(7,157 Views)

Sorry...I called it: CVI_Parameterstest_2.zip

 

Thanks...Ness

0 Kudos
Message 7 of 9
(7,153 Views)

Ness -

 

Unfortunately this is a limitation. In order for TestStand to be able to read the parameter names, either the function declaration or the function definition must be in the format of (type name, type name, etc). So you can either have:

 

 

void myTestFunction3(long, long, int);

 

void myTestFunction3(long Ness, long Manooch, int Bob)

{...}

 

 

or you can have:

 

 

void myTestFunction3(long Ness, long Manooch, int Bob);

 

void myTestFunction3(long, long, int) long Ness; long Manooch; int Bob;

{...}

 

 

Hope this helps.

Manooch H.
National Instruments
0 Kudos
Message 8 of 9
(7,139 Views)

Ness,

 

When TestStand populates the parameter information, it does so by looking at the dll's type library.  CVI automatically creates a type library for a dll based on the function's signature, which can include the parameter names.  However, if the function prototype does not contain variable names, then CVI cannot include names in the type library.

 

You can define your own type library to directly control the information available to TestStand from your dll.  If you want to define your own type library, you can do so using a .fp file.  This will allow you to use complex data types (such as structs), and to rename your parameters.

 

Here's a KnowlegeBase describing the process: Embedding Type Libraries in a LabWindows/CVI DLL for use in TestStand

 

Either solution proposed here will work, and they each have tradeoffs:

  1. You can definte the variable names in the function prototype.  This keeps the functions self-documenting, and is the easiest solution.
  2. You can create a .fp file and define your own type library.  This allows you the most control over exactly what you will see in TestStand, but requires you to create a new file, and to keep that new file up to date if you make any changes to your source code.
Message Edited by Josh W. on 12-11-2009 01:08 PM
Josh W.
Certified TestStand Architect
Formerly blue
0 Kudos
Message 9 of 9
(7,121 Views)