2 Encoders calling the same function?


#1

Hi so we have 2 encoders set up for parallel motors in DIO 2 and 3 and DIO 8 and 9. The issue falls in the front panel in that the information regarding DIO 2 and 3 is not appearing. We believe the problem to lie in the fact that both the encoders are maybe calling from the same source or a function or something. Has anyone else had this problem or know a workaround for this. We think this is an inherent problem with LabVIEW not handling both the encoders properly.


#2

We are just getting started with encoders, but are not having this problem.
A few troubleshooting questions…
Did you instantiate both encoders in begin, give them each a unique name, and close them in finish?
Are you calling each encoder separately in timed tasks (or teleop)?
There would be no other function or loop unless you put them in one (which you may want to do in order to update properly).
Did you try switching the dios to see whether it is the encoder?
The above suggestions assume you are not using command and control. The troubleshooting would be similar, but where and how you instatiate and call them would potentially be different.


#3

If none of Mr.R’s suggestions work, open the VI that instantiates the encoders and go to File -> VI Properties and from the drop down at the top select “Execution”. In this window check if “Non-reentrant execution” is selected. If it is, select “Shared clone reentrant execution” (Preallocated clones will do the trick as well) and click OK. If the VI is set to non-reentrant, parallel calls will use the same space in memory and simply overwrite one another. We had an issue with our controllers last year that was caused by this. Good luck!


#4

Might I suggest what you are seeing is the call with DIO 2 and 3 happening too fast for your eyes to see. It’s the last call to the function with DIO 8 and 9 values there long enough for your eyes to see.

I do not think that is your problems

I would NOT advise changing the re-entrant setting of any of the WPI library VI files. There could be some that will break their functionality if switch to re-entrant when they are designed, as most functions are designed, to be NON-Re-entrant.


#5

The labview encoder VI’s work without any modification. I suggest you start with just trying to get 1 encoder functioning. If you can post snippets or screenshots of your your Begin and where you are trying to use encoder “gets” we can see if there is anything obvious.


#6

Just open the Encoder Example by going to Help -> Find Examples… and browsing to FRC Robotics -> roboRIO -> Sensors -> Encoder.lvproj. Select the DIOs for the encoder that is not working and THEN run the example (you may need to change the IP address it deploys to). You may very well find that encoder is not working for some electrical reason.

I also would not recommend changing the reentrant execution mode. If it comes down to that, try reinstalling the FRC update or trying a different computer.

I reailize it’s been a few days sense the last post so you may have already figured this out but it might help someone else anyway.