NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Reading a cluster from a LabVIEW Application over ActiveX

Solved!
Go to solution

Trying not to pull my hair out. 

 

New user to TestStand.  We currently have a suite of .exe applications built using LabVIEW that allows the user to manually test UUTs.  Trying to get a proof of concept going to show signifiant improvements if we have TestStand take over what the user was doing. 

 

Rebuilt the executeables with ActiveX enabled and can get almost everything to work the way I want to, except for whenever a cluster type is involved.  Neither reading nor writing is working.  I've created a custom data type to match the cluster type, but I always get a -17308 error complaining that the Variant data type doesn't match the variable type it was expecting.  I can get simple data types (including arrays) to work, but for clusters....nothing.

 

Is there something I'm doing wrong?  Is this possible?

 

Dan

0 Kudos
Message 1 of 8
(3,591 Views)

The more common use of calling LabVIEW code with TestStand is to directly call the code using the LabVIEW adapter.  This allows you to easily pass parameters in and out of code.

 

To pass a cluster in the way you are trying, you may need to create a simple VI that allows you to pass data from TestStand to LabVIEW, then use VI Server in that VI to set and read the clusters, then pass it back to TestStand.

 

If possible, though, I'd strongly recommend using the LabVIEW adapter and directly call VIs rather than executables and try to interact with them in VI Server.

0 Kudos
Message 2 of 8
(3,583 Views)

Not possible in this scenario.  We need to retain the ability for the user to take over manually should their testing require it.  We also must retain its current build state (executeable).  I understand that it is more common to interface directly with VIs through the adapter, but that's not available to us.  I take it there is no way to access clusters or cluster elements using the method I described?

 

Dan

0 Kudos
Message 3 of 8
(3,580 Views)

There is if you create a VI for that purpose.  But not directly using ActiveX in TestStand.

0 Kudos
Message 4 of 8
(3,574 Views)
Solution
Accepted by topic author thisisnotadream

I was able to test that this method worked.

 

To summarize to pass a cluster:

 

Create a VI that has a cluster as either the input or output cluster you wish to get out of the EXE.

Inside of that VI, use ActiveX to get the Virtual Instrument you want (similar to what you are doing in TestStand).  Call Set Control Value (or Get Control Value) on the control you wish to get or set.  You can wire up the Cluster directly to Set Control Value (or Get Control Value) in LabVIEW since it stores clusters the same way.

From TestStand, call this VI.  Pass in (or out) the parameter you wish to get or set.

 

I have attached an example that sets a control in the same VI, but you would do something different where you would choose your executables ActiveX server rather than the LabVIEW ActiveX server.

0 Kudos
Message 5 of 8
(3,526 Views)

Sure.  That makes sense.  Unfortunately, if I'm not mistaken, in order to run the LabVIEW adapter you need to have LabVIEW installed on the machine.  Is that correct?  The reason we build executeables is because we do not have the LV environment on each machine that we run these applications on.

 

The solution that worked for me was to modify the LabVIEW application to add atomic controls that correspond to each field of each cluster.  Then I added a separate loop that periodically polled the controls for changes and then updated the actual values of the desired clusters accordingly.  A bit clunkly, but it worked for the purposes of a proof-of-concept.

 

Dan

0 Kudos
Message 6 of 8
(3,513 Views)

Set the LabVIEW Adapter to use the RTE. You would need to install the LabVIEW RTE on to your system.

Regards
Ray Farmer
0 Kudos
Message 7 of 8
(3,511 Views)

As I said:  New user to TestStand.

 

Thanks!  That opens up a whole new world of possibilities!

0 Kudos
Message 8 of 8
(3,509 Views)