DCD equivalent in Rslogix5000

42004 - How to implement RSLogix 500 DCD and ENC instructions in RSLogix 5000
Access Level: Everyone

Regards,
George

Hi George,

That is great. but i do not know which tag will be filled in the first operand.

please see the picture.
Screenshot%202024-01-29%20133022.png

Thanks so much,
Khang.
 
That is great. but i do not know which tag will be filled in the first operand.

please see the picture. [...]

We cannot see that image; it needs to be attached to the post, using the
attach.gif
button when writing a post in Advanced Mode.

The first operand to that AOI is TagSource; that is the input INT; the first four bits of TagSrouce composw the position (0-15) of the bit to be set in the second operand TagDest.

@daba's is still the best, but here is another in line with the TechConnect approach but more concise:
Code:
MOV 2#1 TagDest
XIC TagSource.3 MUL TagDest 2#100000000 TagDest
XIC TagSource.2 MUL TagDest 2#10000 TagDest
XIC TagSource.1 MUL TagDest 2#100 TagDest
XIC TagSource.0 BTD TagDest 0 TagDest 1 15 OTU TagDest.0
the BTD protects against overflow on multiply
 
I am unclear about the "OTE tagname.[source]" portion of this. OTE is a boolean and my datatype for the source is DINT.

For example:
If my source is N7[53] and my tagname is N20[49], would that mean that i place an OTE that is tagged N7[53].N20[49] ? I'm confused.

One issue you have is that the conversion from Logix500 has created "Array" tags. In your case "N7" and "N20" and your code is addressing elements #53 and #49 respectively.

Array tags are not easy to work with, so I suggest you create "Alias" tags ...

eg.
INT type "MySource" as an alias to N7[53]
INT type "MyDest" as an alias to N20[49]

Then your DCD equivalent will be...

CLR MyDest, LIM 0 MySource 15, OTE MyDest.[MySource]

Put these instructions on ONE rung, so they cannot get separated by edits.
 

Similar Topics

How can I achieve the same functionality in Studio 5000? Image 001.png for the old RSLogix500 program Image 002.png for conversion to Studio...
Replies
6
Views
2,517
Good afternoon to all Need help in understanding the purpose of a case state "decode 4 to 1 of 16" any help is greatly appreciated. Thank you
Replies
5
Views
1,625
:shoot:I am wanting to take a word and say chop up the hex value ie. word b9:0 = DCA9 send the 9 - b10:0 then A-B10:1 then C-B10:2 then...
Replies
8
Views
3,288
Hi Everyone, I am working on a project with a SLC504. I am using the DCD instruction to use 4 inputs to select 1 of 16 outputs. I have tested my...
Replies
2
Views
3,245
I am replacing a old plc in some used equipment. I would like to keep the drawings close to the same,and the control wiring the same. I have a...
Replies
4
Views
1,772
Back
Top Bottom