From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I convert a custom error object from a Control Theme to the Error (Silver) control?

Solved!
Go to solution

Hello, I am using a custom theme (Rainbow by RAFA Solutions), and they have a pretty version of the Error In and Error Out controls, called Error In (Rainbow) and Error Out (Rainbow), respectively.  However, they are designed slightly differently and cannot interface with the Error In (Silver) and Error Out (Silver) default controls in LabVIEW.  They also cannot wire up directly to a Case Structure to do error handling.

 

As a result, I wanted to write a sub-VI that essentially converts a Error Out (Silver) to an Error Out (Rainbow).  I have designed the following block diagram (attached), but I see coercion dots when I try and translate the values.  Why is this happening?  How can I fix this?

 

Convert Error Out (Silver) to Error Out (Rainbow)

ErrorConversion.PNG

 

Convert Error In (Rainbow) to Error Out (Silver)

ErrorConversion2.PNG

0 Kudos
Message 1 of 6
(3,000 Views)

It seems like RAFA didn't do a good job designing their rainbow controls.  Why would they make the error code number a floating point value rather than an integer?  It seems like it is not a double because when you use the To DBL bullet, it still leaves a coercion dot.

 

I don't see any reason by the boolean wire would leat to another coercion dot, or t the source string would either.  Unless perhaps they typedef'd those individual elements of their error cluster as well as their error cluster itself.

 

What does context help say about their error cluster and the datatypes in it?

0 Kudos
Message 2 of 6
(2,989 Views)

I believe the individual elements, and the error cluster are both type-defs.  Do you think that will be a problem?  I've attached both of the context help snippets.ContextHelpErrorIn.PNGContextHelpErrorOut.PNG

0 Kudos
Message 3 of 6
(2,987 Views)
Solution
Accepted by topic author airoll

That's why you have all of the coercion dots.  It is going from a regular boolean to a typedef boolean.  Likewise for the string.  The error code as the extra step of actually being a double instead of an integer.  Since it is non-strict, it really makes no sense why they did it that way.

 

I would modify their controls so those individual elements are no longer typedef's, but just controls.  And change the code element to be an integer I32 instead of  double.  Once you do that, you should not have any problems.

0 Kudos
Message 4 of 6
(2,974 Views)

Okay thanks!  Just curious - if I don't fix it, will it still work?

0 Kudos
Message 5 of 6
(2,965 Views)

If what you shown above works for you, then yes, it works.  But it won't work in terms of connecting the custom "error" cluster to the case structure as you've already pointed out.  You'll need to unbundle to get the status and wire that to the case structure and use True/False cases as opposed to Error/No Error cases like a real LabVIEW error wire.

0 Kudos
Message 6 of 6
(2,948 Views)