BCD input to 13 assigned outputs on a FX

Skeggy

Member
Join Date
Mar 2006
Location
G.B.
Posts
14
Hi All
Just to explain a little better what im trying to achieve.
I want to use a Mitsubishi FX0-30MR-ES with 3 BCD thumbwheel switches and an enter and clear push button on the inputs, the outputs are 13 contactors which need to be switched in such a way that they dont follow a repeating pattern fully. To operate you would select a number between 1 & 603 on the thumbwheels then press enter to initiate the outputs for the coresponding contactors then I want this to stay selected regardless of thumbwheel position until another number in the range 1 - 603 is selected and entered or the clear button is pressed to disable all outputs.
Ive had a look at the mitsi manual and find it hard to understand especially about keying in the functions in GPPWIN.

some examples of output sequence required:

BCD.No. Outputs Required
001 y01
015 Y0,Y3,Y4
025 Y1,Y2,Y3,Y5
045 Y1,Y4,Y6
095 Y1,Y4,Y5,Y7
355 Y0,Y3,Y5,Y6,Y9,Y10,Y11
555 Y1,Y3,Y5,Y7,Y8,Y9,Y10,Y11,Y12
603 Y0,Y1,Y2,Y3,Y4,Y5,Y6,Y7,Y8,Y9,Y10,Y11,Y12

I have a full list of outputs required from 1 to 603 if this would help. Any help on this would be appreciated.

Skeggy
 
Method 1. If there is truly "no repeating pattern", then you are looking at 603 ladder rungs, each rung similar to this:

If BCD Input = 45, then turn on (internal proxy bits for Y1 and Y4 and Y6).

Using Method 1, you must use internal relay bits to avoid using each Output more than once in the program. On the other hand, if there are actually some patterns that repeat, then you can use programming techniques to reduce the number of rungs.

Method 2. Now, shift gears and use another technique to solve the problem. In this case because you have 603 Inputs, but only 13 Outputs, it is criticaly important to begin your logical thinking with the Outputs (I always do anyway).

Take Y0: List all the numbers that Y0 appears in. Then write a logic statement that turns on Y0 when any of those numbers are selected:

If Input = 001, or Input = 015, or Input = 355, or Input = 603, then Y0.

Repeat for all outputs. You only need 13 ladder logic rungs, not 603 as in Method 1. You are done!
 
Last edited:
Lancie1 said:
If there is truly "no repeating pattern", then you are looking at 603 ladder rungs, each rung similar to this:

If BCD Input = 45, then turn on Y1 and Y4 and Y6.

On the other hand, if there are actually some patterns that repeat, then you can use programming techniques to reduce the number of rungs.
Hi thanks for the reply, basically Yes youve got it, but as I am new to plc programming how would implement this
 
Skeggy,

I would use a function called an Equal Comparison statement. Bacically it does this: "if a variable = to some constant, then output (rung) is true". Using this instruction, your program should be a "walk in the park". Use your built in Help menu to find details of all instructions for your Mitsubishi PLC, or read the Instruction manual again. Look for a group of instructions called Comparison.
 
Last edited:
Hi Skeggy

Have a look at this

fx0s.GIF



Dariusch
 
"...switched in such a way that they dont follow a repeating pattern fully."

I don't understand what you mean.

How did you develop the correspondence between the BCD value and the Outputs used?

Is there any intelligence behind the correlation? Or is it arbitrary?

Can you change your number scheme?

Here's what I'm getting at...
If there was a rational relationship between any, and all, BCD numbers and the Outputs used, then... the BCD number could be mapped into a single 16-bit word. That would allow for 4-digits in BCD. Then, each bit in the 16-bit word could correspond directly to a particular output. That means you could have up to 16 Outputs.

Some PLCs go from bit-0 to bit-15, while others go from bit-1 to bit-16.
I will use the bit-1 to bit-16 model. That means, Outputs ranging from 1 to 16.

Each BCD number would be associated with a particular nibble in the 16-bit word.

Your code would be constantly reading the BCD numbers and mapping them into the 16-bit word. As you change the value of the BCD numbers, the binary value of the 16-bit word would change correspondingly.


BCD-4 BCD-3 BCD-2 BCD-1
Thousands Hundreds Tens Ones
16-bit Word Nibble-4 Nibble-3 Nibble-2 Nibble-1

Example:

BCD Number 3 1 7 4

Binary 0011 0001 0111 0100

Bit-Number 1111 1119 8765 4321
6543 210




In this example, BCD value 3174 calls for Outputs 3, 5, 6, 7, 9, 13, and 14 to be ON.

However, the Outputs are not turned ON until you press the "SET OUTPUTS" button.

So, you would need a section of code to continuously map the BCD values to the 16-bit word. Then, you would only need to make 16 copies of the following; one for each bit.

Bit-X SET RST
(Out-X) Outputs Outputs
---| |------| |---+---|/|-----( ) Output-X
|
|
SET |
Output-X Outputs |
---| |------|/|---+


.
The Bit-X value would be following the value of the corresponding bit in the 16-bit word at all times. That is, as you change the thumb-wheel position the Bit-X elements are likely to go on/off according to the particular BCD value.

Once you decide on a BCD value, you press the SET OUTPUTS button. That will turn ON the SET OUTPUTS element in the upper branch and turn OFF the SET OUTPUTS element in the lower branch.

When you press the SET OUTPUTS button, you will be doing two things at once.
First, you will be unlatching any outputs that might be on.
Second, you will be turning on all outputs that correspond to the bits in the 16-bit word.

While you are holding the SET OUTPUTS button, none of the outputs are being latched on.

When you release the SET OUTPUTS button, any output that was on in the previous scan will now be latched on.

If you press the RST OUTPUTS button, all latches are interrupted and all outputs go off.

When you release the RST OUTPUTS button, all outputs remain off.

As long as you are not pressing the SET OUTPUTS button, you can fiddle around with the thumb-wheels all you want, at any time.

So, if you can see your way clear to develop a rational relationship between the BCD values and the outputs used, then you should be able to do this in less than two dozen rungs.
 
I have a full list of outputs required from 1 to 603 if this would help.
I suspect that it would help in this case. There may be a relationship between the numbers that can be used to simplify things.
 

Similar Topics

I'm working on converting an old PanelBuilder 1200 HMI application into FactoryTalk View ME. The PLC was an old SLC 5/02 with a scanner card for...
Replies
2
Views
1,100
Hello I'm using Mitsubishi. I want to convert BCD from a thumbwheel to the plc to have binary output for my e/p regulator. I've seen the...
Replies
2
Views
1,541
i have confused to convert high range and low range in analog input PLC... need your help, please i have pressure transmitter,the range beetwen...
Replies
4
Views
2,920
Hello, I got a cpu 226xm, this one has only dc input and output. I want to read BCD input on I0.1 Does anyone know how to do this? thx.
Replies
9
Views
3,202
I want to measure temperature using two digital inputs. The temperature time module outputs a value in BCD every second. The 13 pulses are...
Replies
0
Views
1,538
Back
Top Bottom