Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Function Block Programming

Status
Not open for further replies.

semilogical

Electrical
Jan 11, 2007
7
0
0
US
I'm new with function block programming, I'm an old ladder logic type.

I need to program basically a NOT for an input in a Boolian AND instruction with several NOT's involved. Typical ladder would be something like the below (without addresses)

xic xic xic xio xio xio ote

Simple logic in ladder but I can't find the method of showing the xic's. In Triconix, Siemens and Modicon you have a simple circle to indicate a NOT condition.

 
Replies continue below

Recommended for you

I've played around with Siemens and Modicon(Quantum) and have found the right icons/tools in those softwares. The only invert I can find with AB is the BNOT, it works but is a space eater.

I'm getting around but it's slow and probably will be until I get comfortable with the format and instructions.
 
Would it help to apply de Morgan? It usually isn't used in ladder because it was supposed to less reliable in a HW circuit (not fail-safe). But in a PLC, that kind of failure mechanism isn't a problem.

So, if you consider that /A and /B and /C is equal to /(A or B or C) then you need just one NOT instead of one for each signal. "/" stands for NOT.

So, even if the NOT is a space-eater, I think that you could live with a reduced number of them.

Gunnar Englund
--------------------------------------
100 % recycled posting: Electrons, ideas, finger-tips have been used over and over again...
 
Gunnar just showing you Boolean Algebra. This was a course in your early Digital circuits classes

Might want to review it.

The only reason it comes easy for me is that I used to do P&G projects and they required all PLC programs to be drawn in Boolean Algebra format. I think its burnt a crease in my brain, never get that one back.
 
Gents. I just completed my first Seimens LOGO PLC program using a demo version of their Soft Comfort software. I used
Function Blocks as I do not know ladder logic and because I am a C programmer. Below is the plan I used to develop the logic for a series function blocks used to generate messages dependant on the state of four inputs, I5, I6, I7 and I8. Normally four inputs would resolve to 16 possible combinations. I5 and I6 are the NC and NO contacts of a SPDT microswitch. Ditto for I7 and I8. The SPST switches make for a number of illegal combinations. If you know C syntax you can see how I used this syntax in the plan.
if ((I6 && I8) && (not(I5 || I7))) {
msg line 1: VALVE A OPEN
msg line 2: VALVE B OPEN
priority: 5 }
if ((I6 && I7) && (not(I5 || I8))) {
msg line 1: VALVE A OPEN
msg line 2: VALVE B CLOSED
priority: 2 }
if ((I5 && I8) && (not(I6 || I7))) {
msg line 1: VALVE A CLOSED
msg line 2: VALVE B OPEN
priority: 1 }
if ((I5 && I7) && (not (I6 || I8))) {
msg line 1: VALVE A CLOSED
msg line 2: VALVE B CLOSED
priority: 30 (highest) }
TRUE {
msg line 1: ERROR
msg line 2:
priority 0 (lowest) }
In my FBD (Function Block Diagram) each of the && symbols was replaced with an AND block and each of the || symbols was replaced with an OR block. Each of the NOTs were replaced with a NOT block, available in Soft Comfort. The inputs were connected to the FBs as shown. The outputs of the AND blocks were connected to message blocks programmed to display the text as shown above. The priorities are not really required except to force the ERROR message if none of the other messages are enabled. Regards.
 
Status
Not open for further replies.
Back
Top