NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

calling labview executable from teststand

Solved!
Go to solution
I have a labview VI that I build into an exe, and I'd like to call it from my teststand sequence in the setup - other test steps need to use its capabilities in the remainder of the sequence (main).  If it were just a VI, then no problem, the inputs would be visible to me, and I could pass them in.  Since it's an executable, though, my step is of type "Call Executable", but I don't see anywhere that it allows me to pass in the inputs it needs.  Thoughts?
0 Kudos
Message 1 of 17
(7,315 Views)
You may have to expose those inputs as command-line parameters.
0 Kudos
Message 2 of 17
(7,313 Views)
How do I do that?  Is that a special checkbox in the Build utility?
0 Kudos
Message 3 of 17
(7,309 Views)

What version of TestStand are you using?  With TestStand 4.0 for the 'Call Executable' step there is a line called

 

Argument Expression:

 

Enter your parameters to pass into your LabVIEW executable.  You will have to know which ones to pass in and in what order. I believe you can seperate the arguments by spaces.  In my attachment, I pass in one parameter to a LabVIEW executable.

 

Remember, though you have to set the Build properties in LabVIEW to allow it to Pass command parameters to the application.

 

Thanks,

 

PH

0 Kudos
Message 4 of 17
(7,304 Views)

mrbean wrote:
How do I do that?  Is that a special checkbox in the Build utility?

 

Why would you make it more difficult and create an exe? You could have created a dll.

 

In any case, look at the LabVIEW example called "CommandLine.vi".

0 Kudos
Message 5 of 17
(7,260 Views)
This tool is used in two ways.  When used by engineers as a stand-alone product, it needs to be an exe since they are not calling it from TestStand or any other external method.  In this usage, the front panel controls/indicators are used.  When called from TS, it's essentially the interface between a TCP/IP client and a radio.  In the engineering setting, the DLL wouldn't help the team, but to answer my original question (for this thread), the DLL is something to consider.  Are there any advantages between one or the other when called from TestStand? 
0 Kudos
Message 6 of 17
(7,255 Views)
It's easier to pass parameters to a dll. It's also easier to get data back.
Message 7 of 17
(7,252 Views)

MrBean,

 

You can do both. We've done this before and it works well to allow the functionality in both TestStand and as a standalone tool. Create the DLL that does what you need in TestStand, and then create the separate Executable (with GUI) that uses the LIB (or dynamically loaded DLL) to make calls to the same functions that you do in TestStand. If you're using version control, then it would be easy to have the Executable use the same source as the DLL.

 

-Jack

Message 8 of 17
(7,220 Views)

I'm trying to create a DLL and I'm running into some problems.  In the Build dialog box, in the 'Source Files' category, I've selected the main VI and it appears in the 'Exported VIs' area.  I then select 'Define Prototype', and the function prototype shows me the return value and the four inputs I've exposed as controls on the front panel (connector pane).  I create the DLL successfully.  However, when I try to invoke the DLL (using Call Library Function Node), I don't see any of my parameters available to me.  The only parameter shown is the return value.  Do I have to manually add the parameters so that they match the prototype?    Seems like they should appear automatically.

0 Kudos
Message 9 of 17
(7,120 Views)
Solution
Accepted by topic author mrbean

I have had the same problem before. I believe I had to remove some 'Inputs' that were not 'recognized' with TestStand, more specifically, I do not use the Error In or Error Out clusters as inputs the DLL as these do not map properly.

 

When I try to a random DLL on my system, TestStand gives me the following warning: 

 

'This function either does not have parameter information in the DLL or uses types not recognized by TestStand' 

 

What other input 'types' do you have?

 

Thanks, 

 

PH

Message 10 of 17
(7,111 Views)