K8097 - PROTOCOL ------------------------------------------------------------------------------------------------------------------------------------------------------------- "STATUS COMMAND" This command is send from the device continuously. It tells the state of each motor, the output and the inputs. Intended to be used for feedback in the program. START COMMAND // PACKETSIZE // MOTORS TORQUE ON/OFF and ON/OFF // MOTORS LEFT-RIGHT // DEMO ON-INPUTS-OUTPUTS // CHECKSUM // END COMMAND 0b11111111 // 0b00000111 // 0b 1/0 1/0 1/0 1/0 1/0 1/0 1/0 1/0 // 0b-- // 0b00000000 // 0b-- // 0b00000000 DEMO ON-INPUTS-OUTPUTS = Bit 7 -> DEMO (1 = ON / 0 = OFF) Bit 6 -> OUTPUT Bit 5 - Bit 0 = INPUT 6 -> INPUT 1 - The "MOTORS ON/OFF and TORQUE ON/OFF" byte shows when a motors is under torque and if it is turning yes or no. The 4th bit indicates the torque setting and the 0th bit indicates if the motor is running yes or no. - The "MOTORS LEFT-RIGHT" byte indicates if the corresponding motor is turning left or right by setting the corresponding bit 1 or 0. - The "INPUTS-OUTPUTS" byte indicates if the corresponding input is triggered and if the output is closed/open. It also has a bit that indicates if the demo-m mode is on or off. Bit 7 = NOT USED // Bit6 = DEMO ON-OFF // Bit5 = OUtput ON-OFF // Bit4-0 - The "CHECKSUM" byte = -(PACKETSIZE + MOTORS ON/OFF and TORQUE ON/OFF + MOTORS LEFT-RIGHT + DEMO ON-INPUTS-OUTPUTS) + 1 ------------------------------------------------------------------------------------------------------------------------------------------------------------- "DEMO OFF COMMAND" When this command is send to the device the demo mode is turned off, the setting is reflected in the "STATUS COMMAND" It is recomended that the demo mode is turned off when the device will be controlled via the USB PORT. START COMMAND // PACKETSIZE // DEMO OFF COMMAND // CHECKSUM // END COMMAND 0b11111111 // 0b00000101 // 0b10101010 // 0b-- // 0b00000000 ------------------------------------------------------------------------------------------------------------------------------------------------------------- "DEMO ON COMMAND" When this command is send to the device the demo mode is turned on, the setting is reflected in the "STATUS COMMAND" It is recomended that the demo mode is turned off when the device will be controlled via the USB PORT. START COMMAND // PACKETSIZE // DEMO ON COMMAND // CHECKSUM // END COMMAND 0b11111111 // 0b00000101 // 0b01010101 // 0b-- // 0b00000000 ------------------------------------------------------------------------------------------------------------------------------------------------------------- "OUTPUT ON COMMAND" When this command is send to the device the output will be activated START COMMAND // PACKETSIZE // OUTPUT ON COMMAND // CHECKSUM // END COMMAND 0b11111111 // 0b00000101 // 0b00011000 // 0b-- // 0b00000000 $FF $05 $18 $E3 $0 ------------------------------------------------------------------------------------------------------------------------------------------------------------- "OUTPUT OFF COMMAND" When this command is send to the device the output will be activated START COMMAND // PACKETSIZE // OUTPUT OFF COMMAND // CHECKSUM // END COMMAND 0b11111111 // 0b00000101 // 0b11100111 // 0b-- // 0b00000000 $FF $05 $E7 $14 $0 ------------------------------------------------------------------------------------------------------------------------------------------------------------- "SET TORQUE PER MOTOR COMMAND" With this command it is possible to set the idle torque enable/disable setting of the motor. These settings are reflected in the "STATUS COMMAND" Set the corresponding Motor bytes to 1 and set the Torque-NoTorquebyte as desired. START COMMAND // PACKETSIZE // Motor01 // Motor02 // Motor03 // Motor04 // Torque-NoTorquebyte // CHECKSUM // END COMMAND 0b11111111 // 0b00000101 // 0b00000000/1 // 0b00000000/1 // 0b00000000/1 // 0b00000000/1 // 11111111 = torque - 00000000 = no torque // 0b-- // 0b00000000 ------------------------------------------------------------------------------------------------------------------------------------------------------------- "RESET PER MOTOR COMMAND" With this command it is possible to reset the selected motor. Set the corresponding Motor bytes to 1 and set the RESET byte as desired. START COMMAND // PACKETSIZE // Motor01 // Motor02 // Motor03 // Motor04 // RESETbyte // CHECKSUM // END COMMAND 0b11111111 // 0b00000101 // 0b00000000/1 // 0b00000000/1 // 0b00000000/1 // 0b00000000/1 // Resetcode = 10000001 // 0b-- // 0b00000000 ------------------------------------------------------------------------------------------------------------------------------------------------------------- ------------------------------------------------------------------------------------------------------------------------------------------------------------- "JOB COMMAND" This command is used to give the motors a job: number of rotations, speed, direction. As soon as the command is send the device will carry out the job. Once a job is started it cannot be interupted by other job commands. You either have to wait until the job is done (using the "STATUS COMMAND") to send a new job or first send a "STOP COMMAND" followed by a new "JOB COMMAND" When Job commands for seperate motors are send async. the motors with a job wil ignore the job for their channel. A channel wil only see a job when its busy flag in the status command is not set. Start-Packetsize-StepsM1-SpeedM1-DirM1-StepsM2-SpeedM2-DirM2-StepsM3-SpeedM3-DirM3-StepsM4-SpeedM4-DirM4-Chksm-End START COMMAND // PACKETSIZE // (NUMBER OF STEPS (4bytes) M1) (SPEED M1) (DIRECTION M1) // (NUMBER OF STEPS (4bytes) M2) (SPEED M2) (DIRECTION M2) // (NUMBER OF STEPS (4bytes) M3) (SPEED M3) (DIRECTION M3) // (NUMBER OF STEPS (4bytes) M4) (SPEED M4) (DIRECTION M4) // CHECKSUM // END COMMAND 0b11111111 // 0b00001010 // ( 0b--, 0b--, 0b--, 0b-- ) ( 0b--) ( 0b-- ) // ( 0b--, 0b--, 0b--, 0b-- ) ( 0b--) ( 0b-- ) // ( 0b--, 0b--, 0b--, 0b-- ) ( 0b--) ( 0b-- ) // ( 0b--, 0b--, 0b--, 0b-- ) ( 0b--) ( 0b-- ) // 0b-- // 0b00000000