LabVIEW Public Beta Program in 2023

cancel
Showing results for 
Search instead for 
Did you mean: 

Cannot change diagram constant to array (Error 1435)

So, what's happening here???

 

Download the VI from here and follow the instructions on the picture below. Is there a logical explanation?

 

altenbach_1-1686948154193.png

 

 

(It works fine with any new diagram constant, so what is so special about that one??? Format looks fine in properties)

0 Kudos
Message 1 of 5
(1,921 Views)

If you read the Display Format property of that particular constant, it comes back as '9'. The right-click plugin always tries to copy the format of the scalar constant to the element of the created array. Since '9' is a read-only format, trying to set it gives the error.

 

As for how that constant got the '9' format in the first place, I don't know.

 

[Edit] In playing with it a little more, it looks like very specifically any format specifier other than "%#_13g" will cause the error. I have no idea why that's the case. Changing the existing format specifier to specifically include 13 digits will cause the error to go away.

Message 2 of 5
(1,872 Views)

I only looked at the format in the properties, and it looks absolutely normal there (in advanced view). It does work correctly after changing to any different format, which seem to legalize things (tried %.6f, but set from the non-advanced dialog).

 

altenbach_0-1687026972507.png

 

It's from quite old code and I really don't remember where that constant came from. Curiously, the tool actually changes it to an array immediately, but reverts after dismissing the dialog. Maybe it could just leave it as array at that point.... 😄

0 Kudos
Message 3 of 5
(1,866 Views)

@altenbach wrote:

Curiously, the tool actually changes it to an array immediately, but reverts after dismissing the dialog. Maybe it could just leave it as array at that point.... 😄


That's how all the right-click plugins work. They do the scripting, but if an error occurs at any point, the scripting is reverted.

 

But I agree, the code should ignore this error specifically since, even if the array element doesn't have exactly the right formatting, it's still better than getting no array at all.

Message 4 of 5
(1,862 Views)

Thanks, I was just playing around with the code. Thought it would be great to have an exponential filter that works on arrays as shown, but with different factors for each element.  I should turn it into a VIM that accepts scalars and arrays for the data in/out (1D, 2D, etc) and also accepts arrays of time constants (in units of the call interval) if the data is an array with the same dimensionality.  ... one of these days.... 😄

0 Kudos
Message 5 of 5
(1,858 Views)