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!!
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!!