BCD help

Bilbo1161

Member
Join Date
Sep 2015
Location
UK
Posts
51
Only just learning ladder so please bear with me.

If I have 4 bits to show the following states of a motor, stopped, starting, running and fault. How do I get these out of the PLC as a BCD to read 1 = stopped, 2 = starting, 3 = running and 4 = fault.
I am using a GE Fanuc 90-30 PLC

Thanks
 
Four bits:
bit value (weight) 8 4 2 1
bit number ------- 3 2 1 0

A value of one = 0 0 0 1
A value of two = 0 0 1 0
A value of three = 0 0 1 1
A value of four = 0 1 0 0

You can see that it is possible to go clear up to 1 1 1 1 (15 decimal) BUT since it's BCD (Binary Coded Decimal) it's not legal to go above 9 (bit pattern 1 0 0 1) then you have to move on to the next digit.
 
As Widelto pointed out you need only 3 bits to cater for 4 states, [Maybe can shrink it to 2 bits, if taken zero as another state]. If your PLC had a 'BCD compare' instruction, you may use it to monitor the states. Take note not to use the balance of the bits of that word in your logic if you plan to use a compare instruction.

You may watch this clock to see BCD in action

http://www.plcs.net/downloads/index...vnpok18m6o2&direction=0&order=&directory=Misc

Regards
 
I'm now wondering if i need to use bcd at all, or if i just use the MOV function to move the constant of either 1, 2, 3 or 4 into a register on the appropriate state being true.
What i need is the decimal value out as a register to use in a Scada package
 
Last edited:
Ladder option

bit 0 = stopped
bit 1 = starting
bit 2 = running
bit 3 = fault

then

XIC(bit0), XIO(bit3) MOV(0,Result);
XIC(bit1), XIO(bit3) MOV(1,Result);
XIC(bit2), XIO(bit3), MOV(2,Result);
XIC(bit3), MOV(3,Result);
 
bit 0 = stopped
bit 1 = starting
bit 2 = running
bit 3 = fault

then

XIC(bit0), XIO(bit3) MOV(0,Result);
XIC(bit1), XIO(bit3) MOV(1,Result);
XIC(bit2), XIO(bit3), MOV(2,Result);
XIC(bit3), MOV(3,Result);

Thanks Gibbom.
That's probably what I am looking at.
 

Similar Topics

I have a device I am trying to collect data from via modbus into controllogix system. I am using a prosoft mvi56-mcm card and have established...
Replies
7
Views
2,666
I am taking a Simple SP which is in BCD and adding to that, When doing so I have noticed if the value is < 8 it works out fine, but if > 8 it...
Replies
4
Views
2,506
hi everyone i'm new to plc and i real don't understand much but i realy need to do this when air pressure reached the pe2 value i have to...
Replies
5
Views
2,944
Can someone help...? In Logix5000, I am trying to convert float/real numbers to bcd. I used a TOD function to convert a binary to bcd. So if I...
Replies
3
Views
2,946
hello to everyone. I am working on my school project and i need some help with numbering conversions. I am using a DL05 micro plc and I'm trying...
Replies
8
Views
2,759
Back
Top Bottom