3 BCD input to 13 solenoid output sequence

Will this PLC do 'Compare' and 'Subtract' instructions?
Each output has a weight. The weights get lower as you go down in Y numbers.
Load BCD command.
Compare Command => Y14. If yes, turn it on and subtract Y14 weight.
Compare subtotal => Y13. If yes, turn it on and subtract Y13 weight.
Compare subtotal => Y12. If yes, turn it on and subtract Y12 weight.
Do this all the way down to Y1.

16 rungs and the math is done.
 
Keith,

It looks like a great solution. One problem is that there are some fractional kW Banks, two 66.67, one 33.33, one 16.67. If these could be rounded off to integers, then your method would simplify the number of rungs. When your subtotal hit 0, the remaining operations for the Y Outputs could be skippped with a Jump or Goto statement.
 
Last edited:
Yes, rounding is a must. 67, 67 (or 66), 33, and 16.
BCD is 4 digit, so he might be able to multiply the command and weights by 10. Then it's 667, 666, 333, 167 (or 166). Not sure if that will work or not. All subsequent numbers will end in 0, so the subtotal must always end in 0 after the 167 rung.
'Edit' That doesn't matter. If we have a trailing 1, 2, or 3, it's .1, .2. or .3. That's just the roundoff, so we can throw it away.

I thought about hitting zero in the middle. No need for a jump. All subsequent rungs will solve false when you hit zero, so it doesn't matter.
 
Last edited:
Hi Guy's
Just reading through some of the idea's for the hand controller, which is looking good so far, Yes i have made a couple of mistakes on the output alocation table which I have corrected and will re-attach later, the larger values (from an electrical point of view are not too critical as voltage fluctuations will move the value + & - in KWs) anyway. Just a couple of points I thought I would mention, on the 13 contactors are available 1. N/O & 1. N/C volt free contacts on each, could these be used back to the plc if this would help in the program control.
 
Hi All,
I would like to use the FX30MRES if I can, ok its been sat on a shelf for a long time new & unopened. but if this is not possible, What do you guys recommend out of the Mitsi range, or Omron as I have access to SYSWIN now.
 
Skeggy said:
... on the 13 contactors are available 1. N/O & 1. N/C volt free contacts on each, could these be used back to the plc if this would help in the program control.

PLC's have an infinite number of 'free' NO/NC contacts. It doesn't matter to the PLC whether it's an input, output, or internal relay. It's all just bits in memory.
That's the nice thing about PLC's. Keep the hardwiring of inputs and outputs as simple as possible. Do all the other interlocks, NC, NO, and timers inside the PLC program.
 
Skeggy said:
Hi All,
I would like to use the FX30MRES if I can, ok its been sat on a shelf for a long time new & unopened. but if this is not possible, What do you guys recommend out of the Mitsi range, or Omron as I have access to SYSWIN now.

In your original post you say "FX0-30MR-ES" and now FX30MRES.

Which one is it. Its important because with the FXo it cannot be done.
 
Pierre, can I assume the FXo won't do Compare and Subtract?

Skeggy, most, if not all of us have been in the same situation. You're handed a PLC and/or software, and try to build on this platform. Often, the cost savings aren't worth the nightmares. In this case, the project is simple enough to be doable with these constraints.

The stumbling block was the Chart. Rather than trying to find a PLC with enough memory to hold the entire chart (lookup table), we just need to recalculate the chart each time.
Don't put the Chart in the PLC, just the algorithm used to create it.
It's just 'subtract some', are we zero yet, subtract some more, until zero. Simple.
To do this correctly each time, we need to be accurate with the 'weights' of each resistor. If rounding is wrong, you could come out with a 1 or 2 KW error at the end.
We can't have decimal points with BCD, so we'll increase ALL the numbers by 10. That gives us just enough accuracy to pull this off. Your new maximum number is 6030. The high resistors are 1000. 66.67 becomes 667. The next one can be 667 or 666. Because we rounded up the first time, we should round down the second time, round up the third, etc. In this case, it won't matter because the rounding error will never get high enough to equal 10 counts, or 1KW.

As long as the PLC can do Compare and Subtract, this will work flawlessly. The PLC needs to do simple math, and have Compare instructions. If it does, you should see options like Equal, Not Equal, Greater Than, Less Than, etc. For us, we need either 'Greater Than or Equal To' or 'Less Than or Equal To'.
I don't know which FX's will do it.
 
Last edited:
Skeggy...

Are those KW Values absolutely fixed? Can they be adjusted?

Could you possibly adjust the individual devices to develop the following KWs?

1, 2, 4, 8, 10, 20, 40, 80, 100, 200, 400

If so... then that would provide for the easiest, most direct, solution! You would NOT need to maintain any kind of "list" or "look-up table".

If you can do so... each BCD-Digit would correspond to a specific combination of outputs. Notice that I said BCD-Digit... not BCD-Number.

The BCD Number would, of course, represent "hundreds, "tens" and "ones" (from left-to-right). Each BCD-Digit is composed of 4 bits. The valid range for each is 0-9.

Consider the following...


Hundreds Tens Ones
LKJI HGFE DCBA
0000 = 0 0000 = 0 0000 = 0
0001 = 1 0001 = 1 0001 = 1
0010 = 2 0010 = 2 0010 = 2
0011 = 3 0011 = 3 0011 = 3
0100 = 4 0100 = 4 0100 = 4
0101 = 5 0101 = 5 0101 = 5
0110 = 6 0110 = 6 0110 = 6
0111 = 7 0111 = 7 0111 = 7
1000 = 8 1000 = 8 1000 = 8
1001 = 9 1001 = 9 1001 = 9

Where...

A = Y0 = 1KW
B = Y1 = 2KW
C = Y2 = 4KW
D = Y3 = 8KW
E = Y4 = 10KW
F = Y5 = 20KW
G = Y6 = 40KW
H = Y7 = 80KW
I = Y10 = 100KW
J = Y11 = 200KW
K = Y12 = 400KW
L = Y13 = 800KW <<< Theoretical only - not allowed, unless you have the capability.


.
This is nothing more than a binary-weighting scheme which corresponds directly to the BCD Digits. If you see a "3" in the "tens" digit (0011), then you KNOW that "E" (Y4) and "F" (Y5) should be on, and "G" (Y6) and "H" (Y7) should be off. This develops 30KW. The KWs developed under the other BCD-Digit values are added to this.

Assuming that "L", (Y13 = 800KW), is not allowed, you can have a theoretical maximum of 865KW. If 603KW is your absolute maximum, then you can simply evaluate the BCD Number before activating the change. If the BCD value on the thumb-wheel is greater than 603, then don't allow the change to occur. You should probably have an indicator of some kind to show that the BCD value is valid, or not. If a guy dials in 652KW, then the indicator at the thumb-wheels should go RED, indicating that the number is NOT valid, and will NOT be acted on when the "LOAD" PB is pressed.

By the way... you should probably have two sets of BCD Numbers... one associated with the thumb-wheels, and the other a set of BCD-indicating LEDs which indicate the current configuration. If the new value, on the thumb-wheels, is valid, then after pressing the "LOAD" PB, the LED-BCD display should match the thumb-wheels. In that way, you'll always know what the current configuration is - right at the thumb-wheels.

The LED display should be driven by the actual outputs. Or, you might want to use feed-back directly from the field devices to show what REAL KW is, as opposed to the INTENDED KW.

So... using a 16-bit word,

Combine the BCD Digits into a single 16-bit word.

MSb 15 14 13 12 11 10 09 08 07 06 05 04 03 02 01 00 LSb
| not used | "hundreds" | "tens" | "ones" |

Then... "map" that word to the Outputs...

Bit-00 = Y0
Bit-01 = Y1
Bit-02 = Y2
Bit-03 = Y3
Bit-04 = Y4
Bit-05 = Y5
Bit-06 = Y6
Bit-07 = Y7
Bit-08 = Y10
Bit-09 = Y11
Bit-10 = Y12


.
At the same time, map those outputs to the LED BCD-Display.
 
Hi All,
Sorry my error, it is a FX0-30MR-ES. To re-arrange the element banks would cost more than a good plc, so i'm looking round for a suitable PLC if I cant use the Mitsubishi, any ideas what i should go for.

The KW values of the element banks are not important, its the amount and combination of the 13 outputs following my original switching list (which is correct) for satisfactory operation of the load bank, the 13 contactors were controlled by hand with switches before and it worked fine, ok the elements in these type of devices are not always spot on, but they are near enough for a load test module as we usualy have a good quality current clamp to provide current readings, taking into account for the cooling fans current, (9KW) and voltage fluctuations we usually adjust for this when you've worked out what load you need to put on. All I was trying to do was replace the switches with a 3x thumbwheel driven plc to relieve that extra burden of thinking about which switches to adjust.
 
Last edited:
Skeggy said:
Hi All,
Sorry my error, it is a FX0-30MR-ES. To re-arrange the element banks would cost more than a good plc, so i'm looking round for a suitable PLC if I cant use the Mitsubishi, any ideas what i should go for.

Since you already have started with Mitsu then go for the newer FX2N which gives you 8000 steps (one step is one contact) and close to 8000 registers and all imaginable functions.
 
Okay all, lets just solve the problem not reinvent the wheel.

You can use the original PLC, it has 800 steps available, and while it does have only 500 data registers you dont need them.

While it may not be terribly sophisitcated, just use ladder rungs...

|---|(BCD#)=1|-----------[MOVP K1 K4 Y0]
.
.
.
|---|(BCD#)=603|-----------[MOVP K8191 K4 Y0]

I believe this should work for the problem.
 
WireGuy1950 said:
Okay all, lets just solve the problem not reinvent the wheel...
I understand that you have never program a Mitsubishi PLC and you must know that what they call a "Step" is not what you imagine.

Regardless that you rung is not good, the way you have done it make sense BUT it would take about 5000 step to do.

...for instance the [MOV xx xxYooo] uses 5 Steps.

You've got 3000 just with this command.

-Sorry!
 
Skeggy, that gets us back to Keith's solution, using Compare and Subtract, which should not take all of the 800 "steps".

Load BCD command.
Multiply BCD Input by 10 to round off fractional load.
Compare Command => Y14 X 10. If yes, turn it on and subtract Y14 weight.
Compare subtotal => Y13 X 10. If yes, turn it on and subtract Y13 weight.
Compare subtotal => Y12 X 10. If yes, turn it on and subtract Y12 weight.
......
Do this all the way down to Y1 (or subtotal = 0).

16 rungs and the math is done.
It is elegant in that you are only looking at one thumbwheel setting, and subtracting the largest load bank value, compare to see if the remainder is greater than 0, it so, subtract the next largest load bank size, then repeat until remiander = 0.

I bet Pierre could write your program in about 5 minutes!
 
Last edited:

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,107
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,546
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,925
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,216
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