S7 300 XOR flip flop

barryoc

Lifetime Supporting Member
Join Date
Nov 2009
Location
Kilkenny
Posts
148
Guys,

Apologies as i know has being discussed many times but i can't seem to find the solution.

I have an s7 200 project that uses 4 box function to create a flip flop function for 32 buttons on a touch panel. The trouble i am having is getting the same code to work in an s7-300/400 project. I have attached the the s7 200 project and the block is HMI_CONTROL.

Any help on this will be greatly appreciated as in the s7-300 project there will be many more flip flops to be used.

P.S. Novice on s7-300. Little or no experience with stl but extremely willing to learn.

Regards,
Barry.
 
I dont have microwin at hand right now, so cant check it. But does your program use xor (I assume yes from title)?

S7-300/400 XOR behaves very stupidly, it actually checks if uneven amount of conditions is true. If uneven then result of XOR is true. If even then result is false.

Code:
x i0.0 // true
x i0.1 // false
x i0.2 // true
x i0.3 // true
= q0.0 // uneven number of conditions in xor are true so result will be true and q0.0 will be true

x i0.0 // true
x i0.1 // false
x i0.2 // true
= q0.0 // even number of conditions are true so result is false and q0.0 is false
This is just guess on what could be the problem. I really hate siemens xor.
 
Well, it can be just me (and few others who actually did point out it for me) that it should be exclusive or as its name suggest. As in

x true
x true
x false
x true

would be false, as there is more than one condition true.
 
Well, it can be just me (and few others who actually did point out it for me) that it should be exclusive or as its name suggest. As in

x true
x true
x false
x true

would be false, as there is more than one condition true.

really?
table_xor_nor.jpg


i think simatic do it well ;)
 
Technically XOR with more than two inputs is not defined. But most solutions XOR two bits then XOR the result of that with a third bit and so on until all have been included. Another name for what has been created,a s pointed out, is a parity generator. This one give a true output if an odd number of inputs are on.

But the original poster is trying to create 32 flip flop functions, presumably using word operations. If the S7 has 32 bit word operators then one way would be like this. I don't know the S7 instruction set so I'll describe it like this:

'Flip Flop' = 'Flip Flop' XOR ((Current PB Input XOR Previous PB Input) AND Current PB Input)

Previous PB Input - Current PB Input
 
Last edited:
Guys,

Apologies as i know has being discussed many times but i can't seem to find the solution.

I have an s7 200 project that uses 4 box function to create a flip flop function for 32 buttons on a touch panel. The trouble i am having is getting the same code to work in an s7-300/400 project. I have attached the the s7 200 project and the block is HMI_CONTROL.

Any help on this will be greatly appreciated as in the s7-300 project there will be many more flip flops to be used.

P.S. Novice on s7-300. Little or no experience with stl but extremely willing to learn.

Regards,
Barry.


What is there in the S7-200 program can be converted to S7-300/400 without any problem.
The only difference is:

300/400 doesn't use byte based XOR, it uses word or doubles.
This means you'll have to expand the current byte structure to words.

A quick scan of the 200 program told me you can do the same there. You might wanna change the 200 program to word based as well, just for the sake of consistency.

Attached is a screenie of the XOR's. The rest can be adjusted to the new format quite easily.

Flip-flop.jpg
 

Similar Topics

in allen bradley kinetix 300 drive first E31 error shows after resting drive E11 error occurs need solution to reset E11 fault code
Replies
4
Views
153
Hi, I'm setting up a modbus master on an S7-300. It seems to work in OB1 but not when I use it in OB35. Does anyone have any ideas why? Could...
Replies
10
Views
125
So basically i have 2 queries : 1. I have a program file of S7-300 PLC which i want to migrate in RSLogix500.In short i want to convert my simatic...
Replies
15
Views
289
Hi i using Kinetik 300 2097 driver control by EIP with using move absolute and incremental for motion , but i want to add same driver and motor as...
Replies
0
Views
77
Hey all, first time poster here. I am wondering if anyone has tried using a Keyence SR-X300 barcode scanner to a Micrologix 1400. Keyence sent...
Replies
0
Views
88
Back
Top Bottom