Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

High Byte, Medium High Byte, Medium low byte, Low Byte

Status
Not open for further replies.

jtwan

Electrical
Nov 16, 2013
3
0
0
CA
Im new at this whole programming thing, i am using a slc505 (ab) to send data to an ultra3000 servo indexing drive (on devicenet). I want to send the index count value from the plc to the servo drive via devicenet, but the drive has the value seperated into 4 bytes, high, high medium, low medium, low, how do i break up the interger value in the plc into these 4 bytes (thats my first question), my second question is how can i merge two bytes from the drive into 1 word in the plc or 4 bytes from the drive into 1 long interger in the plc!! please help, thanks!! jtwan
 
Replies continue below

Recommended for you

1st you can define under the device net config words that are passed to the drive and to the slc. I believe you can set this up in words and bytes. Been awhile since I did slc but I think the slc only supports 16bit words and not 32 bit words.

If you want to move certain bytes into certain other bytes on the drive, use this command

Bit field distribute BTD?

Read the help on it makes it more clear than me explaining it by memory.

Source you can define the starting bit and how many bits to transfer

Destination you can define the starting bit and where the starting bit is transferred to in that word.

Have fun!
 
in a slc505 there are double integers DINT those are 32bit (2 words) arent they controlsdude?? the high and middle high bytes would be considered the high word ( like an n7 file in a slc505) and the low and middle low byte is considered the low word (like a second n7 file in a slc505)

please help!! thanks
 
Like I said its been 10 years since I touched a slc500. If there is then as an example

32 bit or DINT example
N7:0/0 to N7:0/31

16 bit or INT example
N7:0/0 to N7:0/15

I thought if its a devicenet uses M0 and M1 words.
I would think that the servo would be dint but I am not reading a manual. You read the manual.

Looked manual looks like there is no BTD, I would be use a combination of
MVM this command will mask out the part of the word you don't want
move this over to a temp word, then move the temp word into the servo drive area of memory.
then
use COP or MOV to move the data from one word to the next drive area of memory.
 
Status
Not open for further replies.
Back
Top