LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Double Precision Numeric Control using D:H:M format has increment/decrement problem

Solved!
Go to solution

Altenbach,

 

Yes - that does simplify things.  And it's always nice to get input from someone who's probably tried dozens of ways of doing something in search of the best method!

 

Unfortunately though, it broke when you changed the MIN for each control from -1 to 0.  That -1 is key to getting it to decrement below 0 (e.g., decrementing the minutes, go from 3 days 4 hours 0 minutes to 3 days 3 hours 59 minutes).  Easy fix though, and since the event fires so fast the user never sees the -1 in the control.  I too started with 0, but found it didn't work while -1 did.  It makes sense though - we need both a positive and negative "wrap" points for each value (24 and -1 for Hours, 60 and -1 for Minutes, etc.).  I have support for -1 in Days just to have a quick way of zeroing the "control", though that's more a personal preference.

 

If anyone can point me to a good reference for building X-Controls (?) please do!

 

Thanks!

Erik

0 Kudos
Message 11 of 15
(500 Views)

@ErikL68 wrote:

If anyone can point me to a good reference for building X-Controls (?) please do!


Sorry about the lower limit. I did not know that you wanted to crossover when going down.

 

If you create a new x-control, you get a pretty good template that contains detailed diagram comments and instructions. The datatype of the xcontrol would be a simple numeric, but the facade would contain your three controls and the associated code to convert to and from the numeric. The nice thing is that it will even work properly if the VI containing the xcontrol is in edit mode.

0 Kudos
Message 12 of 15
(487 Views)

All,

 

I finally made an X-Control out of this.  It seems to be working, but has one issue:  If I try to set the Value and Limits (min and max) at the same time using a single Property node, with the Value listed above and Limits listed below, if the Value is outside the previous Limits, it won't accept it.  The simple fix is to set the limits above the Value in the Property node.

 

Hope this proves useful!  And thanks again for all the help!

 

Thanks,

Erik

0 Kudos
Message 13 of 15
(453 Views)

Why does the "data change" even have a "state changed?" action. Does not sound right.

 

(Compare with the simple "dual mode thermometer xcontrol" example that ships with LabVIEW).

0 Kudos
Message 14 of 15
(437 Views)

Altenbach,

 

Good catch - that was in there as part of troubleshooting.  It works as-is, but now that you pointed it out, I've gone back and removed it.  That made it malfunction, but then I noticed I also had the State Changed boolean set high in the Display State Changed event handler, which also wasn't needed.  Once I removed that as well, the control started working.

 

Here's the X-Control, with these fixes.

 

Thanks,

Erik

0 Kudos
Message 15 of 15
(424 Views)