02-05-2007 06:05 AM
02-05-2007 08:08 AM
02-05-2007 08:57 AM
Nice work, Jeffrey.
A couple of notes:
P.S. Are you Philip's replacement now?
02-05-2007 01:39 PM
Nice tips! I only just learned some of those things a few weeks ago when I posed a very similar question on the LAVA forums. Specifically, by placing the cursor at the "Max" end of the scale, you can drag it around until it coincides with the "Min" end. The usefulness is for displaying the position of a rotary encoder on a spinning shaft. Now that I know how to remove the gap between 360 and 0 points, it's very easy to indicate a spinning shaft. I just read the (scaled) encoder angle out of DAQmx, perform a modulus with 360 deg, and wire to the guage. Now the needle spins around continuously, just like the shaft it indicates.
BTW, I haven't found out how to control the amount that the whole dial gets rotated. I would typically want my 0 position to be at either N,W,E, or W but I've had to rely on touch to try to get it there by mouse alone. I didn't see a setting when I right-clicked for the properties pages. (Admittedly, I haven't yet scoured all the object properties using a block diagram property node.)
-Kevin P.
02-05-2007 02:13 PM
@Kevin Price wrote:
I only just learned some of those things a few weeks ago when I posed a very similar question on the LAVA forums.
I believe that was how I got the inspiration to do this nugget.
I don't think you can control the position through any other means other than using the mouse.
BTW, I haven't found out how to control the amount that the whole dial gets rotated. I would typically want my 0 position to be at either N,W,E, or W but I've had to rely on touch to try to get it there by mouse alone.
02-05-2007 03:58 PM
02-05-2007 04:16 PM - edited 02-05-2007 04:16 PM
Message Edited by Underflow on 02-05-2007 04:17 PM (for clarity, twice!)
Message Edited by Underflow on 02-05-2007 04:17 PM
02-06-2007 05:09 AM
02-06-2007 07:21 AM
Nice Nugget tst!
who wrote;
"
I don't think you can control the position through any other means other than using the mouse.
"
to which Joe Z replied
"
the properties at: Scale -> Scale Position -> Start. It takes a number of radians, and rotates the zero position on the dial to that angle.
"
Talk about Socratic method!
I had to try this (of course) and had a compass spinning in no time.
I am not a fan of chicken but I do love our "Nuggets".
Ben
If you have a Nugget you would like to present please post here to reserve your week!
02-06-2007 12:06 PM
Yes, Joe, very nice. I actually saw these properties as I looked around for an answer to Kevin's question, but for some reason they didn't register as the answer.
Bong, I could only hava a very quick look at your VI and I'm not sure I understand exactly what you want to do, but I would suggest that you try getting rid of the local variables. If you want to be able to detect the needle shifting over the 0 mark, I think you have to check and see if the if the difference between the last value and the current value is less than -300 or so. Maybe someone with 8.2 can help you more if you provide more details.