DCD equivalent in Rslogix5000

abdepot1

Lifetime Supporting Member
Join Date
Mar 2016
Location
Miami
Posts
8
Hi, i'm migrating a project from Rslogix500 to logix5000 and the first error i get is that the instruction Decode (DCD) does not exist. can someone help me out as to how it would be able to replace the instruction, as i have this instruction in my old project more than 100 times.

I have attached a sample of the rungs that i have.

Thanks for your help in advance.

DecodeInstruction.jpg
 
Nice job Bernie.

However, if it was me I would want to look at how this instruction is being used. It's likely that it can be simplified at a higher level (or at least made clearer). But we need to know what the program is trying to accomplish.
 
Hi thanks for the help, can you give me like a rung example of how to do it?

this is for step process. so it reads a and then it moves a 0 to 15 to make different steps. like

Step 0 is stop
Step 1 is Running
Step 2 is CIP
Step 3 is Water dosing

and so on.

I'm pretty sure the best way would be to create and AOI, but i have never done one before im very new to 5000 so any help is always appreciated a lot.
 
Hi thanks for the help, can you give me like a rung example of how to do it?

this is for step process. so it reads a and then it moves a 0 to 15 to make different steps. like

Step 0 is stop
Step 1 is Running
Step 2 is CIP
Step 3 is Water dosing

and so on.

I'm pretty sure the best way would be to create and AOI, but i have never done one before im very new to 5000 so any help is always appreciated a lot.

It sounds to me like you used the translation tool.

I would go with Bernie's suggestion, it is the "equivalent" of the DCD instruction. I would definitely limit check [source] to make sure it is 0-31, or the application will fault.

I would be wary of trying to re-invent wheels in your application, unless you want to rewrite all of it. The effort may not be justifiable for the gain you get.

Developing an AOI would be a way to go forward... pretty easy when you know what you are doing, but you say you are new to 5000, so ask if you need help.
 
Last edited:
thanks all of you for the help, and yes from what i have hear and AOI is would make a cleaner code, so i will read on look for how to do them, but if anybody has some help on how to guide it would be help. thanks again for everybody to taking your time to help me. i appreciated.
 
When you log into 5000 and the start page is displayed, in the top left are 3 tabs. The default is the file explorer view, one of the others has tutorial videos including AOI.
 
One way I have used in 5000 is 2**source in a Cpt instruction. (2^source) into your destination dint. Then you can still use the xic's destination.0, destination.1, etc.
 
One way I have used in 5000 is 2**source in a Cpt instruction. (2^source) into your destination dint. Then you can still use the xic's destination.0, destination.1, etc.

Yes that works, but not very transparent to everyone.

I've looked up the Help on the DCD instruction, and it only uses a 4-bit "source" value to turn on bits 0 to 15 of a destination INT.

Isn't that exactly the same as...

OTE tagname.[source]

So you can also achieve the equivalent of the 500's DCD instruction with ...

CLR tagname, AND source 15 source, OTE tagname.[source]
 
Yes that works, but not very transparent to everyone.

I've looked up the Help on the DCD instruction, and it only uses a 4-bit "source" value to turn on bits 0 to 15 of a destination INT.

Isn't that exactly the same as...

OTE tagname.[source]

So you can also achieve the equivalent of the 500's DCD instruction with ...

CLR tagname, AND source 15 source, OTE tagname.[source]

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.
 
Last edited:
Your DINT is made up of 32 bits. A BOOL is a single bit.

Each of the 32 bits in your DINT can be individually addressed by using a decimal point. For example:

Dint_Tag.0
Dint_Tag.1
Dint_Tag.2
...
...
Dint_Tag.31

The part in the square brackets is a pointer. If I had:

OTL Dint_Tag.[Source]

...and the value of "Source" is, say, 5 - then this evaluates to:

OTL Dint_Tag.5

Dint_Tag.5 is a BOOL - it's the 6th individual bit of the Dint_Tag tag.

Does that clear it up?
 
Your DINT is made up of 32 bits. A BOOL is a single bit.

Each of the 32 bits in your DINT can be individually addressed by using a decimal point. For example:

Dint_Tag.0
Dint_Tag.1
Dint_Tag.2
...
...
Dint_Tag.31

The part in the square brackets is a pointer. If I had:

OTL Dint_Tag.[Source]

...and the value of "Source" is, say, 5 - then this evaluates to:

OTL Dint_Tag.5

Dint_Tag.5 is a BOOL - it's the 6th individual bit of the Dint_Tag tag.

Does that clear it up?

Okay. I think I understand. But this would just energize one bit within the DINT and not place a value in the DINT. Except by changing the one tagged to the OTE. Am I wrong here?

Edit:
I get it now. My issue is that I used the conversion utility. That is what is messing me up. Thanks for all the help!
 
Last edited:
Logix 5000 DCD Add-On Instruction...

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

Regards,
George
 
That's exactly what it does. That's what the DCD instruction did previously. If the Source value was 3, it would turn on bit 3 of the Destination.

One way this might be used is in sequencing. Let's say you have a sequence with 5 steps:

Step 1: Start Pump
Step 2: Oven Valve
Step 3: Wait 5 seconds
Step 4: Close Valve
Step 5: Stop Pump

You have a tag (Source) that tells you numerically which step your process is at. Your valve needs to be open during step 2 and step 3. So you put a rung in where if Source = 2 or Source = 3, the valve is commanded to open.

This works fine, but one drawback is that unless you are familiar enough with the program to know what Step 2 and Step 3 refer to, you'll have to keep referring back and forth to where these values come from and what they mean.

So, instead, you use a DCD instruction (or the equivalent RSLogix 5000 method detailed above), which turns on bits 1 through 5 of a DINT during the sequence. You can individually comment each bit of the DINT - for example, the comment attached to Sequence_Step.1 can be "Step 1: Start Pump", the comment attached to Sequence_Step.2 can be "Step 2: Open Valve" and so on.

Now you just change your two EQU instructions to XIC instructions (Sequence_Step.2 or Sequence_Step.3), and your rung is immediately commented with exactly what those two sequence steps mean! Much easier for someone coming in cold to understand what's going on right there on the rung, without having to track back to the actual sequence logic itself to see what's behind a value of "2" or "3".
 

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,510
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,623
: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,279
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,242
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,769
Back
Top Bottom