... Anyone else stumbled on this in one of the palettes? Kind of helpful little widget at times.
It looks cosmetically similar to OpenG's "Coerce to Enum" which is (was?) a merged VI and predates the State Diagram Editor.
I think one advantage that using OpenG's had (has?) over typecasting was being immune to the oops factor that results when the integer doesn't have the same representation as the enum.
Well that is the thing about this function, it is taking an I32 in and converting it to the appropriate enum type/value apparently.
Wonder if it will show up in 8.0?
Excelent question. THe SD Editor is an amazing tool!
1) On the surface that VI looks like a type cast but it does what a type cast can not do. Please see the attached "Not_a_Typecast.vi".
2) It is found OK on machines that do not have the SDE but does not show up in the VI hairchy. I guess it is imbeded in the VI, somehow!?
3) It looks like it the output of the only VI added when the SDE is installed. I suggest you conduct the following experiment.
a) Copy the VI named ";DNI_IntToEnum.vi" (found in Program Files\Nationla Instruments\LabVIEW 7.1\addons\statediagram) to another location using an name that does not start with ";"
b) Open it using LV and take a look around. I looked at this VI before I started learning about scripting so I do not have a full aprreciation for what it is doing.
And if you find that interesting then save evrything you have open and then try the following AFTER YOU SAVE EVERYTHING!
NOTE LV 7.1 with State Digram Editor required.
1) Download the two attached VI's.
2) Open both and then open the diagram of "Test.vi"
3) Run "WhoRunning.vi".
4) Go to the diagram of "Test.vi" and choose "Edit State Diagram.
5) Every VI involved in the SD Editor will then be opened and you will have to use the Task Manager to kill LV!
Again this is another hole I have not crawled into but I am convinced that there is some power full stuff hiding in the VI that open.
BTW: I wrote "WhoRunning.vi" after seeing the hiarchy screen flicker while opening the SDE. After trying a bunch of ctrl-a 's I resorted to using LV to help out.
Please share improvements to this VI if you make them.
PS: Please save all of your work before you try any of the above. Backing up all of LabVIEW may also be a good idea.
Message Edited by Ben on 09-03-2005 10:32 AM
Yes, I should have written "it does what a type cast can not do [without help]."