I am currently working on 2 smart motors daisy chained with rs-232 communication. I found this code at the beginning of their programs. From my understanding the motors with this type of communication automatically address themselves on start-up, unless the CAN address is already stored in the memory. I am just trying to understand the reasoning behind coding it this way.
Motor #2
ADDR=2
CADDR=2
CANCTL(2,1)
ECHO
EIGN(W,0)
Motor #1
ADDR=1
CADDR=1
CANCTL(2,1)
ECHO
EIGN(W,0)
Thanks for your help.
The CADDR and CANCTL commands are written directly to EEPROM, so they are not needed in the program, but are sometimes put there for clarity.
ADDR=2 'SET RS232 AND RS485 ADDRESS
CADDR=2 'SET COMBITRONIC, CANOPEN, DEVICENET, OR PROFIBUS ADDRESS
CANCTL(2,1) 'IGNORE THE ABSENCE OF 24VDC ON CAN PORT
ECHO 'ECHO COMMAND SENT BACK TO HOST
EIGN(W,0) 'SET ALL 5VDC I/O TO GENERAL PURPOSE INPUTS