AD decode (DECO) instruction.

elevmike

Member
Join Date
Feb 2004
Location
Detroit, MI
Posts
4,012
So I'm trying to figure this out... In the exaple below if the counter value is ZERO... then why is the output after the decode ONE?? contact C3 is suppose to toggle between ouput formats (Binary or 1 output per position).

Basicly of the counter value is 2:

If you turn off C3 then the the ouput shoud be Y1.
If you turn on C3 then the ouput should also be Y1 (so I would think), but it's Y2 instead???

What's up with this?? What am I missing?

Thanks,

AD_DECO.JPG
 
From the manual:
The Decode instruction decodes a 5 bit binary value of 0–31 (0–1F HEX) in the accumulator by setting the appropriate bit
position to a 1.

A value of zero in the accumulator prior to the DECO instruction will turn on the rightmost bit (bit zero). A value of 1 turns on bit 1. All possible values in the lowest 5 bits of the accumulator before the DECO instruction will turn on exactly 1 bit.

So a value of 2 (0000000000000010) if sent DIRECTLY to VC1000 will turn on bit 1 in that word (0000000000000010). If sent through DECO first will turn on bit 2 (0000000000000100)
 
Bernie,

Thanks for your reply.

What I'm trying to do here is make the output format selectable depending on the type of Position Indicator display to be used. Generally if the max output value is to be 4 or less, the output will be one output per position (1=Y0, 2=Y1, 3=Y2, & 4=Y3). However if the max value is greater the 4 then the output would be in binary (1=Y1, 2=Y2, 3=Y1 & Y2 etc..). So either way if the value in the counter is 1, then I need to turn on Y0, if the value is 0 all outputs should be off. I was hoping to do this without having 30 lines of code... Im not sure if I'm using the right instructions to do this..
 
So I take it that if the count is zero that you want NO outputs to turn on. So your test for C3 would be if CTA0 is 4 or less AND is greater than zero. Then, just after the test for C3 but before the DECO add in a SUBB K1.
 
No, actually C3 is static depending on the type of display used. C3 is a project configuration bit that will be setup on commisioning and never change.

Typically (but not always), if the project is for less then 5 floors the display inputs will be configured accept 1 line per floor, and C3 will be always ON. However if the project is to be for 5 or more floors, then the display will require a binary input, and C3 will be set to be always ON.

So when you go to setup the program for one job or another you must set or reset C3 depending on the floor output display. (digital readout or one indicator lamp per floor) Using the same outputs points.
 

Similar Topics

I can't seem to sort out how to decode this into useful numbers. Maybe I'm tired and this will be obvious tomorrow but it hasn't been all day...
Replies
36
Views
6,766
Where am I going wrong here? I'm trying to turn a modbus register into the expected value of around 375 as displayed on the instrument. According...
Replies
21
Views
5,648
I have a machine with a Maple Systems HMI5056T and I can download from the panel but can't open it in Easy Builder 5000. Tried to decode it but it...
Replies
2
Views
1,884
Looking to convert a decimal value to turn on a bit eg. like the DCD instruction in 500 where it converts a 4 to 1 of 16
Replies
3
Views
3,174
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,626
Back
Top Bottom