Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   NI LabVIEW (http://www.chiefdelphi.com/forums/forumdisplay.php?f=182)
-   -   Simulator Encoder problems (http://www.chiefdelphi.com/forums/showthread.php?t=133189)

tcjinaz 19-01-2015 20:01

Simulator Encoder problems
 
2 Attachment(s)
I'm baack!

We're trying to hook up the encoders on the robot simulator. Just getting in the code in Begin, then trying it, results in this error in a popup on the DS (see EncoderErrror.PNG). Code is in BadEncodder.PNG. Code was copied from the ecoder exaple, with the controls converted to constants.

Sim runs OK with with this code diabled. I tried these combinations of DIO's 3,4; 5,6; 0,1; 1,2. Same error every time.

Any ideas? We're having an awful time putting a program onto a 4slot cRIO that has been constructed similarly. Keep getting the dreaded waiting for robot to respond.

TIA,
Tim

Doug Norman 20-01-2015 14:00

Re: Simulator Encoder problems
 
Hi Tim,

I just tested this and it worked. I configured an encoder in Begin, and then read it in Teleop. A few suggestions:

1. In the project, expand My Computer and then open Robot Simulation Readme.html. It has the channels of all the actuators and sensors for the simulated robot.
2. In Begin.vi, drop the Open from the Encoder palette - it will give you the code needed. You'll just need to change the A and B Channels to 3 and 4 or whatever. Then drop the RefNum Registry Set. You don't need the Config Timer VI, and that may be one source of your trouble.
3. In Teleop (or wherever you want to read it) drop the RefNum Registry Get followed by the Encoder Get to read the distance.
4. You might also take a look at the Robot Simulation tutorial on the Tutorials tab of the LabVIEW Getting Started Window.

Cheers,
Doug


All times are GMT -5. The time now is 23:35.

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