KB Article: Understanding Combitronic™ Motor Addressing
PURPOSE: This Knowledge Base article is designed to provide guidance to users on motor addressing with Combitronic™ technology and its effects when used with various commands.
NOTE: These examples assume each motor’s CAN address is the same as its position in the network (e.g., Motor 1 CADDR=1, Motor 2 CADDR=2, etc.). Refer to the network shown in the following examples.
EXAMPLE 1: Local command in one motor
- If Motor 1 sets the variable “a” to the value “123”:
then variable “a” equals 123 in Motor 1 only, Motors 2, 3…n see no change.
EXAMPLE 2: Local command in each motor
- Likewise, if Motors 1, 2, 3…n each set their own values for variable a,
the command affects only the motor in which it was declared.
EXAMPLE 3: Combitronic command in one motor to affect a specific motor
- If Motor 1 sets Motor 2’s variable “a” to the value “456” with the Combitronic command:
then only Motor 2 sees the change; note that the value of variable a in the other motors is unchanged.
EXAMPLE 4: Combitronic command in one motor to affect all motors
- If Motor 1 sets the variable “a” to the value “321” globally, with the Combitronic command:
then all motors on the Combitronic network now have their variable “a” set to “321”.
EXAMPLE 5: Using Combitronic technology to read a value from another motor
- In the following example, Motor 1 sets the value of its variable “a” to the actual position (PA) in encoder counts of Motor 3 with the Combitronic command:
Only the value of Motor 1’s variable “a” is changed; all other variables remain the same.
EXAMPLE 6: Multiple Combitronic commands combined with local commands
- In the following example:
- Motor 1 attempts to set the value of variable “a” to 123 for all motors
- Motor 2 attempts to locally set its value for variable “a” to 234
- Motor 3 attempts to set the value of Motor 1’s variable “a” to 456
In the first diagram, note that Motor 2’s variable a=123 because the Combitronic-commanded global variable is read after the local variable a.
In the next diagram, by adding a WAIT=10 command in front of the local variable assignment, that assignment is read after the Combitronic-commanded one, so the result is a=234 as intended.
Example 7: Addressing through a SWITCH ADDR command
- In this example, the following code snippet is loaded and running in parallel in each motor. Only the line of code where the CASE number matches the motor’s address affects the value for variable “a”. In other words, these are commands that are local to each motor, and not global Combitronic-type commands.
NOTE: If this code was only running in one motor, it would have no effect on the value of variable “a” for the other motors.
Example 8: Sequencing of motor operations
- In this example, it shows how the sequencing of motor operations works when handling subroutines through Combitronic commands.
Suppose the following code snippet is loaded in all the motors, and then a Combitronic command GOSUB100:0 is issued by Motor 1.
All the motors in the network respond by homing at the same time.
Now, suppose the Combitronic command from Motor 1 is modified by adding some code around it as follows.
In this scenario, you might expect Motor 1 to home, and then each of the other motors to home in sequence. However, as shown in the previous figure, Motor 1 homes first and then the remaining motors all home simultaneously. This is because the subroutine can only wait for the RETURN in the local motor (where it was called); in other words, it cannot see or respond to the subroutine RETURN from the other motors.
To remedy this situation and “sequence” the homing of all the motors, the code needs to be further modified as follows.
NOTE: The following code sets the order as 5, 3, 4, 1, and 2 for the five motors in the network. However, you can easily change that order and number of motors to fit your application.
As shown in the previous figure, the program waits for the homing to complete in the designated motor before initiating it in the next motor specified in the sequence.