DC motor handler. More...
Public Member Functions | |
| def | __init__ |
| Documentation for method. | |
| def | setmotorcontrolleraddress |
| Documentation for method. | |
| def | manualinit |
| Documentation for method. | |
| def | setmotormode |
| Documentation for method. | |
| def | motorenable |
| Documentation for method. | |
| def | motordisable |
| Documentation for method. | |
| def | motorspeed |
| Documentation for method. | |
| def | autocontrol |
| Documentation for method. | |
Public Attributes | |
| CAEIF | |
| IOIF | |
| BM | |
| MotorControllerAddress | |
| ManControlData | |
| Motor | |
DC motor handler.
This class contains all methods needed for controlling DC motors. After creating the instance of the class, you need to give the jumpered address of the DC motor controller card you want to send the commands to. The class supports manual, and automatic modes as well, using system commands, but modes will be set only for the running process, the card will not remember for the mode in static way. In automatic mode only autocontrol method can be used, but in manual mode manualinit, motorenable, motordisable and motorspeed methods also can be used.
| def cpphlib.PPDCMOTORHANDLER.__init__ | ( | self, | |
| CAEIF, | |||
| IOIF | |||
| ) |
Documentation for method.
Constructs PPDCMOTORHANDLER class.
| CAEIF | CAE interface instance is already connected to ppds. |
| IOIF | IO interface instance is already connected to ppds. Short description: Constructs PPDCMOTORHANDLER class |
| def cpphlib.PPDCMOTORHANDLER.autocontrol | ( | self, | |
| MotorID, | |||
| ControlData | |||
| ) |
Documentation for method.
It controlls the turning of the motor in automatic mode on the defined channel.
| MotorID | The ID of the motordriver channel. It's value can be 0..2 |
| ControlData | The motor turns forward in the 0..0x80-SilentRange range, and it turns backward in 0x80+SilentRange..0xFF. The motor stops in 0x80-SilentRange..0x80+SilentRange range. Short description: It controlls the turning of the motor in automatic mode |
| def cpphlib.PPDCMOTORHANDLER.manualinit | ( | self | ) |
Documentation for method.
It sets channel modes to idle. All channels must be set to manual mode before using this option.
Short description: It sets channel modes to idle
| def cpphlib.PPDCMOTORHANDLER.motordisable | ( | self, | |
| MotorID | |||
| ) |
Documentation for method.
Disables driving the motor on the defined driver channel.
| MotorID | The value of the motordriver channel can be 0..2 Short description: Disables driving the motor on the driver channel |
| def cpphlib.PPDCMOTORHANDLER.motorenable | ( | self, | |
| MotorID, | |||
| Direction | |||
| ) |
Documentation for method.
It allows the motor to turn via the driver channel.
| MotorID | ID value of the motordriver channel can be 0..2 |
| Direction | If Direction value is "FORWARD", then motor goes forward, if value is "BACKWARD" then it goes backward. Speed must be set to the proper values for the operation. Short description: It allows the motor to turn via the driver channel |
| def cpphlib.PPDCMOTORHANDLER.motorspeed | ( | self, | |
| MotorID, | |||
| SpeedInPercent | |||
| ) |
Documentation for method.
It sets the speed of the motor on the defined driver channel.
| MotorID | The motordriver channel's ID can be 0..2 |
| SpeedInPercent | It turns the motor with the speed defined in the parameters. It's value can be 0..100, what means %. The motor turns only if the function is allowed. Short description: It sets the speed of the motor on the driver channel |
| def cpphlib.PPDCMOTORHANDLER.setmotorcontrolleraddress | ( | self, | |
| Address | |||
| ) |
Documentation for method.
| Address | The address of the card Short description: It sets the address of DC motor driver card |
| def cpphlib.PPDCMOTORHANDLER.setmotormode | ( | self, | |
| MotorID, | |||
SilentRange = 0, |
|||
SendToCard = False |
|||
| ) |
Documentation for method.
Sets the mode of the required channel. If only MotorID is defined, the channel also goes to manual. If SilentRange is set, the channel goes to automatic mode, this way the motor goes forward as 0..0x80-SilentRange is defined in autocontrol, while it goes backward in the case of 0x80+SilentRange..0xFF. If the range is in 0x80-SilentRange..0x80+SilentRange, it stops.
| MotorID | The ID of the motordriver's channel can be 0..2. |
| SilentRange | The midrange of the whole control range where the motor stops. SilentRange is the half of the midrange. It can be 0x01..0x20. |
| SendToCard | If it's value is True, then mode is set on the card by the method, otherwise not. If parameter is not defined, the mode is set automatically by method. Short description: Sets the mode of the required chanel |
1.7.6.1