Question for S7 Guy or another XOR flip flop expert!

504bloke

Lifetime Supporting Member
Join Date
Jan 2005
Location
Down South
Posts
2,721
HI

In a previous post you made reference to a flip flip (motor on and off with one p/b) using an xor in s7 in FBD ?

S7Guy said:
Hey Johnny, I can't take credit for that. I can't remember who posted it originally, but it went like this:

A #PushButton
FP #AuxPB
X #PBStatus
= #PBStatus

It doesn't convert to S7 ladder, but it converts to S7 FBD.

Not being familiar with S7 FBD what exactly is this ? Reason for my question is i am just doing a little flip flop circuit on a Moeller Easy 800 and it has an xor function in Function Blocks, would this translate easily ? or not ? i seem to have a mental block on the scenario!!!

Whilst i can easily do it with ladder i thought it may make a change to try the xor if at all possible!
 
Not being familiar with S7 FBD what exactly is this ?
FBD is just another of the IEC61131-3 PLC languages : Function Block Diagram. STEP7 gives you three languages out of the box: LAD, STL and FBD.

Some code written in STL (as this example is) can not be visually represented in ladder. This is just a quirk of ladder editors not an issue of the validity of the logic. You'll also find code which can switched between all three languages styles. The cascade goes as : all LAD code can be shown as FBD or STL, and all FBD code can be shown as STL. The reverse is not always true.

Your piece of code uses a 'one-shot' (FP) to detect a rising-edge change of state in the Pushbutton, and then XOR's this with PBStatus to finally set the value of PBStatus. Basically if it's on switch it off, or if it's off switch it on.

I can't see why this wouldn't translate to any other PLC model which supports a one-shot and an XOR. You could write this in STEP 7 LAD using specific instructions for these two functions, but it would use more instructions and slightly more memory. This has the main advantage of being very neat.

Regards

Ken
 
Ken M said:
FBD is just another of the IEC61131-3 PLC languages : Function Block Diagram. STEP7 gives you three languages out of the box: LAD, STL and FBD.

Some code written in STL (as this example is) can not be visually represented in ladder. This is just a quirk of ladder editors not an issue of the validity of the logic. You'll also find code which can switched between all three languages styles. The cascade goes as : all LAD code can be shown as FBD or STL, and all FBD code can be shown as STL. The reverse is not always true.

Your piece of code uses a 'one-shot' (FP) to detect a rising-edge change of state in the Pushbutton, and then XOR's this with PBStatus to finally set the value of PBStatus. Basically if it's on switch it off, or if it's off switch it on.

I can't see why this wouldn't translate to any other PLC model which supports a one-shot and an XOR. You could write this in STEP 7 LAD using specific instructions for these two functions, but it would use more instructions and slightly more memory. This has the main advantage of being very neat.

Regards

Ken

Thanks,

That answers my question.

Can see how to implement it in the Easy now with an xor and one shot.
 

Similar Topics

Hello, I am making changes to a system that has a 5/04 processor and I come from the land of Mitsubishi so I have a question.... I have some...
Replies
26
Views
6,484
I am using a Micrologix 1000 and I am attempting to write a program that will allow a label applicator to label 3 boxes on one side, then label...
Replies
3
Views
2,020
Hows it going everyone. Who's ready to rub their heads and groan at the new guy? Everyone? Ok good :) I've got a 1756-L72 Revision 19.013 with a...
Replies
8
Views
11,546
Howdy all. Here's a question for you to christen my posting to these boards. What was the last year the Allen Bradley SLC-150 was produced? I...
Replies
7
Views
2,404
Hello all. I am a electrical controls tech that does installs and trouble shooting of control systems involving PLC's. I am not a programmer but...
Replies
7
Views
2,814
Back
Top Bottom