Plc Program Examples; Function Module - Bosch CL400 Manual

Hide thumbs Also See for CL400:
Table of Contents

Advertisement

11

PLC Program Examples

11.1

Function Module

; --------------------------------------------------------------------------------
; Reading a DM via Ethernet
; Parameter handling in a work DM
; --------------------------------------------------------------------------------
; Call parameters of the module
;P0
RssNr WORD VAR_INPUT
;P1
DB_NR WORD VAR_INPUT
;P2
STATUSWORD VAR_IN_OUT
;
;P3
DBNrPSTWORD VAR_INPUT
;P4
BlkAdrPSTWORD VAR_INPUT Block address PST
;P5
DBNrASTWORD VAR_INPUT
;P6
BlkAdrASTWORD VAR_INPUT Block address AST
;P7
Anzahl WORD VAR_INPUT
;P8
Offset WORD VAR_INPUT
;P9
IPAdr_LWORD VAR_INPUT
;P10 IPAdr_HWORD VAR_INPUT
;P11 CNT WORD VAR_IN_OUT
;Usage of the scratch DM
;DM 0 to 31 CommandParameter
;DM 32 to 37 Error
DEF
D38,-ErgMerk
DEF
D40,-ErrMerk
DEF
D42,-DBnr
DEF
D44,-Para1
DEF
D46,-Para2
DEF
D48,-Para3
L
W
-DB_Nr,A
CM
[A]
T
W
A,-DBnr
L
W
-Status,A
CPLA W
0,A
JPZ
initdata
CPLA W
1,A
JPZ
execute
CPLA W
2,A
JPZ
vonvorn
fehler:
EM
1070 072 196-101 (00.06) GB
Below you find an example of a function module for reading out via Ethernet
a data module from another controller. The parameters are generated dy-
namically in a DM. All auxiliary variables are located in this DM as well. After
the DM has been read in, a counter variable is incremented and a new read-
ing job is started.
RSSNo. (RSS No. in the high byte)
Data module to command handling (min. 60 words)
Statuses of the command (0:New
otherwise error)
DM number on the PST
DM number on the AST
Amount of data to be read (in words)
Offset in the DMs
Low part Internet address
High part Internet address
Command counter
;Marker for module result
;Marker for module error
;Call parameters Req and Con
;Activating the work data module
;Evaluation of current command status
;At 0: new command
;At 1: poll command
;At 2: trigger new command
;otherwise: error
PLC Program Examples
1:Run
2:O.K.
11- -1

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Cl500

Table of Contents