LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Writing to a Gauge Indicator

Greetings all. I have an application where a motor is being controlled. The control aspect has all been created and works well. I would like to have a Gauge Indicator on the screen to give the operator some type of feedback as to the approximate position of the motor between 0-360 degrees. I created an indicator, set it for 0-360, rotated it so that zero and 360 are lined up and I can write a position to it. The problem I have is coding it correctly. I need it to move either forward or backward, at some increment and speed that I can set to find the best overall simulation of the motor. It needs to move both forward and backward, which is the most important part. For example: It will always start (initialize) at zero. Then, let's say that a p
osition of 45 degrees is commanded. I want the Gauge to slew to 45. Then a position of 123 is commanded... I want it to slew from 45 to 123, not go back to start and then go there. It also needs to move backwards. So after the 123 setting, if 90 is commanded, it needs to slew backwards to 90, not go to zero, then 90. I hope I explained it enough. I can play with how fast it moves. The table will actually be set for increments of .001 if needed, such as 145.546 degrees. I don't expect or need the dial to read that accurately, but the digital display would be nice. Any ideas? I need this rather quickly. Please help. Thanks
0 Kudos
Message 1 of 7
(3,514 Views)
I'm not sure I understand the problem. A guage is nothing more than a numeric indicator and unless you program is sending a value a zero, the gauge will not go there by itself. To use your example, if the gauge is at 45 and a new postion of 123 is sent, the only way the gauge would first go back to the start is if some part of your program is first setting the value to zero. There's nothing to fix with the gauge but you'll need to determine what the rest of your program is doing.
0 Kudos
Message 2 of 7
(3,514 Views)
What I need is for the Gauge to simulate the actions of the motor, which moves at a constant slow velocity. So when it moves from 45 to 123, I want it to slew there slowly, not just jump to the new setting. The same when it needs to move to a lower number, such as from 123 to 90. It needs to do so slowly. I guess what I need is some program that will take the commanded position, compare it to the old position, then move it to the new position in small increments, to simulate the motor turning. This is really only for looks, to give the operator an approximation of what the motor is doing. Hope that helps. Please ask if you might need any more info.
0 Kudos
Message 3 of 7
(3,514 Views)
You could use Ramp Pattern to generate an array, wire the array to a for loop, and have the gauge inside the for loop with a wait. You would need to keep the value of the start input maintained be a shift register and then adjust the number of samples and wait time to accurately model how the motor performs. I've attached a VI that I hope will explain what I mean.
0 Kudos
Message 4 of 7
(3,514 Views)
One possibility is in the attached example (LabVIEW 7.0). It would get a only little bit more complicated to allow multiple turns (see second example).
Download All
0 Kudos
Message 5 of 7
(3,514 Views)
Thanks. That's pretty much what I was looking for. I ran into a problem though when I tried to do what you said as far as adding a shift register. I tried to do that and make it a sub-vi to add to my code and ran into trouble. I don't think I am wiring the shift register correctly. Can you help? Thanks
0 Kudos
Message 6 of 7
(3,514 Views)
What kind of trouble did you run into? Can you attach the subVI that you created?
0 Kudos
Message 7 of 7
(3,514 Views)