Program Structure

Thank you Peter, your observations are appreciated, as always.



Would this make the code work any different? What are the advantages of doing it this way?



Is the code structure better this time round?



Peter, I’m off for the weekend, have a good one and don’t work too hard.
 
PeterW said:
The following declarations you made at the block call:

PositiveEdge :=
ValveCloseCommand :=
ValveOpenAction :=
ValveOpenFaultBit :=
ValveCloseFaultBit :=

Would be better defined internally as STAT declarations. They would then become part of the instance DB.

Ok great, I did some reading up and I understand, way couldn’t the bloody Germans just say so in the help file? This will help a lot to streamline the FB call, thanks.



If I place my ValveOpenAction (output to solenoid) in the STAT, how will I address it to the output of the PLC? In order to energize my solenoid?
 

Similar Topics

Hello all, Just to give you an idea of my background, I'm new to the PLC world with a background in IT and currently pursuing my MSEE. I have...
Replies
3
Views
744
OK, (some of) you guys know by now that I'm not a PLC programmer, so I'm not really familiar with how a well-structured PLC program is typically...
Replies
2
Views
1,475
Program structure - s7-1200 MODBUS RTU Master with multiple slaves & multiple registe I'm having problem to make a appropriate structure of my...
Replies
7
Views
11,252
Hello, I am creating a PLC program for a fresh water pump station which will be based on downstream and upstream pressures. There will be several...
Replies
5
Views
2,105
hi guys I have recently completed a basic S7 course and have started creating my own little programs/solutions to small problems using stl. So...
Replies
1
Views
1,219
Back
Top Bottom