How to write to use...
 
Notifications
Clear all

How to write to user variables through serial communications

7 Posts
1 Users
0 Reactions
21.3 K Views
(@CRobbins832)
Posts: 7
Active Member Guest
Topic starter
 

I would like to be able to alter the user variable with an ASCII string from my PLC in order to be able to program velocity settings into a recipe and load it to the smart motor whenever that recipe is called. Unfortunately I cannot find much detail on how to do this in the current manual. I see plenty about doing it with digital I/O. Can you please point me in the right direction? I need to know how my ASCII string correlates with the address of the user variable I am trying to alter.

 
Posted : 12/12/2013 1:10 pm
(@csearcy)
Posts: 316
Reputable Member Guest
 

It's not to hard to do. First... what PLC are you using and what SmartMotor part number and firmware revision do you have? That's on the sticker on the motor. Also... do you only have one motor... or more than one?

 
Posted : 12/12/2013 2:05 pm
(@CRobbins832)
Posts: 7
Active Member Guest
Topic starter
 

I am unable to communicate with the motor without shutting the line down but here is the information I do have. The PLC is 1769-L32E CompactLogix5332E, Smartmotor # SM34265DT, firmware 5.0.2 in the program and 5.0.3.40 on the motor. It is a 2 axis system with 3 motors, 2 on one axis and 1 on the other. I only need to control the velocity of 1 axis which I will call "y" axis. Our engineer gave me 2 programs which he said was backup for the motors, however, both programs are exactly the same and there are no comments in them at all. As far as I can tell all motors are daisy chained together. The program only addresses 2 motors though. Thanks for your help.

 
Posted : 13/12/2013 3:23 am
(@CRobbins832)
Posts: 7
Active Member Guest
Topic starter
 

SmartMotor SM3465DT, firmware 5.0.2 in the programs but the motor says 5.0.3.40, 1769-L32E CompactLogix5332E PLC. 2 motors which are synchronized.

 
Posted : 13/12/2013 10:22 am
(@csearcy)
Posts: 316
Reputable Member Guest
 

You can use the ASCII read and write commands in the CompactLogix PLC using Channel0. A good way to see what needs to be sent is to use the SMI2 software with the Serial Data Analyzer open. As you type commands to the motors... like 1VT=10000 ...you will see the addressing characters and the termination characters. The addressing is actually extended ASCII... so the "1" before the command is actually Hex81. SmartMotors accept a CR or a SPACE for termination.

 
Posted : 13/12/2013 2:51 pm
(@CRobbins832)
Posts: 7
Active Member Guest
Topic starter
 

Thanks, that helps a lot. I just have 2 more questions; first, what would dictate whether I use $80 or $81 to start the string, and, can $r be used for termination as well, because I see that is how our controller program has been written?

 
Posted : 14/12/2013 3:50 am
(@csearcy)
Posts: 0
New Member Guest
 

$80 is a global address... so all motors will accept the commands. $81 is Motor1... $82 is Motor2... etc. The termination character should be $0D or $20. Make sure the channel0 setup doesn't pad in a Line Feed ($10)... as that will cause a syntax error and corrupt the next command.

 
Posted : 14/12/2013 9:50 pm
Share: