H2: Auxiliary function outputs to PLC
8.13 Block-search response
Basic Functions
454
Function Manual, 09/2011, 6FC5397-0BP40-2BA0
Multi-channel block search
Examples
Two examples for configuring a user-specific SERUPRO end ASUB.
Example 1: Deleting auxiliary functions and generating the auxiliary function output with AUXFUSYNC(...)
CAUTION
Multi-channel block search and AUXFUDEL / AUXFUDELG
If, for a multi-channel block search in the SERUPRO end ASUBs, auxiliary functions with
AUXFUDEL / AUXFUDELG are deleted from the global list of auxiliary functions, before
calling the AUXFUSYNC function, the channels involved must be synchronized. The
synchronization ensures that before calling the AUXFUSYNC, all delete requests are
processed and a consistent list is available.
Program code
Comment
N10 DEF STRING[400] ASSEMBLED=""
N20 DEF STRING[31] FILENAME="/_N_CST_DIR/_N_AUXFU_SPF"
N30 DEF INT GROUPINDEX[10]
N40 DEF INT NUM
N60 DEF INT ERROR
N90
N140 AUXFUDEL("M",2,3,5)
; M2=3 (5th auxiliary function group) delete
N150
N170 AUXFUDELG(6)
;
;
Delete the collected auxiliary function of the
6. group.
N180
N190 IF ISFILE(FILENAME)
N210 DELETE(ERROR,FILENAME)
; Delete the FILENAME file
N220 IF (ERROR<>0)
; Error evaluation
N230 SETAL(61000+ERROR)
N240 ENDIF
N250 ENDIF
; CAUTION!
; If, for a multi-channel block search, auxiliary functions with AUXFUDEL/AUXFUDELG
; are deleted from the global list of auxiliary functions, before the loop to
; generate the subprogram FILENAME with AUXFUSYNC, the channels must be synchronized.
The synchronization ensures that all delete requests were processed
; in all channels and a consistent list is available.
; Example: WAITM(99,1,2,3)
N270 LOOP
N300 AUXFUSYNC(NUM,GROUPINDEX,ASSEMBLED)
; General a part program block
N310