NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Problems Populating LabView VI Call Parameters when using Type Def'd Enums

We are using LabView 7.1 to generate TestStand 3.1 sequences.  We have noticed that when we generate a Test Step that calls a LabView VI that has a Type Def'd Enum as a control the creation process works fine, but when we run the sequence we get the following error message from TestStand:
 
Parameter 'Symbol':
Unknown variable or property name 'Information'.
Error accessing item 'Information'.
 
-17306; Unknown variable or property name.
 
Symbol is the name of the enum control and Information is the data we are passing to it.
 
Using the TS Sequence Editor, if we Specify Module on the step that generated the error, change nothing and press OK, then re-run the sequence everything is fine.  The Edit LABVIEW VI dialog box has picked up the correct value and even contains a drop down list of all the other entries in the enum.
 
I have included a piccy for clarity
 
Any thoughts anyone?
 
Regards
 
Steve 
 
There are 10 types of people in the world that understand binary, those that do and those that don't.
Message 1 of 11
(5,194 Views)

Hi Steve,

  I've tested this against LabVIEW 7.1 and TestStand 3.1 and 3.5, and it seems fine.

1) create and save .seq
2) create new LV Action step
3) specify module, and create new .vi
4) in .vi front panel, add a new enum, and then customize that enum, saving it as a typedef.
5) connect control to connector pane
6) in the sequence editor, refresh the prototype
7) save, and run the sequence.

Can you be a bit more explicit in the steps to re-create this please?

Is it limited to just your PC?

Thanks

Sacha Emery
National Instruments (UK)

// it takes almost no time to rate an answer Smiley Wink
Message 2 of 11
(5,168 Views)
Sorry, I never know how much to type, dont want people falling asleep on me.
 
Our problem only shows itself when we populate the VI parameters programatically from outside the sequence editor.  The population doesn't return any errors and looks like it has worked.  If you view the sequence using the Sequence Editor after automatted creation, and select Specify Module on the step of choice the parameters seem to be all filled in correctly.  Its only when we try to run the sequence that the error shows itself (as shown in my original post)
 
If we select Specify Module on the step of choice, dont change anything, and select OK on the Edit LABVIEW VI dialog box, then re-run the sequence everything is fine.  Its like TS doesn't know about the enum value until it is modified and thus stored in the Sequence Editor.
 
Strange!!
 
Steve
There are 10 types of people in the world that understand binary, those that do and those that don't.
Message 3 of 11
(5,165 Views)

Hi Steve,

  can you post your code snippet here please that you're using to create the properties?

Are you filling in the details as a number, or as text, or as a variant etc?

Thanks

Sacha Emery
National Instruments (UK)

// it takes almost no time to rate an answer Smiley Wink
Message 4 of 11
(5,144 Views)

Hi Sach

Have attached our Specify Module API calls code snippet, hope that's what you meant.

Steve

There are 10 types of people in the world that understand binary, those that do and those that don't.
Message 5 of 11
(5,141 Views)
Steve,
For enum parameters, you need to pass the numeric value of the enum.  The Specify Module dialog shows the enum strings, but what is actually stored as the argument to the enum parameter is the numeric value of the enum and not the string representation of the enum.  For example, if the numeric value of Symbol is 3, you need to pass 3 as the argument.
 
TestStand evaluates all the parameter arguments before passing them to the VI.  Whenever TestStand sees "Symbol", it tries to evaluate it and, since the evaluation fails, TestStand generates an error.  However, if you pass the numeric value, then the evaluation will succeed.  This is what the Specify Module dialog is doing.
 
Hope this helps.
 
Message 6 of 11
(5,128 Views)
I gonna have trouble accpeting that dude.  TestStand obviously knows what value I am passing to the enum because I dont have to change any of the parameter values to get the sequence to run.  What is special about the Edit LabView VI Call dialog box that fixes the value passed for 'Symbol' without me actually having to change it manually.
 
Regards
 
Steve 
There are 10 types of people in the world that understand binary, those that do and those that don't.
Message 7 of 11
(5,125 Views)

LabVIEW expects a numeric value for its enum parameters so TestStand needs to pass the numeric value of the enum.

The Specify Module dialog reads the prototype of the VI and gets all the enum values at that point.  It then tries to find the numeric value of the enum by searching through the list of enums and matching the string representation of the enum stored in TestStand with one of the strings in the list of enums.  Once it finds a match, the numeric value is stored and used when running the LabVIEW step.

I know this because I am familiar with the source code.

 

 

 

Message 8 of 11
(5,111 Views)
Thanks, I am aware that I can pass numeric values to the VI call, I just dont want to.  I like my code, whatever it is written in, to be as readable and maintainable as possible and hard coding a numeric value into the parameter set for my VI call reduces both aspects.
 
As an alternative approach then, if the sequence editor can get TS to evaluate the enum through the Specify Module dialog box, then can I do something similar thing through the TS API?
 
Regards
 
Steve
 
 
There are 10 types of people in the world that understand binary, those that do and those that don't.
Message 9 of 11
(5,102 Views)

Hi Steve,

  to keep the code readable we should be able to go from a string to a typedef'd version of the enum, and then typecast directly to the numerical version to then pass onto the LabVIEW parameter.

Here's the conversion bit in LabVIEW 7.1

Hope it helps

Thanks

Sacha Emery
National Instruments (UK)

// it takes almost no time to rate an answer Smiley Wink
Download All
Message 10 of 11
(5,094 Views)