12-08-2009 07:30 AM
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
12-08-2009 10:11 AM
Ness -
Are you calling your DLL using the TestStand LabWindows/CVI Adapter or the TestStand C/C++ DLL Adapter?
12-08-2009 05:43 PM
12-09-2009 02:20 PM
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.
12-10-2009 08:13 AM
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
12-10-2009 08:24 AM
Ness -
I think you forgot to attach the files. Could you please do so, so that I may take a look?
12-10-2009 09:02 AM
Sorry...I called it: CVI_Parameterstest_2.zip
Thanks...Ness
12-10-2009 12:44 PM
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.
12-11-2009 01:06 PM - edited 12-11-2009 01:08 PM
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: