ANY-maze Help > The ANY-maze reference > The Protocol page > The elements of a protocol > Inputs and outputs > Rotary encoders > Setting up a rotary encoder > Specifying whether the physical port used by a rotary encoder is always the same

Specifying whether the physical port used by a rotary encoder is always the same

The option described in this topic is only shown when a protocol includes at least one movable zone.

In brief

In the majority of situations, the physical port used by a rotary encoder will always be the same - it's simply the port on the interface device to which the sensor actually connects.

However, you may encounter situations in which the port depends on the location of a movable zone. For example, in a Place preference box, you might have two running wheels, one in either side of the box. Now you decide to associate one side of the box with a drug, but you choose to balance this between animals, so for some animals the left side is the drug-associated side and for other animals it's the right side.

If you then wanted to see the distance the animal ran in the wheel in the 'drug-associated side', you would have a problem, because for some animals it would be the data from the encoder on the left side, and for others it would be the data from the encoder on the right side. And, as these two devices would be connected to two different physical ports, the physical port would not always be the same.

Details

If you have a rotary encoder whose physical port depends on the location of a movable zone, like in the Place preference box example above, then you simply need to specify this by selecting the appropriate option from the drop-down list in the rotary encoder's settings page. (Note that this drop-down list is only included if the protocol includes at least one movable zone).

In the case of the Place preference box example, you would specify that The port varies depending on the location of the drug-associated zone.

When you do this, the rotary encoder element will automatically be given one 'Port to use' sub-element for each location of the movable zone you chose - so in the example there would be one sub-element for 'Port to use when drug-associated zone is in left position' and a second one for 'Port to use when drug-associated zone is in right position'. You'll then be able to use these sub-elements to specify which port is used for each of the possible locations of the zone.

© Copyright 2003-2026 Stoelting Co. All rights reserved

ANY-maze help topic T0151