BrokenArrow Posted March 19, 2007 Report Share Posted March 19, 2007 Hello all, I was having problems with programmatically setting the precision of a numeric control in an old 5.1 app after conversion to 8.2. So I isolated the issue into a simple VI - now I'm getting errors that don't make sense. See attched VI - does it work for you? Thanks! Quote Link to comment
Jeff Plotzke Posted March 19, 2007 Report Share Posted March 19, 2007 QUOTE(BrokenArrow @ Mar 18 2007, 01:02 PM) Hello all,I was having problems with programmatically setting the precision of a numeric control in an old 5.1 app after conversion to 8.2. So I isolated the issue into a simple VI - now I'm getting errors that don't make sense. See attched VI - does it work for you? Thanks! Woah -- That's wierd. I'm also using 8.20 and I'm getting the same error -- "LabVIEW: Valid format values are from 0 to 8." returns if I give it any value other than 0. I also tried the "Format" property node... It also returns errors when I try to change the format type of the numeric. I would definitely report this to NI... Quote Link to comment
Aitor Solar Posted March 20, 2007 Report Share Posted March 20, 2007 The error is provoked for having an "Automatic formatting" format selected in the control. See here: Changing the Format and Precision of a [wiki]Numeric[/wiki] Control Programmatically Saludos, Aitor Quote Link to comment
BrokenArrow Posted March 20, 2007 Author Report Share Posted March 20, 2007 QUOTE(Aitor Solar @ Mar 19 2007, 05:45 AM) The error is provoked for having an "Automatic formatting" format selected in the control. See here: Changing the Format and Precision of a [wiki]Numeric[/wiki] Control ProgrammaticallySaludos, Aitor That didn't do it. In fact, the Format & Precision propertes box won't let me put the Digitits of Precision to 0! When I enter 0, it always goes back to 1. On another computer, running 7.1, I finally got it to work, but not on 8.2. The property node is still broken. edit!--- I just found a reference to the bug (Digitits of Precision not staying on 1) on the [wiki]NI[/wiki] forums. I'm sure this has to do with the broken PN. http://forums.ni.com/ni/board/message?boar...d=93089#M204187 Quote Link to comment
Aitor Solar Posted March 20, 2007 Report Share Posted March 20, 2007 QUOTE(BrokenArrow @ Mar 19 2007, 03:05 PM) That didn't do it. In fact, the Format & Precision propertes box won't let me put the Digitits of Precision to 0! When I enter 0, it always goes back to 1. Well, I haven't seen that behavior in your example, just a 1435 error code. In fact, when I open your VI, the numeric control already has 0 digits of precision. If I edit the Format and Precision options, I find no problem to put 0, 1, 2 or more digits of precision. The only problem arises when I try to modify programmatically the number of digits of precision AND the control has "Automatic formatting". Saludos, Aitor Quote Link to comment
BrokenArrow Posted March 20, 2007 Author Report Share Posted March 20, 2007 QUOTE(Aitor Solar @ Mar 19 2007, 10:31 AM) Well, I haven't seen that behavior in your example, just a 1435 error code. In fact, when I open your VI, the numeric control already has 0 digits of precision. If I edit the Format and Precision options, I find no problem to put 0, 1, 2 or more digits of precision.The only problem arises when I try to modify programmatically the number of digits of precision AND the control has "Automatic formatting". Saludos, Aitor Odd! & you're running 8.2. Sure enough, when I try to put in a 0, it acts like it'll take it, then when I pop back in, it's set to 1. Just like the problem described by the guy in the [wiki]NI[/wiki] posting that I linked. Quote Link to comment
Aitor Solar Posted March 20, 2007 Report Share Posted March 20, 2007 QUOTE(BrokenArrow @ Mar 19 2007, 03:35 PM) Odd! & you're running 8.2. Sure enough, when I try to put in a 0, it acts like it'll take it, then when I pop back in, it's set to 1. Just like the problem described by the guy in the [wiki]NI[/wiki] posting that I linked. OK, I think I get it. The problem is that a "Floating point" mode won't accept 0 digits of precision. But depending on its previous accepted state, will revert to another mode (for example, I see it in "Automatic formatting" when I open your VI) or will keep the "Floating point" but with 1 digit of precision, as you say. So I suspect we were seeing different behaviors . Now, this is a LV82 problem, since it works fine for LV8. Maybe you could use a "SI Notation" mode, that seem to accept different number of digits without problems (but is not the same, of course). Saludos, Aitor Quote Link to comment
BrokenArrow Posted March 20, 2007 Author Report Share Posted March 20, 2007 Thanks Aitor. Yep, SI may work, but the users will go nuts. It may be easier to lock it on 1 digit after the decimal and tell them to get used to it. This isn't going to go a long way in proving that the conversion to 8.2 is worth while. Quote Link to comment
npoling Posted March 20, 2007 Report Share Posted March 20, 2007 Agreed! This is just one of the reasons we decided to stick to 8.0.1 Nate Quote Link to comment
Aitor Solar Posted March 21, 2007 Report Share Posted March 21, 2007 I'm sure this will be corrected in the next version of LV, but anyway is a step backwards. The ironic part is I've discovered this will affect one of my programs if I update it from LV8 to LV82... something I must do in the next couple of months . Saludos, Aitor Quote Link to comment
BrokenArrow Posted March 25, 2007 Author Report Share Posted March 25, 2007 Here's the reply I received from NI. (Don't you love emails that start with Which bug.... are you referring to??..). This bug has cost me HOURS of re-doing some panels and diagrams for our main system -- then I'll have to Re-Do them when NI fixes it. Hundreds of property nodes. (yes hundreds -- it's not my code) Richard, Which bug with the precision property node are you referring to? Are you getting an error when trying to use this property node? Please be sure that you set the format property to a value between 0 and 8 before trying to write to the precision property node. The bug with writing a 0 to precision will be fixed in the next point release of LabVIEW which is releasing soon. Regards Zach Turner Applications Engineer National Instruments Quote Link to comment
Mike Ashe Posted March 25, 2007 Report Share Posted March 25, 2007 QUOTE(BrokenArrow @ Mar 24 2007, 08:36 AM) This bug has cost me HOURS of re-doing some panels and diagrams for our main system -- then I'll have to Re-Do them when NI fixes it. Hundreds of property nodes. (yes hundreds -- it's not my code) At this point I'd start looking into whether you could use scripting to make the modifications. Perhaps figuring it out in LV 7.1.x, then, assuming you can get it to script, trying to port up to LV 8.x. As you say, hundreds of nodes, lots of hours. Quote Link to comment
BrokenArrow Posted March 25, 2007 Author Report Share Posted March 25, 2007 QUOTE(Mike Ashe @ Mar 24 2007, 01:59 PM) At this point I'd start looking into whether you could use scripting...... . Good idea if it were the math I was concerned about. These Precision nodes are simply receiving a 1 or a 0 depending on the press of a button (thus setting a decimal number control to 1 or 0 digits of precision). It's kind of a silly feature anyway. If a user is smart enough to know what the "Precision" button does, then they are smart enough to know what to do with that 0 after the decimal, if it were there all the time - which is going to be the case now. My boss will undoubtedly want it fixed (i.e. have the buttons back in place) when NI fixes the bug. <waste> :clock: <\waste> Quote Link to comment
Ton Plomp Posted March 25, 2007 Report Share Posted March 25, 2007 If you are setting the precision to zero you could also use %d as the formatter, this will have the same effect. Ton Quote Link to comment
BrokenArrow Posted March 26, 2007 Author Report Share Posted March 26, 2007 QUOTE(tcplomp @ Mar 24 2007, 06:05 PM) If you are setting the precision to zero you could also use %d as the formatter, this will have the same effect.Ton That does work, and will likely be the way I go about it, but it involves changing a LOT of node types, and changing the 1's and 0's to %.1f's and %d's ..... it seems a lot less trouble to just gripe about the bug and wait until NI fixes it... . I wonder why NI didn't suggest that? (the formatter, not the griping). Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.