LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Strange behavior executing LabVIEW 7.1 VI in LabVIEW 2013

Solved!
Go to solution

@Darin.K wrote:

The original VI is messed up.  The default numeric value for the control is '5'.  Prior to LV9 this was being coereced to the closest value (1=Auto) and that is why it "seemed" to work.  Beginning in LV9 this value was being coerced to 0.

 

Go to LV7, Type Cast a U16 numeric 5 to the manual/auto enum and wire to the case structure.  You will get 'auto' since it is coerced to Auto.

Go to Lv9+, Type Cast the same U16  to the enum and wire to the case structure.  You will get 'manual' since it is now coerced to Manual.


If any one person knew everything about the LabVIEW underpinnings, it would be you.  🙂

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 11 of 17
(982 Views)

@billko wrote:

@Darin.K wrote:

The original VI is messed up.  The default numeric value for the control is '5'.  Prior to LV9 this was being coereced to the closest value (1=Auto) and that is why it "seemed" to work.  Beginning in LV9 this value was being coerced to 0.

 

Go to LV7, Type Cast a U16 numeric 5 to the manual/auto enum and wire to the case structure.  You will get 'auto' since it is coerced to Auto.

Go to Lv9+, Type Cast the same U16  to the enum and wire to the case structure.  You will get 'manual' since it is now coerced to Manual.


If any one person knew everything about the LabVIEW underpinnings, it would be you.  🙂


Well, most of what I have learned was via being bitten in the arse.  As to how much trouble I have sitting these days, I'll leave that to others to decide.... Smiley Wink

Message 12 of 17
(976 Views)

As often happens when you deal with oddities like this, things are never as simple as they seem.  While exploring ways to recreate this behavior, my simple Type Cast test started showing the same work once oddities with the control. 

 

I'd fix that sucker in LV7 if it were me.  Once you get the Express business out of your face it is actually a pretty solid version of LV.

0 Kudos
Message 13 of 17
(966 Views)


@Darin.K wrote:

The original VI is messed up.  The default numeric value for the control is '5'.  Prior to LV9 this was being coereced to the closest value (1=Auto) and that is why it "seemed" to work.  Beginning in LV9 this value was being coerced to 0.

 

Go to LV7, Type Cast a U16 numeric 5 to the manual/auto enum and wire to the case structure.  You will get 'auto' since it is coerced to Auto.

Go to Lv9+, Type Cast the same U16  to the enum and wire to the case structure.  You will get 'manual' since it is now coerced to Manual.


Thanks, this explains what happens. But there is some inconsistency:
  • When 'mode' is type casted to U16 we get numeric 5
  • The probe on this same wire shows value of 1, i.e. Auto. Maybe it should show ? similar to highlighted mode
0 Kudos
Message 14 of 17
(965 Views)

@chembo wrote:


@Darin.K wrote:

The original VI is messed up.  The default numeric value for the control is '5'.  Prior to LV9 this was being coereced to the closest value (1=Auto) and that is why it "seemed" to work.  Beginning in LV9 this value was being coerced to 0.

 

Go to LV7, Type Cast a U16 numeric 5 to the manual/auto enum and wire to the case structure.  You will get 'auto' since it is coerced to Auto.

Go to Lv9+, Type Cast the same U16  to the enum and wire to the case structure.  You will get 'manual' since it is now coerced to Manual.


Thanks, this explains what happens. But there is some inconsistency:
  • When 'mode' is type casted to U16 we get numeric 5
  • The probe on this same wire shows value of 1, i.e. Auto. Maybe it should show ? similar to highlighted mode

As I replied, even the casting test got a bit weird as I dug around with that control floating around.  When I recreated from scratch, the U16 -> enum type casting was similar between LV7 and LV12.  When I used the original control in the type casting it was different at first and then became the same.  Hate those kind of bugs...

 

Two pieces of information are stored for the default value of the enum:  the text displayed in the control and the numeric value.  LV just assumes they match since there should be no way for them not to.  Except you found a way.  How the different versions react seems to have changed.

 

I always have two conficting feelings at junctures like this:  morbid curiosity and the strong urge to purge the demon from my hard drive.  More than once a curiosity such as this has managed to infect other code.

0 Kudos
Message 15 of 17
(956 Views)

@RavensFan wrote:

If you have a process already for programmatically running these VI's, what happens if you add to that and do something like a Set Vale on the controls programmatically before executing the VI.

 


This seems to be nice workaround. It works!. When I confirm, i.e. set the 'mode' value to 1, via control reference and property node from the automation VI, and then execute the VI, it works properly.

 

Message 16 of 17
(939 Views)

@Darin.K wrote:

Well, most of what I have learned was via being bitten in the arse.  As to how much trouble I have sitting these days, I'll leave that to others to decide.... Smiley Wink


Well i heard it's healthy to stand at your desk ...

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 17 of 17
(922 Views)