Discussion:
station globals enum type
(too old to reply)
Ray Farmer
2006-06-07 16:10:21 UTC
Permalink
Hi,
The answer to part 1
Yes. Hightlight the item to change, then select Replace Global, then you can select what to replace it with.  If the item was in a Container, then It will say Replace Field.
Hope this helps
Regards
Ray Farmer
Ray Farmer
2006-06-07 16:40:18 UTC
Permalink
Hi,
I forgot to say, if you are passing a Constant, then you can select the Enum from the the drop down control in the Specify module Dialog.
Regards
Ray Farmer
mrbean
2006-06-07 18:40:17 UTC
Permalink
I'm not having very good success with your suggestions.   To clarify my problem, I have in my stationglobals.ini a def of
[Globals.ATEReg]WorkCenter = ""
 
The first time around, if I try to read the value of WorkCenter, it should be "".  I'll place a "" in the WorkCenter control.  Then, the operator may chose from two possible enums (drop down), "MYWC" or "YOURWC".  After all other control edits are made, I'll write the new values (found in the controls) back to the .ini file.  That's how it's supposed to work.
 
Getting it to do that has not  been easy.  I have a TestStand - Get Property Value.vi that I pass a lookup string of "StationGlobals.ATEReg.WorkCenter".  I then create a property node with at Value listed so I can write to it.  However, LabVIEW won't let me connect the Value output of the TestStand GetPropertyValue to the Value pin (I made it a write) of the WorkCenter control's Property Node.
 
The type of the TestStand output is String.
Dennis Knutson
2006-06-07 19:40:17 UTC
Permalink
The "value" of an enum is not a string! The default data type of an enum is a U16 number. Just look at the terminal on the block diagram. Strings terminals are red and numeric terminals are blue. You would have to use the Strings[] property of an enum to do what you want. The easiest thing for you do is to use a combo box. The value of a combo box is a string. You might want to look into taking some LabVIEW classes. Information on those and on-line tutorials can be found at <a href="http://www.ni.com/devzone/lvzone/fundamentals.htm" target="_blank">http://www.ni.com/devzone/lvzone/fundamentals.htm</a>&nbsp;.
<img src="Loading Image..."> Message Edited by Dennis Knutson on 06-07-2006 01:33 PM


combo box.JPG:
http://forums.ni.com/attachments/ni/330/11387/1/combo box.JPG
Ray Farmer
2006-06-07 20:40:21 UTC
Permalink
Ok,
Select a variable and then click left mouse button. you should see the Replace selection.
see attachec PNG's.
Regards
Ray Farmer
<img src="Loading Image...">
<img src="Loading Image..."> Message Edited by Ray Farmer on 06-07-2006 09:34 PM


field.PNG:
http://forums.ni.com/attachments/ni/330/11392/1/field.PNG


global.PNG:
Loading Image...
mrbean
2006-06-08 13:10:21 UTC
Permalink
I ended up going with the combo box.&nbsp; Thanks.&nbsp; I have another related question.&nbsp; In that same dialog, I have a string file path control.&nbsp; In the sequence editor's View Station globals, I don't know what type this equates to.&nbsp; I tried 'string' but that didn't work.&nbsp;
In general, is there a table that shows the conversion between TestStand types and LabVIEW types.
mrbean
2006-06-08 14:40:14 UTC
Permalink
Sorry, I&nbsp;should have said, in the "String &amp; Path palette, the file path control".
&nbsp;
I tried the stringToPath (see my attached bitmap).&nbsp; I've tried connecting to a path control propertyNode&nbsp;of Path Text::Text, and Value, but neither seem to work.
&nbsp;
&nbsp;


stringToPath.JPG:
Loading Image...
mrbean
2006-06-08 15:40:19 UTC
Permalink
In the Select Type (right-click option of the Test Stand Get Property Value.vi) I had selected String Array in one of my experimentations.&nbsp; I changed this to String and it worked.
I'm still struggling, however, to know how the various TestStand types map to LabVIEW types.&nbsp; Is there a table somewhere?&nbsp; TestStand's Object Reference, Container, Types::Path are not clear to me.
mrbean
2006-06-13 18:10:17 UTC
Permalink
I was able to read in all the strings from my StationGlobals.ini file and populate the dialog box with them.&nbsp; However, when I try to read the CalibrationData, I receive an error inside the TestStand Get Property Value call.&nbsp; I've tried setting the StationGlobals type to string and to path, with the LV conversion from string to path inbetween the property node.&nbsp; Anything glaring that I'm doing wrong?
&nbsp;


SG_Types.JPG:
Loading Image...


ATE_Registration.vi:
http://forums.ni.com/attachments/ni/330/11538/2/ATE_Registration.vi
Ray Farmer
2006-06-13 18:40:19 UTC
Permalink
Hi,
You String for "StationGlobals.ATEReg.CalibrationData" has an extra space on the end of it eg "StationGlobals.ATEReg.CalibrationData "
and also the LogFile lookupstring.
and also the StationData lookupstring
Regards
Ray Farmer
Message Edited by Ray Farmer on 06-13-2006 07:30 PMMessage Edited by Ray Farmer on 06-13-2006 07:31 PM
mrbean
2006-06-13 20:10:16 UTC
Permalink
Ray,
I cannot find this extra space.&nbsp; I think it just may be an optical illusion due to loss of quality in converting to a bitmap.&nbsp; I've looked in the View::StationGlobals and in the .ini file.&nbsp; Is there somewhere else I'm missing?&nbsp; Also, my string in the .ini file does have the double backslash (i.e. "C:\\ATE\\StationInfo\\CalData.txt")
I've attached a file showing the error message I receive.


TS_Err_Msg.doc:
http://forums.ni.com/attachments/ni/330/11542/1/TS_Err_Msg.doc
Ray Farmer
2006-06-13 20:40:19 UTC
Permalink
hi mrbean,
&nbsp;
I've attached the corrected vi (ver 8.0). I had to delete the space, so no optical illusion.
&nbsp;
Regards
Ray Farmer


ATE_Registration.vi:
http://forums.ni.com/attachments/ni/330/11545/1/ATE_Registration.vi


TS_Err_Msg.doc:
http://forums.ni.com/attachments/ni/330/11545/2/TS_Err_Msg.doc

Ray Farmer
2006-06-13 18:40:19 UTC
Permalink
Hi,
You probably need to have the path string using \\ (two backslashes) in your TestStand Variables.
Regards
Ray Farmer
Ray Farmer
2006-06-07 16:40:18 UTC
Permalink
Hi,
&nbsp;
Answer to Part 2
&nbsp;
You could do a number of ways.
&nbsp;
1) Pass the number.of the enum
&nbsp;
2) Pass a String then do a Search ID Array on Strings[] (which is a Property of the Enum control)to obtain the index then get the required value.
&nbsp;
3) You could hold the array of Strings containing your valid Enums texts, pass this and pass the index, setup the enum in LabVIEW etc
&nbsp;
and so on
&nbsp;
Hope this helps
Regards
Ray Farmer
Loading...