Sign in to follow this  
Followers 0
jake4eng

TURCK Register Mapping into RSLOGIX 5000 (Map an 8bit byte starting at INT[0].8)

3 posts in this topic

Hello All!

I am having difficulties mapping register values.

In the TURCK register there are 24 unique register bytes corresponding to different value registers (8bit x 24).

These 24(8bit) bytes were mapped into RSLOGIX 5000 as 12(16bit) INT words ....INT[12] ..

This means there are 2 bytes (2 unique register values) inside each INT word.

WHAT I NEED TO ACHIEVE:

1. (BLUE outline in drawing) Write/Map a value of "32" into byte 7 of the TURCK register so effectively starting at  INT[5].8 in RSLOGIX           Drawing1-Model.pdf

This will enable the value of CNT1 (encoder count) to be registered in bytes 8-11...

2.  (PINK outline in drawing) READ/MAP the values registered in bytes8,9,10 and 11(4x8bits) into a SINGLE 32bit INT value which will tell me the CNT1 value of my encoder.

I am having problems when ever I try to COP a value of 32 (no matter what kind of array it's sourced from) into INT[5].8 & I haven't tried to map/read the values of bytes 8-11

CAN SOMEONE PLEASE HELP EXPLAIN HOW TO ACHIEVE THIS?!

Thanks for your input EVERYONE! :D

Drawing1-Model.pdf

Share this post


Link to post
Share on other sites

Which PLC processor do you have?

COP, as you are having trouble with, Source and Destination must be same type (INT).

You want to copy/move part of a source into a destination word...Masked Move (MVM) may be your best bet, allowing you to move part of source to destination.

http://literature.rockwellautomation.com/idc/groups/literature/documents/rm/1756-rm003_-en-p.pdf

The other issue you are going to have is you want to move "32" into bit 7.  Data move instructions are byte-for-byte;  "32" => 0010 0000 (bit 6 is high).  But you want to move "32" into bit 7 => 0100 0000, which is actually "64".

Share this post


Link to post
Share on other sites

Part of your trouble is "INT[5].8" is a bit address, not a byte. Try using OTE or OTL to set the required bits.

For the count:  Contrary to "expert advice", source & destination in COP do not have to be the same type. The number of bytes copied is determined by the size of the destination and the length parameter. So simply COP INT[8] into a DINT tag with length 1. If there is an issue with byte order (big-endian vs little-endian) you can correct with the SWPB swap bytes instruction.

Edited by Gerry

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0