LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

TestStand access to LabView .EXE control variables

Programs:
LabView 8.20
TestStand 3.5
 
How do I make a stand-alone .EXE file from a LabView VI that can also have it's control variables accessed and edited through TestStand?
 
Goal:
Create stand-alone .EXE file from a LabView VI (containing a series of user operated boolean switches) to provide user with control boolean variables with real-time output to change microprocessor switches.
Find a method that TestStand can also access this .EXE and 'act' as a user and program values to the control variables throughout a sequence.
 
[TestStand Sequence] -----> [Stand-Alone .EXE File] -----> RS-232 Cable -----> [Microprocessor]
 
Problems:
I've tried making a shared library in LabView with all my control variables in a function, but if I try to access the .DLL in TestStand, it gives me the following error: "This function either does not have parameter information in the DLL or uses types not recognized by TestStand"
I've tried making a ActiveX object from the LabView .EXE file, but do not know what functionality will allow me to edit control variable values in real-time.
 
Any questions you may have that could help you find a solution for this, let me know. Thank you greatly.
0 Kudos
Message 1 of 16
(4,067 Views)
Hello harlemite,

Do you require the use of a standalone EXE or could you use TestStand to call a LabVIEW code module?  Passing parameters in and out of code modules is very simple but doing so with EXEs is another story. 

Have you written your EXE such that it completely controls the microprocessor on its own?  I just want to make sure that I'm understanding correctly.  You just need to be able to access and edit those boolean variables from TestStand as well? 


Derrick S.
Product Manager
NI DIAdem
National Instruments
0 Kudos
Message 2 of 16
(4,049 Views)
Yes, I do need it to be a stand-alone .exe and not a .vi file. I understand it's extremely easy to talk to a LabView .vi file from TestStand, but a .exe is what I'm developing now. The .exe file will communicate with the microprocessor. The only way TestStand will be able to send data to the microprocessor is through the LabView .exe (preferably). This means that for right now, all I want to make is an TestStand sequence module that can access/modify the variables, in realtime, in the LabView designed .exe. Pretty much exactly as you thought, LabView .exe talks to the microprocessor, TestStand just needs to edit the variables in the .exe file.
Thank you.
0 Kudos
Message 3 of 16
(4,044 Views)
You can use VI server via ActiveX or TCP/IP.  You can connect to the VI which has the controls and you use Set Control Values to set which ever values you desire.  If you use the ActiveX version, you can make your calls directly trough TestStand.  If you use TCP/IP, you'll need to write code modules to send the data.

Message Edited by Matthew Kelton on 11-01-2007 08:22 PM

0 Kudos
Message 4 of 16
(4,039 Views)

Hello,

Just to clean up the question: How do I make my control variables in an .exe file (which I developed through LabView 8.2) to be modified by TestStand calls to the .exe while it is open in real-time?

I think I may need to be brought back to basics here, but I don't find the LabView help file easy to follow for this type of setup. I have a .exe file developed through LabView, with a lot of boolean control variables, and want to develop a TestStand sequence that can open this .exe and edit the variables (On/Off) while the sequence is running. I know I have to make an ActiveX server, but unsure on how to do that. This is the first time I've tried to create an ActiveX server, so I apologize for being clueless. I've attached the GUI I've developed to give you an idea of what I want to do. I just want to enable it so when I build this into an .exe, TestStand can access and edit all the boolean switches.

Thank you greatly.

0 Kudos
Message 5 of 16
(3,997 Views)

When you build the app, go to the Advanced category and select the box labeled 'Enable ActiveX Server'. I think you also have to set the installer you create to register the exe as an ActiveX server.

In TestStand, you should then be able to choose the ActiveX Automation Adapter. You will select the server you created, and then use the Set Control Value [variant] method of the VI class.

0 Kudos
Message 6 of 16
(3,991 Views)

Ok, once I have the ActiveX file registered, and are trying to run it in TestStand, I only have two object classes (when specifying module for a TestStand ActiveX action): Automation & Virtual Instrument. Virtual Instrument has the SetPropertyValue and GetPropertyValue Call Methods, but how do I create a new object reference at first to perform these operations on? Only "Application" object class allows to "Create New" Object, but if I create an object in this "Application" class, the Virtual Instrument call methods I need to use will not work. I get the following error after I try to use Virtual Instrument Call Methods on an object reference created by "Application" Object Class.

Incorrect Object Reference type in 'Locals.guitest'.
A reference to an object of type 'VirtualInstrument' was expected.

Any help for this problem? TestStand is recognizing the Automation Server I have created, now I'm having problems trying to use it.

Thanks everyone.

0 Kudos
Message 7 of 16
(3,985 Views)
Sorry, I skipped quite a bit. Do the open and then on the application class, try doing a GetVIReference method. This will return an ActiveX reference to a VI.
0 Kudos
Message 8 of 16
(3,980 Views)
This is getting so close to working I can taste it. However, when I use GetVIReference, it does return an ActiveX reference, but it also requires a VI path. I am using an .exe file, so how can I reference to that?
Thank you greatly, this is some good advice, it's coming along well.
0 Kudos
Message 9 of 16
(3,966 Views)


Message Edited by harlemite on 11-07-2007 08:55 AM
0 Kudos
Message 10 of 16
(3,961 Views)