LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

what is an JSONErrorSingle?

Has anyone ever had their error message show up starting with "JSONErrorSingle_1.0"? For example, in my code, I have:
   source as "Valve Didn't Close"
   code as 5000
   status as true.

 

Instead of normal error source showing "Valve Didn't Close", it reads:
<JSONErrorSingle_1.0>{
       "status": true,
       "code": 5000,
       "source": "Valve Didn't Close"
}

 

I haven't placed the code here since the project is large and under an NDA. Before I can place it here, I'll need to strip lots of comments and modify some code. While I work on that, I'm hoping someone has seen this odd error formatting and has a reason for this type of behavior.

 

We are simply using 4 USB-8452 (i2c communication), a NI-9425 (digital in), a NI-9476 (digital out), and a NI-9203 (analog in). No Internet processing going on.

 

Thank you in advance!

0 Kudos
Message 1 of 9
(2,281 Views)

While I don't specifically know where it came from in your code, it looks like at some point your error went through an error converter that changed its format from the standard LabVIEW error cluster which only allows one error on the wire to an alternate version which converts the entire cluster into JSON, which allows multiple errors to be on one wire without losing any error information along the way.  

 

This is actually how NI did error merging in NXG (they called it "multiplexing").  I wouldn't be surprised at all if some code library you're using did the same thing.

 

In order to trace where it happens you just need to trace the path the error takes through all of your code and see at which point it changes, then find that subVI and look at it and repeat, and so on.  If you find a place where it converts it, whatever library is doing it probably also has a library set up to convert it back to an error array again as well.

0 Kudos
Message 2 of 9
(2,247 Views)

Ahhhh!  Thanks, Kyle.  Since the valve-check subVI is a few layers down, I am merging errors on the way up to the instigating VI.  And this is LabVIEW2020 which, if I understand correctly, has NXG routines in it.  I'll start with checking the merge errors VIs.

0 Kudos
Message 3 of 9
(2,243 Views)

Looks like the new 'Multiple Error' subpalette in action since this is LV20

 

MultipleErrors.png

Edit:  Merge Errors with 'Retain all Errors' selected also changes the string encoding.  That was the snippet I intended to post...

Message 4 of 9
(2,235 Views)

The merge error node has an option "Retain All Errors".

 

This feature converts errors to JSON, to enable 1) multiple errors and 2) error attributes. It still supports single errors, and it uses JSONError... to distinguish errors as single, multiple or 'traditional' errors.

 

It's pretty neat. It's been a great help to me a few times already, and I started using it 4 days ago.

 

It's lacking an error dialog that supports this, and also probes... It's not hard material though.

Message 5 of 9
(2,195 Views)

I tracked down all the merge error nodes and found all of the "Retain All Errors" options unchecked.  Is the JSONError_Single expected behavior?

 

Since I'm unbundling the "source" from the error cluster and putting it in an indicator box on the main screen, is there any way to strip the "source" message from the JSONError_Single string?   Ah Ha! Found "Convert to Legacy Error Cluster" VI in the "Multiple Errors" palette!

0 Kudos
Message 6 of 9
(2,175 Views)

Ah Ha!  Found "Convert to Legacy Error Cluster" VI in the "Multiple Errors" palette!

Message 7 of 9
(2,174 Views)

@mysticfree wrote:

I tracked down all the merge error nodes and found all of the "Retain All Errors" options unchecked.  Is the JSONError_Single expected behavior?


No. Something must have done that. 1 merge error with the option on would cause it though.

 


@mysticfree wrote:

Since I'm unbundling the "source" from the error cluster and putting it in an indicator box on the main screen, is there any way to strip the "source" message from the JSONError_Single string?   Ah Ha! Found "Convert to Legacy Error Cluster" VI in the "Multiple Errors" palette!


The tools are pretty handy. A bit unpolished, but not too bad.

0 Kudos
Message 8 of 9
(2,148 Views)

I had to google to find out wtf this was. Horrible way to introduce a new feature IMO.



Michael Aivaliotis
VI Shots LLC
Message 9 of 9
(2,074 Views)