![Siemens SIMATIC NET CP 343-2 Скачать руководство пользователя страница 55](http://html.mh-extra.com/html/siemens/simatic-net-cp-343-2/simatic-net-cp-343-2_manual_1265368055.webp)
5
Using the Command Interface
55
CP 343−2 / CP 343−2 P AS−Interface Master
Release 08/2008
C79000−G8976−C149−04
Table 6-1
Formal Parameters, continued
Name
Remarks
Memory Area
Data Type
Para Type
STATUS
I/Q
DWORD
M,D
1st word: Job status / error code (see
Table 6-2);
For ’job terminated with error’, an
error code is generated that describes
the error in greater detail.
2nd word: Required by the FC for
internal purposes and must
not
be
modified.
Note:
For FC calls to different logical
addresses (LADDR), different double
words must be used for the STATUS
parameter.
Commands in the User Program
To work with commands, include the following in your user program:
1. In the warm restart branch of your S7 user program, call FC ASI_3422 once
with the parameter value STARTUP = TRUE.
2. Specify the command call in a send buffer in the user program. You transfer this
send buffer with the SEND call parameter.
3. Depending on the command type you will also require a response buffer. You
transfer this response buffer with the RECV call parameter. For status
information, the response buffer is
not
required for this FC interface.
4. Activate the job with the parameter ACT=1
5. You then query the parameters DONE, ERROR and STATUS. For handling
these parameters in the user program, note the signal sequence of the
parameters explained below.
The CD that ships with the CP contains sample programs.
Signal Sequence of the Formal Parameters ACT, DONE, ERROR and STATUS
A command call is started by ACT = 1. During the processing of the job, the first
word of STATUS has the value 8181
H
. This indicates that a job is being processed.
On completion of the job, the user is informed of the result in the DONE or ERROR
parameters.
If no error occurred, DONE is set. In jobs involving response data from the CP
343-2, these are available in the receive buffer specified for RECV. In this case,
0000
H
is entered in the first word of STATUS.
If an error occurred, ERROR is set. In this case, no receive data are available from
the CP 343-2 for jobs with response data. To identify the error in greater detail, an
error code is entered in the first word of STATUS.