03-14-2014 08:25 AM - edited 03-14-2014 08:47 AM
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
03-14-2014 10:38 AM - edited 03-14-2014 10:40 AM
@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.
03-25-2014 01:02 PM
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
03-25-2014 01:46 PM - edited 03-25-2014 01:52 PM
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).
03-25-2014 03:38 PM
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