Download SINUMERIK 840D C-PLC Programming

Transcript
4 C Call Interface for the Basic PLC Program
4.2.4
03.96
PI, general PI services
Description
The PI function can be used to start program instance services in the NCK
area. The specified service is referenced in the PIService parameter (see
gp840d.h for the defines). The selected PI service is supplied with parameters
by means of the additional freely assignable input variables with different data
types (Addr[4] for strings, WVar[6] for integers or word variables).
The PI function calls up basic function block FB4. For a description of FB4
please refer to
Parameters
Return parameters
Error codes
References:
/PLCGP/, Description of Functions: Standard Machine
Table 4-8
Parameters for PI
Signal
Req
PIService
Unit
Addr[4]
Type
VKE_TYPE
UWORD
UWORD
S7_ANY_POINTER
Value range
WVar[9]
WORD
1..
Table 4-9
Return parameters for PI
Signal
Error
Type
VKE_TYPE
Done
State
VKE_TYPE
UWORD
Value range
Remarks
Job was given negative
acknowledgement or could not
be executed
Job was successfully executed
See error codes
If a job could not be executed, this is indicated by a ‘1’ in the state parameter.
The cause of the error is coded in the State block output:
Table 4-10
State
3
6
7
9
Error codes for PI
Meaning
Negative
acknowledgement, job not
executable
FIFO full
Option not enabled
Communication busy
6FC5297-3AB60
4-12
1..16
1..
P#DBnr.dbxm.n
Remarks
Start job on positive edge
PI service
Unit number
Reference to string specification
according to PI service selected
Word specification according to
PI service selected
Information
Internal error, possible remedy: Reset NC
Job must be repeated, because queue is full
GP parameter “NCKomm” is not enabled
Job must be repeated
© Siemens AG 1995 All Rights Reserved
FB (FB)