
Process interfacing via an automation system (PLC, PC)
10.4 Control with FB79
SIMATIC MV420 / SIMATIC MV440
Operating Instructions, 04/2013, A5E02371045-06
281
Remember that you can influence the execution of the FB with the parameters of the user
interface "Connections ➜ Integration":
●
If you want to read out a result string using the FB, the output of the result string must be
set to PROFINET IO. With the jobs "Select program" (COMMAND =W#16#0001), "Save
a program" (COMMAND =W#16#0002) and "Output currently selected program"
(COMMAND =W#16#0003), the number of the selected program is queried on the
reader. For this reason, output of the result string must also be set to PROFINET IO in
these cases.
●
The interface for the DISA, SEL0 to SEL3, TRN, RES, IN_OP, TRD, RDY signals must
always be set to PROFINET IO.
●
The setting of the interface for the result bits READ, MATCH, N_OK is irrelevant for the
FB.
How it works
FB79 "VS130-2_CONTROL" is an asynchronous block, in other words, its execution may be
spread over several FB calls.
You start job execution, by calling the FB with a job number > 0.
Job execution is completed when ACTIVE changes to the value FALSE and either DONE or
ERROR has the value TRUE (positive edge). Please note that various jobs can be handled
in one CPU cycle and ACTIVE does not therefore change to the value TRUE. This involves
the "Read out status" and "Reset DISA bit" jobs. In this case, it may also not be possible to
detect an edge change at DONE or ERROR.
You should therefore evaluate the DONE and ERROR parameters at each block call. If the
job completed without error, DONE is set = TRUE. In this case, you should also evaluate
ERRCODE to learn of warnings from the FB.
As long as ACTIVE has the value TRUE, you will need to call the FB with the identical
assignment of the COMMAND input parameter. It is also not possible to start a new job
during this time.
Read jobs are cyclic jobs. This means that after the start of a job with
COMMAND=W#16#0081 to 008F, ACTIVE has the value TRUE. ACTIVE retains this value
until the job is stopped again.
The read cycle (in other words, the transfer of a complete result string) is completed when
ACTIVE has the value TRUE and either DONE or ERROR has the value TRUE (positive
edge). If you want to start a different job while a read job is running, you will need to cancel
the read job first. You do this by calling the FB with COMMAND=W#16#0000. In this case,
ACTIVE changes its value to FALSE. Depending on whether a result string is currently being
transferred, either DONE or ERROR has the value TRUE. If ERROR has the value TRUE,
ERRCODE has the value DW#16#00010007.
Note
If an error has occurred that changes the reader to STOP, eliminate and acknowledge the
error.
You can then return the reader to RUN by changing program (COMMAND = W#16#0001).
Summary of Contents for SIMATIC MV420
Page 2: ......
Page 418: ...Glossary SIMATIC MV420 SIMATIC MV440 416 Operating Instructions 04 2013 A5E02371045 06 ...
Page 423: ......