04-26-2011 09:39 AM
I'm currently upgrading an application from LabVIEW 4 to 2010 by way of 7.1. After opening the VIs in 7.1, I have several orphaned local variables and no idea what they might have been attached to.
Does anyone know how local variable behavior might have changed between 4 and 7.1 to cause this? I'm probably going to load 4 in a VM to check it out but thought this might be a known artifact that pops up when doing these types of upgrades.
Thanks!
04-26-2011 10:24 AM
Installing LabVIEW 4.1 on the VM took almost no time, so I'm back with an answer to my own question. The original 4.1 project has a local variable pointed at a control with an empty label, which it's fine with. Opening it in 7.1 breaks the link, and attempting to create a new local for that control doesn't work either; obviously I'll just give it a label and everything is fine.
Interestingly, it looks like 2010 lets you create local variables for controls with empty labels, but it starts to get confused when there are multiple controls with empty strings and multiple variables pointed at them. It doesn't break the run arrow, but just doesn't link them up the way you'd expect.
04-26-2011 11:28 AM
Well, wouldn't you get confused also if you didn't know what you were pointing to?
04-26-2011 11:40 AM
Just sharing the observation.
04-26-2011 11:57 AM
as part of the evolution, so has the desire to use wires instead of Locals... (I hear shouts already 😉 )
If you know the control that it came from, is it within a section of the code where a wire would do the trick? Or if in a Loop, a nice Shift Register will carry the data. If within a Stacked Sequence Structure, then you may have to flatten it first.. Then clean up the code..
04-26-2011 12:37 PM - edited 04-26-2011 12:38 PM
Why would you ever want to have a control that did not have a label at all? Part of good programming style is to give each control a meaningful label and have it shown on the block diagram. Preferably the label would be unique, although not esential. If you don't want the label to show on the front panel, that's fine. Just don't make the FP label visible.
I'd recommend that once you know which controls have empty labels, that you go back to LV4, edit those controls to give them labels, then proceed with the upgrade process.
Once you've got things upconverted to your satisfaction, then you can worry about doing code cleanup and trying to replace local variables with wires.
04-26-2011 12:41 PM
You wouldn't, but that doesn't mean you wouldn't encounter it, and I hope the information might help someone else when they observe unexpected behavior while upgrading an application.
04-26-2011 12:42 PM
04-26-2011 12:43 PM
@jaredforshey wrote:
You wouldn't, but that doesn't mean you wouldn't encounter it, and I hope the information might help someone else when they observe unexpected behavior while upgrading an application.
Makes sense. Hope the rest of the upgrade goes smoothly...