NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

How to use function panel?

How can I use function panels(*.fp) in TestStand? Is compiling those to type library needed? And which prototype adapter is proper?
0 Kudos
Message 1 of 2
(3,308 Views)
The correct adapter to use in the Flexible DLL Prototype Adapter. You would not need a function panel for the CVI Adapter because you cannot vary the function prototype of DLL functions called by the CVI Adapter.

Lets assume that you have successfully created a DLL that exports a given function, Foo (int myInt, char * myChar). You must now create a function panel for the function. It will then be used to create a type library when building the dll.

To create an fp you select File>>New>>Function Panel. In the fp window select Create>>Instrument. Name the instrument (Leave the prefix blank for this example.). After creating the instrument select Create>>Function Panel Window (you could create a class first if you want different groupings of function panels). Name
the function panel and give the correct function name as typed in your C code.

You can now double click on the function panel entry in the hierarchical view of your instrument. This will open the function panel for your function. You must add parameters so that the prototype is the same as your function. For the function
Foo (int myInt, char * myChar)
I select Create>>Input. In the Create Input Control I enter values - myInt, 1, int, 0, 96. After clicking Ok I select Create>>Output. In the Create Output Control I enter Values - myChar, 2, char, "", Decimal, 96.

My function panel is now complete. I save it. From my project window I select Build>>Target Settings. I click the Type Library button in the Target Settings dialog box. I check "Add type library resource to DLL" and browse to my fp file.

I then build by dll. In TestStand, when I use the DLL Flex Adapter and select the DLL and function, the parameter information is automatically read from the DLL's type library.

Message 2 of 2
(3,308 Views)