Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   NI LabVIEW (http://www.chiefdelphi.com/forums/forumdisplay.php?f=182)
-   -   Find Encoder Value in Teleop (http://www.chiefdelphi.com/forums/showthread.php?t=128053)

Qbot2640 19-03-2014 23:20

Find Encoder Value in Teleop
 
To speed up our shooter aiming, we are incorporating an encoder on the tilt axle to automatically find the angle of the mechanism (and through logic adjust the shooter up or down as necessary). We have successfully found the output, and "transformed" it mathematically into an angular reading, but we can't access the value in our teleop program (where we need it) only in the periodic tasks program. Help!

Alan Anderson 19-03-2014 23:24

Re: Find Encoder Value in Teleop
 
What's keeping you from reading the encoder output in Teleop?

Qbot2640 19-03-2014 23:43

Re: Find Encoder Value in Teleop
 
Quote:

Originally Posted by Alan Anderson (Post 1361618)
What's keeping you from reading the encoder output in Teleop?

I'm not the programmer - but I think if they knew that, they would have solved it. We have the encoder (AS 5030) plugged in to the first input of the analog breakout...we can read it on the dashboard, and access it in periodic tasks, but not teleop (and I assume not in autonomous, where we will also need it).

Greg McKaskle 20-03-2014 06:02

Re: Find Encoder Value in Teleop
 
I suspect that the periodic is not only reading the encoder, but controlling the elevation. One approach is to share the calculated value, via a global variable. The RobotGlobal is a reasonable place to put a named numeric for this purpose.

An alternative is to call a shared subVI that reads the encoder refnum by name, reads the raw value, and calculates the angle. The subVI would be shared by Periodic, auto, tele, or wherever.

Greg McKaskle

Qbot2640 20-03-2014 16:33

Re: Find Encoder Value in Teleop
 
Quote:

Originally Posted by Greg McKaskle (Post 1361678)
I suspect that the periodic is not only reading the encoder, but controlling the elevation. One approach is to share the calculated value, via a global variable. The RobotGlobal is a reasonable place to put a named numeric for this purpose.

An alternative is to call a shared subVI that reads the encoder refnum by name, reads the raw value, and calculates the angle. The subVI would be shared by Periodic, auto, tele, or wherever.

Greg McKaskle

Thanks - Programmers are experimenting and believe this (global variable) is the answer. You're a life saver!!!


All times are GMT -5. The time now is 08:52.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi