home *** CD-ROM | disk | FTP | other *** search
- <HTML><HEAD></HEAD><BODY><PRE>
-
- Hi folks, here are some english documentation to s5 in Java:
- ============================================================
-
- The s5 applet simulates a mini subset of a S5 like plc. If you don't
- know what a plc or s5 is, it is maybe very difficult for you to
- understand, what I am talking about... We will see...
-
- A plc is a special computer for controling all kinds of hardware like
- motors, switches, pumps, elevators, production systems etc.
-
- It has inputs and outputs in digital and analog format. Inside the
- plc is a loaded program running, that makes logic decisions and toggles
- the outputs, based on the program code and the input states.
-
- The program consists of operations and operands and addresses.
- The address of a operand is divided in a module number and a bit number
- of the module. Both numbers are separated by a decimal point.
- A address looks like 0.0 or 0.7...
-
- This are the operations:
-
- U - And
- UN - And Not
- O - Or
- ON - Or Not
- S - Set
- R - Set Back
- L - Load
- = - Set to
- BE - End of program
-
-
- This are the operands:
-
- Bit varaibles All only 0.0 to 0.7
- E - Inputs
- A - Outputs
- M - Marker
-
- Word type variables
- T - Timer 0 to 2
- Z - Counter 0 to 2
- K - Constant to load into accu variable ( LK14.0 )
-
- YY - Year
- YN - Month
- YW - Week of the year
- YD - Day
- YO - Day of the week (Sun=0...Fri=5,Sat=6)
- YH - Hour
- YM - Minute
- YS - Second
-
- Inside the plc is a accu variable, that can be loadled with L K <value>.0 .
- The accu content can then by loaded into a timer or counter with:
- S Z 0 0 - Set counter 0 to accu content
- S T 2 0 - Set timer 2 to accu content
- The timer are only pseudo timers, since they are decreased after each
- complete program cycle until they reach zero.
-
- The are also 4 important variables, that the program maintains internal:
-
- b_vka - Is the logic result if the operand in this program line
- ex: if E 0.0 is true, b_vka is true. Otherwise b_vka is false
- b_vkb - Is the logic result of b_vka and the operation
- ex: U E 0.0 is true if E 0.0 is true and the last logic result
- in b_vkl is also true. Otherwise it is false
- ex: O E 0.0 is true if E 0.0 is true or the last logic...understood?
- b_vkl - Contains the b_vkb from the program line before
- b_vku - Is needed for U operations...
-
- So one simple example program:
-
- program lines b_vka b_vkb b_vkl A 0.0
- UN A 0 0 0 1 1 0
- = A 0 0 0 1 1 1
- BE
- UN A 0 0 1 0 0 1
- = A 0 0 1 0 0 0
-
- So A 0.0 will toggle between 0 and 1...
-
- On the right side of the applet, is space for a hardware simulation
- area. Currently 0 and 1 is implemented. You can switch to this with:
- L K 0 7 - The bit numer must be 7! The module number is the the area.
- L K 1 7
-
- Hope that helps you a litte...
- Best regards
- Peter Sieg
- mailto: Peter.Sieg@gmx.de
-
- </PRE></BODY></HTML>