Welcome, Guest
Messages posted to this category need to be reviewed by the moderator before it gets posted.

TOPIC: What is the reason for this code?

What is the reason for this code? 4 years 11 months ago #1189

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 administrator has disabled public write access.

Re: What is the reason for this code? 4 years 11 months ago #1190

  • csearcy
  • csearcy's Avatar
  • OFFLINE
  • Moderator
  • Posts: 459
  • Thank you received: 77
  • Karma: 23
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
The administrator has disabled public write access.
The following user(s) said Thank You: CRobbins832
Time to create page: 0.238 seconds
Powered by Kunena Forum