NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

ring/enum between TestSTAND and Labview

I've created a communication VI that has an enuminated control which is a list of available messages to send.  The messages are named as in file "messages.jpg" that is attached. They come from a proprietary protocol that includes 100+ messages.  They are numbered following an outline format in the protocol documentation.  I don't have all messages in my VI (and won't have all of them).

I'm calling this VI from TestSTAND.  In the specify module, TestSTAND recognizes that it's an enum and shows the text of the control and you can select the command via the drop down menu.  Note that the control type is recognized as a U16, not a string.  I've read in a couple other posts that TestSTAND sends the enum's numeric back to LabVIEW.  See "U16.jpg".  This is fine but the start of one problem.

Problem #1: If I add a command that is not at the end of the list in the enum (say I add a new message as the fifth in the list), all messages below this have to be re-selected throughout my sequence as well as I have to reload the prototype each time I'm calling the VI.  TestSTAND is storing the numeric value of the originally coded message and not the text name.  The numeric value of every message below the fifth has increased by one so TestSTAND will select the previous message in the list.

Question:  Is there a way to fix this so TestSTAND will store the message text instead of the enum value?  Is there a way to fix this so I don't have to reload the protoype throughout the sequence?

Problem #2:  Since TestSTAND is storing the enum value, I can't send a string or i get a type mismatch error.  Is there a way to programatically select, preferably with a string, the message in the enum?

LV 8, TS 4


Jonathan M. Slavic
Senior Staff Engineer
Mine Safety Appliances Co. (MSA)
Download All
0 Kudos
Message 1 of 2
(4,349 Views)
Jonathan,
 
I think the solution will be to use a Ring control in LabVIEW rather than an Enum.  The ring control allows you to define non-sequential values of your items in the list.  That way when you insert a new item, the other item's values do not change.  You can quickly change your Enum to a Ring by right clicking on it and replacing it.
 
Unfortunately, both of these items are represented by integers in memory.  So I cannot think of a way to directly reference them with a string.  However, there is a property of the ring control that is called "StringsAndValues[]".  This property maintains an array of all of your Ring elements.  What you could do is have a string input to your VI, and if that string is not empty, search through this array using the Search 1D Array VI in the array palette.  If you find the string then return the value, and if you don't throw an error.


Message Edited by Josh W. on 11-19-2007 09:51 AM
Josh W.
Certified TestStand Architect
Formerly blue
0 Kudos
Message 2 of 2
(4,307 Views)