Siemens KF Series Bedienungsanleitung Seite 2

  • Herunterladen
  • Zu meinen Handbüchern hinzufügen
  • Drucken
  • Seite
    / 3
  • Inhaltsverzeichnis
  • LESEZEICHEN
  • Bewertet. / 5. Basierend auf Kundenbewertungen
Seitenansicht 1
| | |
| | |
[ | |
| |BPOS: FW006 |
| |OUT OP SCREEN |
| | NUMBER |
| | 17-32 FW6 |
| | |
[ | |
| +--------------------+
Algorithm
The algorithm can be reduced to as follows:
1) Check the screen number for a valid number (zero is not a valid screen number).
2) Subtract the offset from the lower byte of the screen number word.
3) Perform a range check.
4) Left shift a '1' by the calculated amount.
Note that in a Siemens S5 PLC, the 'DO' instruction can be used to modify the operation of
the instruction following.
FB Source Code
FB212
Michael Griffin 1998
Convert the screen integer number to a binary pattern (0 - 15).
SCNO - Integer number representing the screen number.
OFST - Offset to subtract from actual screen number.
BPOS - One bit is set in this word which represents SCNO with
bit 0 indicating screen 1, and bit 15, screen 16.
(e.g. SCNO=4, BPOS=0000 0000 0000 1000).
SEGMENT 1
NAME: SCRNUM
DECL: SCNO I, W ;Screen number input.
DECL: OFST D, KF ;Screen number offset.
DECL: BPOS Q, W ;Output screen indicator.
: ;RESET DEFAULTS
: L KH 0000
: T FW254 ;Reset a scratch word.
: T =BPOS ;Reset the result.
:
: L =SCNO ;Load the screen number.
: !=F ;Is it equal to zero?
: BEC ;If so, exit.
:
: L KH 00FF ;Mask off the upper byte,
: AW ;lower byte contains screen number.
: LW =OFST ;Subtract the screen offset.
: -F
: D 1 ;Change range from 1-16 to 0-15.
: L KF +15 ;Is it greater than 15?
: >F ;If so, then exit.
: BEC
: TAK
: L KF +0 ;Is it less than 0?
: <F ;If so, then exit.
: BEC
: TAK
:
: T FY255 ;else, transfer it to a scratch word.
: L KH 0001 ;Convert this to a bit position.
: DO FW254
: SLW 0
: T =BPOS ;Transfer the result to the output.
:
: BE
Seitenansicht 1
1 2 3

Kommentare zu diesen Handbüchern

Keine Kommentare