LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

VI Scripting: Error Ring

My question is this:  Is it possible to control / modify / create Error Rings on the block diagram through VI scripting?


Now for a bit of rambling...  I found myself wanting to do some VI scripting involving the Error Ring, and ran into some problems.  They are as follows:

 

1. Traverse for GObjects fails when you specify class name of "Error Ring"

2. To More Specific Class - when trying to place a constant for Generic -> GObject -> Error Ring, I find no option for "Error Ring".  Doesn't seem controllable.

3. Attempting to add an error ring to a block diagram fails, even though it is an option in the "style" enum.

 

I wouldn't worry about these and would have just said "Well, not possible" except...  I know for certain that the Error Ring has a class name of "Error Ring" and a Class ID of 16485.   I've attached a couple of VIs that will hopefully illustrate this a bit.  I strongly suspect the answer is "Nope, can't do it", but I thought I'd double check. 

Download All
0 Kudos
Message 1 of 3
(2,892 Views)

The Error Ring is implemented as an XNode so your scripting options will be quite limited.  You could create new ones, or copy existing ones, but then it starts getting tricky.

 

If I were weighing my options right now, I'd lean toward a scripting-friendly replacement of the error ring rather than trying to jump through the XNode hoops.  In the past I have used a polymorphic VI with the selector visible to generate errors.  I haven't scripted it, but since each instance is just an error constant and an indicator it would be rather straightforward to translate a spreadsheet of error codes and descriptions to a set of instance VIs and wrap those into a polymorphic VI.

Message 2 of 3
(2,865 Views)

To recurse Error rings, do this:

er.png

(Oops.  Should have put a close ref for the library.)

The attached code might give you some ideas.  Run "Set_Error_Ring.vi".  Then click on an Error Ring on an open BD.  Use the searcher in "Set_Error_Ring.vi" to find the error you want, the double-click it to set the previously selected Error Ring to the error you found.

"If you weren't supposed to push it, it wouldn't be a button."
Message 3 of 3
(2,770 Views)