LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Scripting: Insert Case Structure Frame

Solved!
Go to solution

Working in LV2020...

I have the following scripting code in order to insert a new frame into a case structure.

10Things_Rob_0-1749699207271.png

It works great... except LabVIEW doesn't realize it.

 

The target VI is broken with the following error: 

10Things_Rob_1-1749699353023.png

 

Thing is, it's there. Correct selector value and everything.

If I edit the case selector by adding a space and then deleting it, the VI fixes itself.

If I add one, then a second, then delete the second one, then the VI fixes itself

(so clearly nothing is actually WRONG with the first one I created)

 

Any Ideas what's going on?

 

NOTE: I did used to have Begin/Add Undo Transaction but the "dirty dot" never appeared, and I've been trying to simplify it down to the absolute minimum number of functions.

NOTE: The VI (or Block Diagram) being open and visible does not affect the behavior.

0 Kudos
Message 1 of 8
(274 Views)
Solution
Accepted by topic author 10Things_Rob

Hi,

 

It seems like a bug of CaseStructure property "FrameNames" that does not properly recompile the VI.

 

Try forcing recompilation with VI method "Compile":

raphschru_0-1749716300563.png

I managed to reproduce a similar behavior, but not exactly what you described.

Please attach code or at least provide more details on the selector data type (boolean, integer, enum ?) and the exact values written to "FrameNames".

 

Regards,

Raphaël.

 

Message 2 of 8
(235 Views)

Those frame names are tricky.

 

If the case uses strings, you might need to quote the string, like the case structure does when you type a string.

 

For enums, you shouldn't quote the strings, as the case structure doesn't do that when you type the enum names...

 

It's quite crude. It would be nice to have functions that return actual data in stead of literal strings.

 

Not sure if that's what's going on. So code would indeed help.

Message 3 of 8
(190 Views)

Here is what I find:

paul_a_cardinale_0-1749849504214.png

Note that there are always leading and trailing spaces.

0 Kudos
Message 4 of 8
(155 Views)

Wiebe (and future readers),

 

At your recommendation, I tried adding quotes and even adding spaces before/after quotes.

 

Neither worked (at least in 2020)

 

The VI Compile solution did seem to work though.

 

Thanks for your input.

-- Rob

Message 5 of 8
(82 Views)

Here's the testbench I was using to experiment.

The compile seems to do the trick.

I have not tried this on any version other than 2020.

__PRESENT

0 Kudos
Message 6 of 8
(80 Views)

@10Things_Rob wrote:

Here's the testbench I was using to experiment.

The compile seems to do the trick.

I have not tried this on any version other than 2020.

__PRESENT


I have tried with LV2024 Q3 64bit and the issue is still there.

 

Since you've most likely found a bug and a way to reproduce it, I would suggest to report it to NI.

You can simply give them a link to this forum thread so that you don't need to repeat all the steps to reproduce the bug.

 

Regards,

Raphaël.

Message 7 of 8
(38 Views)

Done. Thanks.

__PRESENT

Message 8 of 8
(28 Views)