Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations cowski on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sending host commands from SLC505 to ultra 3000 drive via ascii port

Status
Not open for further replies.

plcjunior

Electrical
Dec 8, 2005
14
Hello all!!

I need to send host command to an allen bradley ultra 3000 servo drive via r2-232 (ascii port). the command i want to send is to set the speed of the drive.

The speed data must be a hexadecimal number that is 8 characters long and has to then be inserted into a string along with node, command, function and data value in the complete string

example
Drive address = 00
Command = 06D --- speed
Function = 1
Data = 00012EBC (see below)
Command string = :0006D100012EBCcc (cc = checksum value)

the checksum value has to be figured out also, this can be done i believe by using the interger to ascii convert function in rslogix 500 software, then adding up all the ascii totals (from above)

0006D100012EBC
ASCII value: 48+48+48+54+68+49+48+48+48+49+50+69+66+67= 760
then
Subtract 760 from 256 256 – 760 = – 504
Convert – 504 to hexadecimal: – 504 = 0xFFFFFE08 - taking the last 2 digits (08)
(is there a function to convert ascii value -504 back to hexadecimal)

then...

to set the drive to a speed of 500 RPM, we must
perform the following conversion:

The encoder i am using has 2000 lines or 8000 counts/revolution
1 RPM = 8000 counts/minute or 155 counts/second
500RPM = 77,500 counts/sec
Convert 77,500 to a hexadecimal number
77,500 = 0x12EBC
Since i have to send 8 characters for the rpm value, 3 zeros in this example (or the remaining amount of characters have to be filled in with zeros) have to be put in front of the value to make it 8 characters example: 00012EBC
How do i convert the decimal value to hexadecimal and then add the zeros in front of the hex value?


after each component of the string is calculated and figured out!! can the different components be added to the string individually??

Drive address = 00
Command = 06D
Function = 1
Data = 00012EBC
checksum = 08
Command string = :0006D100012EBC08

has any body done this before?
Thanks for the help in advanced!!
 
Replies continue below

Recommended for you

Sorry TWControls,

The 4 questions i have is:

1) After calculating the rpm needed to send to the drive, how did you convert it to hexadecimal and after getting the hexadecimal value how did you add the zeros in front of the hexadecimal value to make that value 8 characters long.


2)after i get my complete command string and its time for me to figure out the checksum, what is a good method of getting the ascii value for each character?? after getting all the ascii values, the host communication manual from ab says to add them together then subtract 256 to get your checksum value.


3) how to i convert the checksum which i believe would be in ascii to hexadecimal,


4) how do i retain only the last 2 digits/or the digits excluding the FFFFFEEE junk?




do you have an example you could show me. It would be much appreciated!!

Thanks in advance
 
You've got it. But make your structure in a string file then insert your speed and checksum.

In other words you will start with a string containing
:0006D1

Then insert the hex equivalent of your velocity set point and your checksum in your empty structure. It works better for me

----------------------------------
TW Controls -
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor