3 BCD input to 13 solenoid output sequence

You might need much fewer than even 200 items in the lookup table....if you observe carefully, there is repetition in Y0 through Y0 for twice in every hundreds place i.e. 1,51,101 are the same, 2,52,,102....so just test the first 2 switches to get these values. Similarly, Y11 is one when switch 1 has a value 1,2,3 or 4. y12 is on for 2,3,4 in the hundreds place and so on....

it might help
 
gimmephone, It repeats...until you get to 400. Then it all blows up, because there is not another 100 KW bank, so you have to use the 66.67 and a combination of the smaller banks, so the "first 100" cannot be used above 400, and that throws a possum in the middle of the stew.
 
I downloaded the FX manual (at MrPLC). From what I can tell, the Compare and Subtract code proposed will work (see page 2 of this thread).
Compare is CMP, Function 10, 7 steps.
Subtract is SUB, Function 21, 7 steps.
Everything should fit well into the 500 step limit.
 
Sorry for the mis-cue, I missed the part about it being an FXo and not an FX PLC. You all are correct, the FXo is really too small for this job, but any FX PLC with enough inputs and outputs should work quite easily.
 
Hi all,
we have had a look at the element banks this afternoon, and had a chance to try one or two of the lower ranges on a 200KW generator, and it seems that all of them are near but not spot on to the whole numbers on my output sheet, the 16.66 was measured at 15.98 KW ,depending on ambient temperature they seem to drift about, so sticking to the sheet and rounding off is ok, as it is would give a satisfactory operation so :1, 2, 3, 4, 10, 16, 33, 66, 66, 100, 100, 100, 100 KW. The 33 and 66 giving 99KW is fine for one the 100KW steps. What model Mitsubishi PLC should I buy as there seems to be plenty for sale local to me. meenwhile i'm going to have a go at writing the program tommorow with my new found knowledge from this site, Thanks all you guys for the help.. Just got to get to grips with GPPWIN.

Thanks Again.

Skeggy
 
I'm not sure if FXo has enough outputs or memory. The Compare/Subtract code should only take 200 memory locations. I think the limit is 500 on that one. Many have said that it's too small. I don't see it, but I'm no expert on Mitsubishi. Running out of memory can ruin your day. Get a bigger one to be sure. Looks like any FX will do.

Looks like round numbers will be fine, so no need to multiply by 10.
 
keithkyll said:
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.

Hi All

I would like to have a go at programming using the method Keith has come up with, but I,m having difficulty understanding the above and how to input it in to GPPWIN, could you give me an example to start me off, It would be greatly appreciated if you could.

We have Begged/ Borrowed four different Mitsubishi PLC,s to try the program in.

Skeggy
 
Skeggy...

If, as you say... "I,m having difficulty understanding the above and how to input it in to GPPWIN,..."

...then why in the hell would you "...like to have a go at programming using the method Keith has come up with..." ...especially if you are... "...having difficulty understanding the above..."

What the hell? Do you simply want to try it because it looks cute?
 
Terry,
I am offended by the aggressive nature of your reply, Do you treat all newcomers to PLC,s and this site with the same sort of arrogance, Where I come from this would be considered most unprofessional for a man in your position in the PLC programming world.

As I have said on earlier threads I'm new to PLC programming, I have a fairly good understanding of logic, but I havn't used GPPWIN before for anything other than simple sensor inputs/ relay outputs.
 
I downloaded the manual for MELSEC software. I hope you can translate to GPPWIN.
The main function is Compare. CMP (FNC 10). This instruction does <, =, and >. I was hoping for =>. To get around this, we can just use > and subtract 1 from all of the constants. (Use = for the last one). If this is confusing, don't worry - it will be clear in the example.

You have 3 thumbwheels in D0 to D2. You need all 3 in one variable. I think SMOV (FNC 13) is used to do this. If you can't, then use SFTL (FNC 35) to shift them in. I hope one of the experts can give an example. For now, I'll assume it's in D3.
1) Use MOV (FNC 12) to copy the number to another variable. We will be comparing and subtracting this variable. Lets use D4 for the new variable.
MOV D3 D4
2) Use CMP (FNC 10) to compare D4 to the value of Y14. It's 100KW. We'll use 99 as a constant. That will make it work the same as >=100.
We're starting high and subtracting down with whole numbers, so this will work. MELSEC uses 3 bits to store the results of the compare. If we tell it we want to use M0, it will use 3 consecutive bits. M0 will be on if the first number is larger. M1 will be on if it's equal. M2 if it's less than. We only care about M0. (but need to be aware that 3 bits are written so we'll use M4 in the next instruction).
CMP K99 D4 M0.
3) Do 2 things if M0 is on. Turn on Y14, and subtract 100 (not 99) from D4.
LD M0, OUT Y14.
LD M0, SUB D4 K100 D4.
I'm assuming we can reuse D4 in the SUB function. In the MELSEC example, they spaced the variables by 2: SUB D10 D12 D14. We're only doing 16 bit, so single spacing should be okay.

I hope you can build it from this. Flow chart:
1) Load thumbwheel in D3.
2) Use your Enter button to move (really a copy) D3 to D4.
3) Compare D4 > K99. If true, M0 will be on.
4) If M0 is on, turn on Y14 and subtract 100 from D4. Write the new number back into D4 (if permitted). SUB D4 K100 D4
5) Compare D4 > K99. If true, M4 will be on.
6) If M4 is on, turn on Y13 and subtract K100 from D4. Write the new number into D4. SUB D4 K100 D4
7) Compare D4 > K99
8) If M7 then Y12, SUB D4 K100 D4
9) Compare D4 > K99
10) If M10 then Y11, SUB D4 K100 D4
11) Compare D4 > K65
12) If M13 then Y10, SUB D4 K66 D4
13) Compare D4 > K65
14) If M17 then Y9, SUB D4 K66 D4
...
For the last one, use the M bit that's equal (the next higher M bit).
No need to do the subtract - after checking for Y1, you're done. Your Enter button will write a new number and start the sequence over. To do the Clear button, move (MOV) a constant 0 (K0) into D4. MOV K0 D4.

If we can't SUB D4 K100 D4, then we'll need to add another instruction and increment the D registers. SUB if M0 is true, MOV D4 D5 if M0 is false. That way, data is always moving to the next register. Subtract does it, but if we don't subtract, then move to keep everything in order.

I've never programmed a Mitsubishi. Wait for the experts to correct any errors first.
 
Last edited:
Math error. The constant you compare against should decrease.
The list is 502, 402, 302, 202, 136, 70, 37, 21, 11, 7, 3, 2, 1.

I based this off of your list posted earlier:
1, 2, 3, 4, 10, 16, 33, 66, 66, 100, 100, 100, 100
This list adds up to 601, not 603. You should add 1 to two of the higher numbers so selection will be correct at the end.

If you find a problem with accuracy, use a range function instead of compare. Replace CMP (FNC 10) with ZCP (FNC 11). You can intermix CMP and ZCP, or use ZCP exclusively for maximum accuracy. Use the equal M bit for ZCP.
 

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,544
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,214
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