BreakPoint

cancel
Showing results for 
Search instead for 
Did you mean: 

LabVIEW Minutiae (that may bite you someday)

In this thread Sunflower brings one of the "Bite you" scenarios regarding setting an AE as re-entrant and getting away with it... for now.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 41 of 131
(14,478 Views)

Casting an int to an Enum (strict).

 

Who thought it would be so tricky?  Turns out that although I had expected each of the last 4 methods to be functionally equvellent I was wrong. 

I guess you really do learn something new every day.

Cast to Enum.png

 


"Should be" isn't "Is" -Jay
Message 42 of 131
(14,420 Views)

Make that constant into a U16 and Bob will be your uncle.

Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

Message 43 of 131
(14,414 Views)

This NI document explains typecasting an integer into an enum.

Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

Message 44 of 131
(14,404 Views)

Just when I thought I knew something about LabVIEW!

 

Thanks Jim!  I wondered WHY- now I know.


"Should be" isn't "Is" -Jay
0 Kudos
Message 45 of 131
(14,394 Views)

Jeff, you'd might like this too.

 

Coerce to Type

0 Kudos
Message 46 of 131
(14,380 Views)

Here is one that I also consider bad programming practice.

 

Default Enums

 

Setting a typedef enum as Use Default If Unwired always returns the FIRST (lowest number) in the enum. If you right click and create a constant, you will get whichever state was set to Make Current Value Default. This may be different from what the output is when left unwired. The default state is not shown and you have to look at the typedef to find out which will be the output.

 

Related - if someone rearranges the typedef enum (moves some other text to the first element) then the output of the unwired terminal changes. The state when you create a constant does not.

 

I think I would prefer a "Create Constant in Unwired Cases" option to use here.

 

     Rob

Message 47 of 131
(14,366 Views)

You have a value changed event for a combo box with Allow Undefined Strings deselected. You try to enter an invalid string into the combo box the system beeps an error at you and the control is not updated. As soon as you click somewhere else on the FP but the value changed event fires anyway. If you press escape prior to clicking away from the control the event is not fired.

 

Bug or intended behavior?

 

See this thread for more info.

=====================
LabVIEW 2012


0 Kudos
Message 48 of 131
(14,285 Views)

 


@SteveChandler wrote:

 

See this thread for more info.


Grr... It is early and I ran out of time to edit. The link points to the right thread but the wrong post. Just scroll up and see the first post. Anyway...

 

=====================
LabVIEW 2012


0 Kudos
Message 49 of 131
(14,272 Views)

When working with the 3D Graph in the 3D Picture, I got bit.

 

A is not equal to B

 

Not_The_Same.JPG

 

Since I cut-n-pasted from an example I ASSumed that the wire was run behind the structure and worked with the value from "A" right up until I tested it.

 

Please note the tiny arrows indicating an Input AND an Output.

 

Can anyone else recall seeing another one these anywhere else?

 

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 50 of 131
(14,206 Views)