LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Bugs in Multi Error Cluster.lvlib makes it unusable

Solved!
Go to solution

I started experimenting with the Multi Error Cluster library so I can add attributes to each error and read those attributes in a standardized format in another place. I loved the idea that each error becomes a json formatted string, but I ran into some issues.

 

As shown in the code below, I create an error and add the attribute "TestAttribute" with the value "Something" to my error

 

BasvE_0-1704471541433.png

 

but when I try to read all the attribute names, or even the specific attribute by name, I get nothing as you can see in the image below

 

BasvE_1-1704471637430.png

 

So after this I tried to parse the json myself, but because of strange formatting, the attribute is never recognized. the value of my "TestAttribute" needs qoutes around it, otherwise it is not recognized as a valid json string as you can see in the following images

 

BasvE_4-1704472382997.png

 

BasvE_5-1704472391972.png

 

When I Edit the Write Error Cluster attribute.vi and add the qoutes around the attribute value, it works.

BasvE_6-1704472422922.png

 

This bug is as far as I know in LV2020 and LV2021, in LV2023 it is not even possible to add an attribute or encode your error to be a json error.

 

BasvE_7-1704473023954.pngBasvE_8-1704473034562.png

 

 

0 Kudos
Message 1 of 5
(14,066 Views)
Solution
Accepted by Bas.v.E

I've reported the Encode issue to LV R&D as Bug 2616790. 

 

For the JSON string issue, this is by design... you have to specify an attribute that is a valid JSON string, so:

 

Number - 12.3

String - "abcdefg"

Boolean - TRUE

 

String attributes are in quotes in JSON, which is why the quotes are required.

0 Kudos
Message 2 of 5
(14,008 Views)

I totally overlooked the input terminal saying JSON Value. Thanks for clarifying!

0 Kudos
Message 3 of 5
(13,942 Views)

@Darren wrote:

 

For the JSON string issue, this is by design... you have to specify an attribute that is a valid JSON string, so:

 

Number - 12.3

String - "abcdefg"

Boolean - TRUE

 

String attributes are in quotes in JSON, which is why the quotes are required.


I need to add the following remark, if anyone is coming to this topic with the same problems. When using booleans the value needs to be lower case.

Message 4 of 5
(13,857 Views)

All those multi error cluster VIs could use a little (a lot) TLC.

 

Performance is terrible, as is quite obvious at a first glace in the code.

 

The multi vs single error tag (not JSON!) is just silly (multi: 1-n error, single: 1 error) and wasting CPU and kludging code .

 

Error dialogs don't support multi error.

 

A few simple VIs will make life a lot easier. 

 

Nothing revolutionary, but this could be a quick start: GitHub - Carya-Automatisering/MultipleErrors

Message 5 of 5
(13,797 Views)