Motion Control Information System
Motion Control Information System
Motion Control Information System
computer
PLC/NCK Interface 2
Valid for
10.05 Edition
SINUMERIK® Documentation
Printing history
Brief details of this edition and previous editions are listed below.
The status of each version is indicated by the code in the "Remarks" columns.
© Siemens AG 2005. All rights reserved Subject to change without prior notice
Preface
SINUMERIK Documentation
The SINUMERIK documentation is organized in 3 parts:
• General documentation
• User documentation
• Manufacturer/Service documentation
Please contact your local Siemens office for more detailed information about other
SINUMERIK 840D/840Di/810D publications and publications that apply to all
SINUMERIK controls (e.g. universal interface, measuring cycles, etc.).
Target audience
This Manual is intended for machine-tool users. This publication describes in detail
all the facts the user needs to know in order to program the SINUMERIK 840D
sl/840D/840Di/810D control.
Standard version
This Programming Guide describes the functionality afforded by standard functions.
Extensions or changes made by the machine tool manufacturer are documented by
the machine tool manufacturer.
Other functions not described in this documentation might be executable in the
control. This does not, however, represent an obligation to supply such functions
with a new control or when servicing.
Hotline
If you have any questions, please contact our hotline:
A&D Technical Support
Phone.: +49 (0) 180 / 5050 - 222
Fax: +49 (0) 180 / 5050 - 223
E-mail: mailto:[email protected]
Internet: http://www.siemens.com/automation/support-request
Fax form: See the reply form at the end of the brochure.
Safety Information
This Manual contains information which you should carefully observe to ensure
your own personal safety and the prevention of material damage. Notes relating to
your personal safety are highlighted in the manual by means of a warning triangle,
no warning triangle appears in conjunction with notes that relate to property
damage. The warnings appear in decreasing order of risk as given below.
Danger
! Indicates that death or severe personal injury will result if proper precautions are
not taken.
Warning
! Indicates that death or severe personal injury may result if proper precautions are
not taken.
Caution
! With a warning triangle this indicates that minor personal injury may result if
proper precautions are not taken.
Caution
Without a warning triangle this indicates that property damage may occur if
proper precautions are not taken.
Notice
indicates that an unintended result or situation can occur if the corresponding
information is not taken into account.
If several hazards of different degrees are present, the warning notice representing
the highest degree of danger will be used. A notice warning of injury to persons
with a safety alert symbol may also include a warning relating to property damage.
Qualified personnel
The device/system may only be set up and used in conjunction with this
documentation. The device/system may only be commissioned and operated by
qualified personnel. Within the context of the safety notes in this documentation
qualified persons are defined as persons who are authorized to commission,
ground and label devices, systems and circuits in accordance with established
safety practices and standards.
Correct usage
Note the following:
- Warning
! The equipment may only be used for single purpose applications explicitly described in the
catalog and in the technical description and it may only be used along with third-party
devices and components recommended by Siemens. To ensure trouble-free and safe
operation of the product, it must be transported, stored and installed properly and
maintained and operated with care.
Additional notes
! Important
This notice indicates important facts that must be taken into consideration.
Note
This symbol always appears in the document where further information is
provided.
Machine manufacturer
This pictorial symbol always appears in this document to indicate that the
machine manufacturer can affect or modify the function described. Never ignore
information provided by the machine manufacturer!
SINUMERIK 840D/840Di/810D
RPC SINUMERIK Computer Link
6.2 Data from an OEM application to the host computer ............................................. FBR/NFL/6-88
6.2.1 DDE between an OEM application and RPC SINUMERIK ...................................... FBR/NFL/6-89
6.2.2 File transfer from OEM applications to the host computer ....................................... FBR/NFL/6-90
6.2.3 File transfer from the host computer to the OEM application ................................... FBR/NFL/6-90
8 Communication between the Host Computer and the Transport System (TPS) ... FBR/NFL/8-101
9.1 Function calls from the host computer to SINUMERIK ............................................. FBR/NFL/9-114
9.2 Function calls from SINUMERIK to the host computer ............................................. FBR/NFL/9-114
1 Introduction
1
1.1 General information about RPC SINUMERIK ................... FBR/NFL/1-6
Fertigungsleitrechner
Nahtstelle
zum FLR
Windows-PCU
Datenhaltung
RPC
SINUMERIK
Alarmserver
NC-DDE-Server
Nahtstelle zu
MPI/BTSS
PLC/NCK
NCK PLC
DB-Nahtstelle
Data transfer
If there is only a small amount of data to be transferred, this is done in the RPC
function call. NC programs and other data already available as files are also
transferred as files. More extensive data, e.g. tool data, are written to a file and
then also transferred as a file.
The filename and other parameters are transferred to the peer with an RPC
function call.
Depending on the transfer options between the host computer and SINUMERIK,
the files are transferred either by FTP or, in a network file system, by copying.
RPC functions
The RPC functions in this document are described from the perspective of the host
computer and therefore of the user. RPC calls arriving at the host computer are
referred to in the rest of this document as "called functions". An RPC call arriving at
the host computer causes the corresponding function to be started in the host
computer.
RPC calls made from the host computer are referred to in the rest of this document
as "function calls". A function call from the host computer causes the
corresponding function to be called in RPC SINUMERIK.
COM port
The RPC SINUMERIK-OCX development package is an add-on product for the
RPC SINUMERIK computer link. The MCIS_RPC.OCX encapsulates the RPC
interface from RPC SINUMERIK in COM calls (Component Object Model). Using
the MCIS_RPC.OCX interface, the RPC SINUMERIK interface is accessible to a
whole range of common Windows development systems without the need to
program in C/C++.
2 System Installation
2
2.1 System requirements....................................................... FBR/NFL/2-10
2.1.1 Software........................................................................ FBR/NFL/2-10
2.1.2 Hardware ...................................................................... FBR/NFL/2-10
SINUMERIK 840D/810D
The following software is required on the SINUMERIK 840D/810D:
• PCU50/70 V1/V2, HMI ADVANCED 6.x
• The drivers for the Ethernet interface, and TCP/IP must be installed.
• MCIS-TDI (tool handling module) (only if the functions x_DATA_x SFct 21-23
are to be used).
• RPC SINUMERIK computer link software package
Host computer
Drivers for the installed Ethernet interface module.
TCP/IP with the FTP or NFS services and RPC according to the DCE standard.
2.1.2 Hardware
SINUMERIK 840D/810D
• PCU50
• For the network interface kits used, please contact the SINUMERIK Hotline or
see SINUMERIK FAQs: (http://www.siemens.com/support)
Host computer
For the network interface kits used, please contact the SINUMERIK Hotline or see
SINUMERIK FAQs: (http://www.siemens.com/support)
2.2 Start-up
The RPC SINUMERIK software is loaded onto the SINUMERIK and the Ini file of
the program is configured.
DB12 for the DB interface must be set up on the PLC. This will normally be
performed when the PLC of the machine manufacturer is installed.
The data block structure is described in "RPC SINUMERIK Computer Link,
PLC/NCK Interface (NPL)" in Chapter 1 (see /2/ Chapter 1 RPC interface and
machine PLC).
For notes
Note
In the host computer communication modes and manual mode, material flow on
the machine is automatic, i.e. the transport system automatically delivers
workpiece carriers and fetches them again after machining.
3.1.4 Offline
Offline indicates an interruption in the connection between the host computer and
the SINUMERIK. The SINUMERIK switches to Offline when it detects an
interruption in the connection to the host computer. The host computer also flags a
machine as Offline in its status data and in the plant display as soon as it detects
an interruption in the connection.
After Offline, the machine must be synchronized on the host computer.
If an operating mode (either a SINUMERIK mode or a computer communication
mode) is switched on the machine, this must be reported to the host computer with
the RPC call R_MACHINE_H().
4 Tool data
4
Tool data
Since not all data of a tool are always required, 3 versions are available.
1. The first version includes the full scope of tool data; the other two versions
contain only a subset of the data.
2. The configurability of the data scope for each tool only extends to complete
areas, i.e. a list, which is provided (in the registry) for each version, specifies
the areas which are transferred in this version.
The file format for the tool data corresponds to the data backup format of the
NC840D (punched tape/ASCII format acc. to /BA/ ; such as in _N_TOx_TOA or
_N_TOx_INI). The complete description of data content and layout is provided in
/NPL/ starting at Chapter 4.
Note
/NPL/ stands for the second part (NPL) of this document.
x : T number
Y : Magazine number
z : Location number.
*
$TC_MPP6 indicates which tool (T number) is in the stated magazine and location.
In this case tool number 3 is in magazine 1 in location 5.
Note
For the Interface Definition Language IDL (technical program definition) of the
calls used in the following, please refer to the appendix
The names are structured according to the following system for the procedures
described in this section:
Command identifier
The command identifier appears in the first character of the name:
C Command call (Command)
R Receive data request (Receive)
D Transmit data request (Transmit)
Data/
function identifier
The identifier indicates the type of data requested or transmitted or the function to
which the data are passed.
Examples: T_MACHINE_M (), R_NC4WPC_M().
Receiver identifier
The receiver identifier indicates the address of the unit which is to execute the
function:
H The host computer is the receiver (Host)
M (GND) The machine is the receiver (Machine)
Host
Name of the host computer with up to 16 characters. Where several machines are
networked to several host computers, Host is a unique identifier for the host
computer with which data are to be exchanged.
Machine
Name of a machine (max. 16 characters). Unique identifiers must be available for
all machines which exist on the network.
OrderNum
Job number: The number is optional and can be used if RPC requests and their
answers have to be assigned uniquely to each other.
Note
With parameters of type String, the string must be delimited by ‘\0’.
In Visual C++ "\0" and "" denote an empty string; in Visual Basic "" produces an
empty string.
The maximum string lengths are specified with the individual parameters.
Parameter
Parameters are data transferred within the RPC. The table block transferred with
every RPC describes the parameters to the host computer and machine.
Acknowledgment of
As with local procedures, the return value of the RPC indicates a positive or
negative acknowledgment. Where requests are processed asynchronously, this
acknowledgment can only acknowledge receipt of the request. After processing,
or if an error occurs during processing, the communication partner must be
informed by means of an appropriate RPC message. Error messages are
displayed on the SINUMERIK with the aid of the alarm server. For correctly
performed calls, the return value = 0. A list of the return values in the event of an
error is included in the appendix.
Note
The host computer software must return the called functions as quickly as
possible, because the component of RPC SINUMERIK that initiates the RPC
waits for it to be processed, with the result that no further processing can take
place during this period. Within the function called up on the host computer,
the data contained in the RPC should be copied into a buffer and the function
returned immediately. Actual processing on the host computer should only take
place afterwards.
Called function
R_MACHINE_H ( Host,
Machine,
OrderNum,
MachineMode,
MachineStatus,
NCProgram,
ClampCubeSide,
DockPos,
DockPosStatus,
WPC,
WPCStatus,
Resint1,
Resint2,
Resbyte)
Meaning
Transmit machine data to the host computer.
Data
Table 5-1 Parameters for machine status data transfer
Parameter Description Format
Host Name of the host computer 16 bytes (string)
Machine Machine name 16 bytes (string)
OrderNum Order number 4 bytes (long int)
MachineMode Mode 4 bytes (long int)
• SINUMERIK mode:
1: Automatic
2: MDA
4: JOG
8: TEACH IN
• Computer link mode:
100: FLR mode unattended
200: FLR mode attended
300: Manual mode
400: Special mode
500: If bit 6=1 in RPC SINUMERIK
mode
600: If bit 7=1 in RPC SINUMERIK
mode
MachineStatus Machine status 4 bytes (long int)
0: Cold restart
1: Inactive
2: Active
3: faulty
4: Components deactivated
NCProgram Current NC program* 128 bytes (string)
ClampCubeSide Side on clamp cube** 4 bytes (long int)
DockPos[3] Docking position no. 3 x 4 bytes
The docking position no. corresponds to (long int)
the index in the docking position list of
the interface DB beginning at the 1st
Docking position no. = 0 means:
'not assigned' (see /NPL/ Section 1.1
Description)
DockPosStatus[3] Docking position status 3 x 4 bytes
0: Enabled (long int)
1: Disabled for transport control system
2: faulty
WPC[3] Workpiece carrier name 3 x 6 bytes
(string)
WPCStatus[3] Workpiece carrier status 3 x 4 bytes
1: Not machined, (long int)
no Program assignment
2: Unmachined,
program assigned
4: Prepare program selection
8: Program selection done
16: In progress
32: Finished
Notes on use
• The SINUMERIK must initiate this RPC on every status change that takes place
on the machine. The RPC SINUMERIK computer communication software
determines the current data and initiates the call.
• The procedure is triggered by the PLC by setting a specific bit at the DB
interface.
• The host computer can also initiate the procedure using the command
T_MACHINE_M (request machine status data, see below).
Note
• If more than 3 docking positions are to be described, a separate machine
assignment file must be transferred. See Section 5.12
• In order to report the operating modes (SIN and host computer) of both nodes
in a variable (MachineMode), the quantity can be transferred as a value
(e.g. 201: host computer mode manned =200 and SIN Automatic =1).
• The RPC SINUMERIK computer communication software does not verify the
operating modes.
Function call
T_MACHINE_M ( Host,
Machine,
OrderNum)
Meaning
Request machine status data
Notes on use
The host computer can use this call to request machine status data, e.g. during
synchronization. The SINUMERIK then transmits the data to the host computer
with the command R_MACHINE_H().
Example
T_MACHINE_M("FLR1","BAZ3",0);
FLR PCU
Befehl
R_MACHINE_H()
Werkstückträger
Ankunftsmeldung
R_NC4WPC_M()
NC-Programmzuordnung
(eventuell mehrmals)
wenn nötig NC-Programm laden
(eventuell mehrmals)
R_MACHINE_H() Bearbeitungsbeginn
melden
R_MACHINE_H() Bearbeitungsende
melden
Function call
R_NC4WPC_M ( Host,
Machine,
OrderNum,
WPC,
NCProg,
Date,
NCPLength,
ClampCubeSide,
TpFlag,
NCExtern,
Resint1,
Resint2,
Resbyte)
Meaning
Instruct machine which program is to be activated
Data
Table 5-3 Parameters for program assignment
Parameter Description Format
Host Name of the host computer 16 bytes (string)
Machine Machine name 16 bytes (string)
OrderNum Order number 4 bytes (long int)
WPC Workpiece carrier name 6 bytes (string)
NCProg NC program 128 bytes
NC program in the form: (string)
"\mpf.dir\Zylinderkopf.mpf"
Date Date of the last change of the NC program 4 bytes (long int)
(Unix time)
NCPLength NC program size in bytes 4 bytes (long int)
ClampCubeSide Side on clamp cube 4 bytes (long int)
TpFlag Transport flag 4 bytes (long int)
= 0: No follow-up operation
= 1: Follow-up operation
= 9: Only for buffering
NCExtern Execute from external 4 bytes (long int)
Bit 1 Bit 0 Function
0 0 Execute NC program
on NCK
0 1 Execute NC program from
external (bit 0=1)
1 0 Execute workpiece on NCK
(bit 1=1)
1 1 Execute workpiece from
external (bits 0 and 1=1)
Notes on use
• This RPC can occur several times for a workpiece carrier if each side of a
clamp cube is to be machined with a separate NC program.
The sides are machined in the order in which the program assignments are
reported by the host computer to RPC SINUMERIK .
• In all program assignments of a workpiece carrier except for the last one, the
transport flag "1 = follow-up operation" must be set. If the follow-up operation
flag is set for a side, the workpiece carrier remains at the machining station at
the end of the NC program. The fact that the flag is not set for the last side
indicates that no further machining is required and the workpiece carrier can be
moved away from the machining station.
• If a workpiece carrier is only stored on a machine for buffering purposes, this
can be reported by setting transport flag "9 = only for buffering". In this case,
no NC program is specified.
Example
R_NC4WPC_M ("FLR1", "BAZ3", 0, "WPC05", "\mpf.dir\Kw15.mpf", 862826400,
3210, 1, 0, 0, 0, 0, "\0");
5.5 Messages
5.5.1 Messages from SINUMERIK to the host computer
Called function
R_REPORT_H ( Host,
Machine,
OrderNum,
Type,
Number,
Time,
Flag,
Resint1,
Resint2,
Resbyte)
Meaning
Send message to host computer
Data
Table 5-4 Parameters for the message from SINUMERIK to host computer
Parameter Description Format
Host Name of the host computer 16 bytes (string)
Machine Machine name 16 bytes (string)
OrderNum Order number 4 bytes (long int)
Type Message type 4 bytes (long int)
1: Alarms
2: Operator interruption
3: Operational messages
4: Error message from
RPC SINUMERIK computer link
software
5: Positive acknowledgment with
R_DATA_M (),
R_DDEDATA_M () and R_VAR_M ()
6: Positive acknowledgment with
C_ORDER_M ()
Number[10] Message number array 10 x 4 bytes
• Array for up to 10 alarms. (long int.)
• Array elements which are not required
should be initialized with 0
• In other message types, only Number[0] is
allocated
Note
Numbers, times and flags with the same index belong together
Notes on use
RPC R_REPORT_H() is used to send individual messages or groups of up to 10
alarm messages to the host computer.
Special case: If the last alarm is outgoing on the machine, this status is reported by
R_REPORT_H() and the parameters:
• Type = 1
• Number[0] = 0
• Flag[0] = L
sent to host computer.
Message filters
A message filter has been implemented in RPC SINUMERIK to suppress the
transmission of certain messages or alarms to the host computer. It is possible to
suppress alarm types from the alarm server completely and it is also possible to
suppress ranges of certain numbers.
This feature is configured using the file ScAlarmEx.ini in the ADD_ON directory.
The section [AlarmTypeExclusion] serves to exclude alarm types, and the section
[AlarmRangeExclusion] serves to exclude ranges of numbers.
The vocabulary words (Type1 to TypeN or Range1 to RangeN) must be assigned
without gaps; the reading function reads with ascending number and stops reading
with the first number not existing.
[AlarmTypeExclusion]
Type1=6
Type2=7
Type3=8
Type4=9
Type5=10
Type6=11
[AlarmRangeExclusion]
Range1=100,199
Range2=250,250
Range3=2001,3999
Range4=5000,5050
Range5=6799,6799
FLR PCU
Befehl
R_REPORT_H()
Meldung kommt
R_REPORT_H()
Meldung geht
Function call
R_REPORT_M ( Host,
Machine,
OrderNum,
Type,
Number,
Resint1,
Resint2,
Resbyte
Meaning
Error messages from the host computer are sent to RPC SINUMERIK on the
SINUMERIK.
Data
Table 5-5 Parameters of the message from host computer to SINUMERIK
Parameter Description Format
Host Name of the host computer 16 bytes (string)
Machine Machine name 16 bytes (string)
OrderNum Order number 4 bytes (long int)
Type Message type 4 bytes (long int)
4: Error messages of the host computer to
SINUMERIK
Number Error code 4 bytes (long int)
Resint1 Reserve 1 4 bytes (long int)
Resint2 Reserve 2 4 bytes (long int)
Resbyte Reserve 3 8 bytes (string)
Notes on use
The error messages are entered on the SINUMERIK in a LOG file. In addition,
certain error messages trigger an error handling in RPC SINUMERIK.
Example
R_REPORT_M ("FLR1", "BAZ3", 0, 4, -13, 0, 0, "\0");
T_REPORT_M()
Anstehende Alarme anfordern
T_REPORT_M ( Host,
Machine,
OrderNum,
Direction of transfer: Host computer → SINUMERIK
Meaning
T_REPORT_M can be used to request alarms and messages pending on the
alarm server, taking into account the message filter. All pending alarms and
messages are requested, irrespective of whether they occurred with or without
connection to the host computer at any time.
Thus, the function provides a synchronization between host computer and
SINUMERIK with regard to the alarms and messages.
Otherwise, only such alarms are transferred to the host computer which occurred
with connection to the host computer at any time.
The alarms and messages requested with T_REPORT_M are reported with
R_REPORT_H.
Data
Table 5-6 Parameters of the alarm request
Parameter Description Format
Host Name of the host computer 16 bytes (string)
Machine Machine name 16 bytes (string)
OrderNum Order number 4 bytes (long int)
The display of the messages provided to SINUMERIK from the host computer
(R_MESSAGE_M) is carried out via the alarm server (in the header). The priority of
the messages can be set in the host computer using the ResInt1 parameter from
R_MESSAGE_M. The ResInt1 parameter can have the following meaning in
combination with R_MESSAGE_M:
Note
The alarm priority influences the position in the alarm list (see description of the
alarm server).
Function call
R_MESSAGE_M ( Host,
Machine,
OrderNum,
Message,
Resint1,
Resint2,
Resbyte)
Meaning
Display message on the operator panel of the SINUMERIK
Data
Table 5-7 Parameters of the message to SINUMERIK
Parameter Description Format
Host Name of the host computer 16 bytes (string)
Machine Machine name 16 bytes (string)
OrderNum Order number 4 bytes (long int)
Message Message text 128 bytes (string)
Resint1 Reserve 1 4 bytes (long int)
Resint2 Reserve 2 4 bytes (long int)
Resbyte Reserve 3 8 bytes (string)
Notes on use
The host computer sends messages, e.g. about tools or materials to be prepared,
to the machine operator to prepare for processing of the next part program.
Note
The display is via the alarm line in the header
Example
R_MESSAGE_M("FLR1", "BAZ3", 0, "Hello Machine", 0, 0, "\0");
Languages
RPC SINUMERIK generally supports all languages which are covered by the ASCII
character set or for which a language package has been installed on the
SINUMERIK.
Languages which use an extended character set (e.g. Chinese, Russian, etc.) are
processed by SINUMERIK in DBCS format.
In this case, messages are displayed correctly on the PCU if the application on the
host computer transmits the messages in DBCS format.
Called function
R_MESSAGE_H( Host,
Machine,
OrderNum,
Message,
Resint1,
Resint2,
Resbyte)
Meaning
Display message on the host computer.
Data
Table 5-8 Parameters of the message to the host computer
Parameter Description Format
Host Name of the host computer 16 bytes (string)
Machine Machine name 16 bytes (string)
OrderNum Order number 4 bytes (long int)
Message Message text 128 bytes (string)
Resint1 Reserve 1 4 bytes (long int)
Resint2 Reserve 2 4 bytes (long int)
Resbyte Reserve 3 8 bytes (string)
Notes on use
The machine operator informs the host computer of the preparations carried out for
program execution.
Note
The text input is carried out via a dialog in the interactive program of RPC
SINUMERIK.
Languages
RPC SINUMERIK generally supports all languages which are covered by the ASCII
character set or for which a language package has been installed on the
SINUMERIK.
Languages which use an extended character set (e.g. Chinese, Russian, etc.) are
processed by SINUMERIK in DBCS format.
In this case, messages are displayed correctly on the host computer if the
application on the host computer displays the messages in the same font as
installed on the SINUMERIK.
Program transfer
NC programs are transferred in file format. NC programs must be stored in the NC
data management system after transfer.
Function call
T_DATA_M ( Host,
Machine,
OrderNum,
SFct,
Name1,
Name2)
Meaning
Request data as file from the SINUMERIK.
Data
Table 5-10 Parameters for data request from the SINUMERIK
Parameter Description Format
Host Name of the host computer 16 bytes (string)
Machine Machine name 16 bytes (string)
OrderNum Order number 4 bytes (long int)
SFct Subfunction number 4 bytes (long int)
Name1 For name see Table 5-9 Subfunction 128 bytes (string)
numbers:SFct
Name2 For additional name see Table 5-9: 128 bytes (string)
Subfunction numbers:SFct
Example
T_DATA_M ("FLR1", "BAZ3", 0, 1, "\mpf.dir\ Kw15.mpf", "\0");
T_DATA_M ("FLR1", "BAZ3", 0, 10, "\mpf.dir", "\0");
T_DATA_M ("FLR1", "BAZ3", 0, 20, "\0", "\0");
T_DATA_M ("FLR1", "BAZ3", 0, 21, "Drill10mm,0002", "\0");
T_DATA_M ("FLR1", "BAZ3", 0, 22, "Drill10mm,0002", "\0");
T_DATA_M ("FLR1", "BAZ3", 0, 23, "Drill10mm,0002", "\0");
T_DATA_M ("FLR1", "BAZ3", 0, 50, "\0", "\0");
T_DATA_M ("FLR1", "BAZ3", 0, 90, "f:\add_on\mcis_rpc.log", "\0");
Called function
T_DATA_H ( Host,
Machine,
OrderNum,
SFct,
Name1,
Name2)
Meaning
Request data as file from host computer.
Data
Table 5-11 Parameters for data request from the host computer
Parameter Description Format
Host Name of the host computer 16 bytes (string)
Machine Machine name 16 bytes (string)
OrderNum Order number 4 bytes (long int)
SFct Subfunction number 4 bytes (long int)
Name1 For name see Table 5-9 128 bytes
Subfunction numbers:SFct (string)
Name2 For additional name see Table 5-9 128 bytes
Subfunction numbers:SFct (string)
Function call
R_DATA_M ( Host,
Machine,
OrderNum,
SFct,
Name1,
Name2,
Date,
LastFile)
Meaning
The host computer requests RPC SINUMERIK to fetch the specified file from the
host computer and to process it (e.g. to include it in the data management system).
Data
Table 5-12 Parameters for accept request
Parameter Description Format
Host Name of the host computer 16 bytes (string)
Machine Machine name 16 bytes (string)
OrderNum Order number 4 bytes (long int)
SFct Subfunction number 4 bytes (long int)
Name1 For name see Table 5-9 128 bytes
Subfunction numbers:SFct (string)
Name2 For additional name see Table 5-9 128 bytes
Subfunction numbers:SFct (string)
Date Date of last change 4 bytes (long int)
(Unix time, only for NC program file)
LastFile Last file of a workpiece 4 bytes (long int)
Bit 7 Bit 0 Function
0 0 More files to follow
0 1 Last file of a workpiece or
single file
1 0 Reset request identifier
Notes on use
Bit 7 is only relevant if an NC program is requested from the host computer via the
RK840D user interface, but the host computer intentionally transmits an NC
program with a different name. By default, the RPC SINUMERIK internal request
identifier is only reset if SFct and Name1 are identical; the host computer can
initiate a reset of the request identifier via bit 7.
Example
R_DATA_M ("FLR1", "BAZ3", 0, 1, "\mpf.dir\ Kw15.mpf", "f:\ncpro\NCKW0815.txt",
862826400, 1);
The file is fetched synchronously from the host computer during R_DATA_M,
however processing cannot take place synchronously in the RPC. The return value
of the RPC can therefore only indicate whether or not the file transfer was
successful. After processing of the file, RPC SINUMERIK sends R_REPORT_H
with type = 5 and error number = subfunction number (SFct) from R_DATA_M as a
positive acknowledgment.
Called function
R_DATA_H ( Host,
Machine,
OrderNum,
SFct,
Name1,
Name2,
Date,
LastFile)
Meaning
The file already transferred should be saved in the data management system on
the host computer.
Data
Table 5-13 Parameters for accept request
Parameter Description Format
Host Name of the host computer 16 bytes (string)
Machine Machine name 16 bytes (string)
OrderNum Order number 4 bytes (long int)
SFct Subfunction number 4 bytes (long int)
Name1 For name see: Table 5-9 128 bytes
Subfunction numbers:SFct (string)
Name2 For additional name see: Table 5-9 128 bytes
Subfunction numbers:SFct (string)
Date Date of last change 4 bytes (long int)
(Unix time, only for NC program file)
LastFile Last file of a workpiece 4 bytes (long int)
0: More files to follow
1: Last file of a workpiece or single file
Function call
C_DELETE_M ( Host,
Machine,
OrderNum,
SFct,
Name1,
Name2)
Meaning
Delete data of previous file transfer.
Data
Table 5-14 Parameters for delete request
Note
At present, only files in the data management can be accessed,
SFct = 1
e.g.: Name1 ="\mpf.dir\cylinderhead.mpf"
Example
C_DELETE_M ( "FLR1", "BAZ3", 0, 1, "\mpf.dir\ Kw15.mpf", "\0");
5.10 NC programs
The following description of program handling is a special application of the
functions described in Section 5.7. Knowledge of these functions is assumed.
1. Function call
T_DATA_M ()
SFct = 1
Name1 = Program name in the data management, e.g.: \mpf.dir\carrier4711.mpf
Direction of transfer Host computer → SINUMERIK
Meaning
The host computer requests a specific NC program from the SINUMERIK.
2. File transfer
The file with the requested NC program is transferred.
3. Called function
R_DATA_H()
SFct = 1
Name1 = Program name in the data management system
Name2 = Name including file path on the host computer
Date = Date of last change
Direction of transfer SINUMERIK → Host computer
Meaning
The SINUMERIK requests a specific program from the host computer.
FLR PCU
Befehl
1. Called function
T_DATA_H ()
SFct = 1
Name 1 = Program name in the data management system
Direction of transfer: Host computer -> SINUMERIK
Meaning
The SINUMERIK requests a specific program from the host computer.
2. Function call
R_DATA_M ()
SFct = 1
Name1 = Program name in the data management system
Name2 = Name including file path on the host computer
Date = Date of last change
Direction of transfer: Host computer -> SINUMERIK
Meaning
The host computer prepares a specific NC program for the SINUMERIK.
3. File transfer
RPC SINUMERIK transfers the file of the requested NC program to the
SINUMERIK and to data management
FLR PCU
Befehl
Note
NC programs can only be requested and transferred individually.
The workpiece carrier designation must be completed with '\0' and must have a
maximum length of 6 bytes including '\0'.
The NC program must always include the data management path.
e.g.: NCProg = "\mpf.dir\cylinderhead.mpf"
Since data management in the SINUMERIK does not know any versions, the last
modification date and the file size can be indicated. If the NC program is included
in the data management of the SINUMERIK, but with another size or another
modification date, RPC SINUMERIK must request the file from the host computer
before the program may be activated for machining.
Function call
R_DATA_M ()
SFct = 1
Name1 = Program name in the data management system
Name2 = Name including file path on the host computer
Date = Date of last change
Direction of transfer: Host computer → SINUMERIK
Meaning
The host computer prepares a specific NC program for the SINUMERIK.
FLR PCU
Befehl
R_REPORT_H (Type=5,
Number[0]=1) (SFkt von R_DATA_M)
Called function
R_DATA_H()
SFct = 1
Name1 = Program name in the data management system
Name2 = Name including file path on the host computer
Date = Date of last change
FLR PCU
Befehl
Function call
C_DELETE_M (SFkt = 1, Name1)
Direction of transfer: Host computer → SINUMERIK
Meaning
The host computer instructs the SINUMERIK to delete the program specified by
Name1.
Data
The data to be passed are described above under C_DELETE_M(). The following
parameters must be assigned:
SFct = 1, Name1 = "\mpf.dir\zylinderkopf.mpf" or
"\spf.dir\4711.spf"
FLR PCU
Befehl
1. Function call
T_DATA_M() mit
SFct = 10
Name 1 = Path in data management (e.g. "\mpf.dir")
Direction of transfer: Host computer → SINUMERIK
Meaning
Request from the host computer to the machine to transfer the list of existing
programs.
2. File transfer
The file with NC program list is transferred to the host computer
3. Called function
R_DATA_H() with
SFct = 10
Name1 = Path in the data storage
Name2 = File name with NC program list
Direction of transfer: SINUMERIK → host computer
Meaning
Transfer from machine to the host computer: List of existing NC programs.
FLR PCU
Befehl
1. Called function
T_DATA_H ()
SFct = 10
Name1 = Path in data management (e.g. "\mpf.dir")
Direction of transfer: Host computer → SINUMERIK
Meaning
Transfer from machine to the host computer:
Transfer list of existing NC programs.
2. Function call
R_DATA_M ()
SFct = 10
Name1 = Path in data management
Name2 = File name with NC program list
FLR PCU
Befehl
T_DATA_H (SFkt = 10, Name1)
NC-Programmliste
anfordern
R_DATA_M(SFkt = 10, Name1, Name2)
Daten übernehmen
Function call
R_DATA_M() with
SFct = 10
Name1 = Path in the data management system for
Name2 = File name with NC program list
Direction of transfer: Host computer → SINUMERIK
Meaning
Transfer from host computer to machine: List of existing programs
FLR PCU
Befehl
R_REPORT_H (Type=5,
Number[0]=10) (SFkt von R_DATA_M)
Called function
R_DATA_H() with
SFct = 10
Name1 = Path in the data storage
Name2 = File name with NC program list
Direction of transfer: SINUMERIK → host computer
Meaning
Transfer from machine to the host computer: List of existing programs
FLR PCU
Befehl
The file with the NC program list includes a list of the files as well as subdirectories
included in this data management path. The contents of these subdirectories are
not listed and must be determined with a separate request, if necessary.
Structure of the file returned with R_DATA_H
\mpf.dir
Cylinderhead.MPF,FM,5320,876403708
Crankshaft.MPF,FN,8300,862826400
Rows
The first line of the file indicates the directory which has been stated for Name1
and the contents of which are listed. Each further line indicates a file or
subdirectory name with the additional information, separated by comma.
Columns
The first column indicates the NC program name or the name of the subdirectory.
The second column includes two letters.
• The first indicates whether it is a file (F) or a subdirectory (D).
• The second character indicates whether the file is in the PCU or NCK.
Examples:
"Fx" - File
"Dx" - Directory
"xM" - on PCU
"xN" - in NCK or in NCK and PCU
The fourth column indicates as a decimal number the date of the file as UNIX time
in seconds since January 1, 1970.
The time for cylinder head 876403715 means October 9, 1997 15:28:35,
for crankshaft 862826400 it means May 5, 1997 12:00:00.
FLR PCU
Befehl
FLR PCU
Befehl
FLR PCU
Befehl
FLR PCU
Befehl
FLR PCU
Befehl
FLR PCU
Befehl
FLR PCU
Befehl
The host computer can request these data with T_DATA_M(SFct = 50).
FLR PCU
Befehl
C_ORDER_M
Allgemeine Auftragsfunktion
R_REPORT_H (Type=6,
Number[0]=1) (SFkt von C_ORDER_M)
Meaning
After execution, RPC SINUMERIK transmits either R_REPORT_H with type= 6
and error number=SFct as a positive acknowledgment of C_ORDER_M or
R_REPORT_H with type= 4 and an appropriate error number as a negative
acknowledgment.
Table 5-16 Subfunction number SFct for the general order function
Note
The NCK name can only be used after the required extensions have been made
to the files NETNAMES.INI and MMC.INI.
Data
Table 5-17 Parameter mode switching
* For additional name see Table 5-23 Subfunction numbers SFct for the general
order function
Function call
C_ORDER_M () with
SFct=2
Name1 = NC program name
Name2 = NCK name (optional)
Example
C_ORDER_M ("FLR1", "BAZ3", 0, 2, "\mpf.dir\kw15.mpf", "\0", "\0", "\0",0 ,0 ,0 ,0);
C_ORDER_M ("FLR1", "BAZ3", 0, 2, "\mpf.dir\kw15.mpf", "NCU_2", "\0",
"\0",0 ,0 ,0 ,0);
Meaning
Loading of individual NC programs or workpieces from the SINUMERIK data
management into the NCK. The NCK name (Name2) must only be specified if the
NC program need to be loaded into the standard NCK.
Error code
-262: NC program cannot be loaded
Function call
C_ORDER_M () with
SFct=3
Name1 = workpiece / NC program name
Name2 = NCK name (optional)
Example
C_ORDER_M ("FLR1", "BAZ3", 0, 3, "\mpf.dir\kw15.mpf", "\0", "\0", "\0",0 ,2 ,0 ,0);
C_ORDER_M ("FLR1", "BAZ3", 0, 3, "\WKS.DIR\Zylinderkopf.wpd\Kw15.mpf",
"NCU_2", "\0", "\0",0 ,0 ,0 ,0);
Meaning
The function corresponds to SFct2. In addition, the specified program is selected.
The NCK name (Name2) must only be specified if the NC program need to be
loaded into the standard NCK.
Note
If the NC program is then to be started automatically or if the NC program is to be
displayed for the operator, this has to be implemented via the RPC SINUMERIK
service R_VAR_M.
Error code
-263: NC program cannot be loaded and selected
Function call
C_ORDER_M () with
SFct=4
Name1 = NC program name or workpiece name
Name2 = NCK name (optional)
Meaning
Unloading of NC programs or workpieces from the NCK. The NC programs are
then in the PCU data management.
The NCK name (Name2) must only be specified if it is not to be loaded into the
standard NCK.
Error code
-264: NC program cannot be unloaded
Function call
C_ORDER_M () with
SFct=5
Name1 = NC program name
Name2 = NCK name (optional)
Parameter1= 0: Execution on NCK
1: Execution from external
Parameter2= Channel number
Function call
C_ORDER_M () with
SFct=6
Name2 = NCK name (optional)
Parameter2 =Channel number
Function call
C_ORDER_M () with
SFct=200
Name2 = NCK name (optional)
Parameter1= Protection level:
0=system password
1=manufacturer password
2=service password
3=user password
Certain tasks can be performed only when a specific protection level is set. This
call allows the host computer to set a protection level temporarily, e.g. before the
data management system is accessed.
Note
This protection level is valid for the whole SINUMERIK system! The original
protection level must be set again as soon as possible to protect the system
against misuse!
Error code
-271: "Set protection level" has not worked.
Function call
C_ORDER_M () with
SFct=201
Name2 = NCK name (optional)
Function call
C_ORDER_M () with
SFct=100
Name2 = NCK name (optional)
Parameter1= UNIX time
Parameter2= 0: Date/time on SINUMERIK
1: Date/time on SINUMERIK and PLC
2: Date/time on PLC
Meaning
Request to the machine to change to a certain mode.
Data
Table 5-18 Parameter mode switching
Description
In special mode, the automatic material flow means that no workpiece carriers are
delivered to the machine; there is no program assignment by the host computer as
a result of messages indicating the arrival of a workpiece carrier. Manual transport
actions can be used to deliver workpiece carriers; the user must select and start
the NC program manually.
Workpiece carriers which were delivered by means of automatic material flow
continue to be transported automatically in special mode. Workpiece carriers which
were delivered by means of a manual transport action must be transported away
again manually.
The special mode for a machine can be activated at any time on the host computer;
a machining operation which is in progress is finished in the normal way.
As soon as the special mode is activated, the workpiece carrier to be machined
can be delivered manually; the machine does not have to cruise to a stop.
Mode = 1 Activate special mode
Mode = 2 Deactivate special mode
FLR PCU
Befehl
FLR PCU
Befehl
FLR PCU
Befehl
C_MODE_M (Mode = 3)
Nach Arbeitsende
Komponenten abschalten
R_MACHINE_H()
Maschinendaten melden
C_MODE_M (Mode = 4)
Vor Arbeitsbeginn
Komponenten einschalten
R_MACHINE_H()
Maschinendaten melden
5.16 Synchronization
Synchronization means transmitting current data to the host computer so that the
system image on the computer matches the real situation. This is necessary if the
computer or the machine is restarted, or after an interruption in the connection.
The machine must not start a new machining operation during synchronization; the
operation currently in progress is not affected by the synchronization procedure.
The host computer uses T_MACHINE_M () to request the machine status data
from the machine, and uses T_DATA_M (SFct = 50) to request the machine
assignment data; it then transfers the program assignment R_NC4WPC_M () for all
sides of those workpiece carriers which have not yet been finished.
If the host computer is responsible for tool preparation/accounting, all the tools
should be scanned after a (lengthy) interruption in the connection; this should be
performed after synchronization and ensures that the host computer has access to
the latest tool data. The tool scan does not take place automatically; it must be
requested by the host computer with T_DATA_M (SFct =20).
Function call
C_SYNCH_M ( Host,
Machine,
OrderNum,
SynchFlag)
Meaning
The host computer initiates or terminates a synchronization process.
Data
Table 5-19 Description of synchronization parameters
Notes on use
The following section explains the interaction that takes place during the
synchronization process.
Example
C_SYNCH_M ("FLR1", "BAZ3", 0, 1);
For all workpiece carriers which have not yet been finished and all their sides,
the sequence is as follows
Host computer → SINUMERIK Program assignment R_NC4WPC_M ()
FLR PCU
Befehl
C_SYNCH_M (SynchFlag = 1)
Synchronisationsbeginn
T_MACHINE_M ()
Maschinendaten anfordern
R_MACHINE_H ()
Maschinendaten melden
C_SYNCH_M (SynchFlag = 0)
Synchronisationsende
6.2 Data from an OEM application to the host computer ... FBR/NFL/6-88
6.2.1 DDE between an OEM application and
RPC SINUMERIK ......................................................... FBR/NFL/6-89
6.2.2 File transfer from OEM applications to the host
computer....................................................................... FBR/NFL/6-90
6.2.3 File transfer from the host computer to the OEM
application..................................................................... FBR/NFL/6-90
In order to send data from any OEM application on the SINUMERIK across the
computer link to the host computer and back, RPC SINUMERIK on the
SINUMERIK must be able to communicate with other applications.
Since communication between programs on the MMC takes place via dynamic
data exchange (DDE), DDE is also used for communication between the computer
link and OEM applications.
Functions are interfaces are defined for the transfer of data in both directions.
Meaning
This RPC call initiates the transfer of user data to the specified OEM application via
DDE. All the necessary parameters are passed with R_DDEDATA_M.
Since it is not possible to establish a DDE connection during the RPC, the data
transfer to the OEM application can only take place after the return of
R_DDEDATA_M.
One DDE connection is set up for each R_DDEDATA_M (). Before copying the
user data, RPC SINUMERIK inserts the host name followed by the 'pipe' symbol
('|' ASCII code 124) as sender information for the OEM application. This complete
string is transferred to the OEM application with DDE-POKE after which the DDE
connection is closed.
When the data have been transferred, RPC SINUMERIK sends R_REPORT_H
with type = 5 and error number = 1000 as a positive acknowledgment for the
sender of R_DDEDATA_M.
Note
It is permissible to transfer only ASCII data as user data, not binary data.
The string ends with binary 0.
Data
Table 6-1 Parameter description for data transfer to host computer
Parameter Description Format
Host Name of the host computer 16 bytes (string)
Machine Machine name 16 bytes (string)
OrderNum Order number 4 bytes (long int)
Application Application name 64 bytes (string)
Topic DDE Topic 64 bytes (string)
Item DDE Item 64 bytes (string)
Data DDE User data 32 KB (string)
Languages
RPC SINUMERIK generally supports all languages which are covered by the ASCII
character set or for which a language package has been installed on the
SINUMERIK.
Languages which use an extended character set (e.g. Chinese, Russian, etc.) are
processed by SINUMERIK in DBCS format.
In this case, data are displayed correctly on the PCU if the application on the host
computer transmits the data in DBCS format.
Called function
R_DDEDATA_H( Host,
Machine,
OrderNum,
Data)
Meaning
This RPC is sent to the host computer if the computer link has received a specific
DDE call. The associated scope of functions and parameters are described below.
Data
Table 6-2 Parameter description for data transfer to host computer
Parameter Description Format
Host Name of the host computer 16 bytes (string)
Machine Machine name 16 bytes (string)
OrderNum Order number 4 bytes (long int)
Data DDE User data 32 KB (string)
Languages
RPC SINUMERIK generally supports all languages which are covered by the ASCII
character set or for which a language package has been installed on the
SINUMERIK.
Languages which use an extended character set (e.g. Chinese, Russian, etc.) are
processed by SINUMERIK in DBCS format.
In this case, messages are displayed correctly on the PCU if the application on the
host computer transmits the messages in DBCS format.
Application = Sincom*,
Topic = OEM,
Item = SendData.
Note
For compatibility reasons the application name is still Sincom.
The data string transferred with the DDE call must contain the host names to which
the data are to be passed in front of the actual user data. The 'pipe' symbol
('|' ASCII code 124) should be used as the separator (host name|user data).
When the data have been received with the above R_DDEDATA_H () call, the user
data string is passed on to the specified host. The host name must be known to the
computer link (see Chapter 5).
6.2.3 File transfer from the host computer to the OEM application
R_DATA_M (SFct = 90) is used to transfer the file from the host computer to the
SINUMERIK. If SFct 90, the file is merely fetched onto the SINUMERIK; no further
processing takes place. A message informing the OEM application about the file
received can be transmitted from the host computer with R_DDEDATA_M ().
File transfer for OEM applications only has to be handled by the computer link
software if the transfer is to take place using FTP.
If the SINUMERIK can access the drives of the host computer directly across the
network, the OEM applications can fetch files from the host computer and copy
files to the host computer themselves.
7.1 Description
With the variable services RPC SINUMERIK can read and write any project-
specific data from the PLC and NCK. This function is implemented based on the
variable service of the OEM package PCU using the NC-DDE server.
The host computer can request data with T_VAR_M () that are then obtained by
RPC SINUMERIK and passed to the host computer with R_VAR_H (). The host
computer can also pass on data with R_VAR_M () that are then written by RPC
SINUMERIK.
In the Ini file SCVARSET.INI in the ADD_ON directory, you can define variable sets
that can be used for read and write processes. If the mode is configured correctly,
changes in these variables are automatically signaled to the host computer by RPC
SINUMERIK with R_VAR_H ().
For the SCVARSET.INI, the following definitions apply:
No more than 10 sets can be defined
No more than 10 variables can be defined in a set
No more than 50 variables can be defined within all sets
No more than 10 hotlinks can be defined within all sets
As long as these limits are observed, combinations can be made as required.
RPC SINUMERIK contains the optional extension allowing the required NCU to be
parameterized in the variable set if more than one NCU is connected to a
SINUMERIK. However, that only applies to variable sets that are defined in the
SCVARSET.INI, not if the data description is stated directly in parameter VarDescr
for T_VAR_M () or R_VAR_M ()!
Access modes
0 No hotlink is set up, the variables of the set are only read at the request
of the host computer (T_VAR_M).
1* A hotlink is set up for each variable in the set,
2* A hotlink is set up for the first variable in the set only
3* With handshake. As with 2 a hotlink is set up for the first variable in the
set. After a hotlink, once all variables have been read, the first variable
is reset to 0 (handshake). Variable 1 must not define a field, only a
single variable. Once the variable has been reset to 0, a time delay is
required before it can be set again. If the variable is set again too soon,
the change in state might not be detected.
* In the case of a hotlink, all variables of the corresponding variable set are read
and transmitted to the host computer with R_VAR_H.
[Set02]
Mode=3
Host=FLR2
Var01=/Plc/Datablock/Byte[c50,1]
Var02=/Plc/Datablock/Byte[c50,2]
Var03=/Plc/Datablock/Byte[c50,3,20]("!l%d,")
Var04=/Plc/Datablock/Byte[c50,4]
Var05=/Plc/Datablock/Byte[c50,5,20]("!l%d,")
Var06=/Plc/Datablock/Byte[c50,6]
Var07=/Plc/Datablock/Byte[c50,7,20]("!l%d,")
Var08=/Plc/Datablock/Byte[c50,8]
Var09=/Plc/Datablock/Byte[c50,9,20]("!l%d,")
Var10=/Plc/Datablock/Byte[c50,10]
[Set03]
Mode=0
Var01=/Plc/Datablock/Byte[c51,0,10]("!l%d,")
Var02=/Plc/Datablock/Byte[c51,30,50]("!l%d,")
Note
The SINUMERIK software contains a test tool with the name DDETEST. EXE.
With it, you can test variable access with the running NCDDE server. You must
first test all the variables that you want to use in the SCVARSET.INI by this
method.
The appendix includes a chapter of the OEM description that contains a
description of the interface between PCU50 and NCK/PLC.
The SCTEST setup contains the help file Btss_gr.hlp (and Btss_uk.hlp for
English). These help files contain all information for variable access.
Access to data via $ variables, e.g. $TC_TP1 ( T number ) is not implemented
with this service.
Function call
R_VAR_M ( Host,
Machine,
OrderNum,
VarMode
VarSet
VarDescr
VarData)
Meaning
Transfer data from the host computer to RPC SINUMERIK; the data are then
written to the PLC or NCK.
M call R_VAR_M can specify either the name of a variable set from
SCVARSET.INI with VarSet or the variable descriptions with VarDescr.
When the data have been transferred, RPC SINUMERIK sends R_REPORT_H
with type=5 and error number = 0 as a positive acknowledgment for the sender of
R_VAR_M.
Data
Table 7-1 Variable data transfer to the machine
Parameter Description Format
Host Name of the host computer 16 bytes (string)
Machine Machine name 16 bytes (string)
OrderNum Order number 4 bytes (long int)
VarMode Variable mode 4 bytes (long int)
VarSet Name of the variable set 16 bytes (string)
VarDescr * Data description 1024 bytes (string)
VarData * User data 10 KB (string)
The variables in both the data description and the user data must be separated by
the 'pipe' symbol ('|' ASCII code 124).
Example 1
SET03 is defined in SCVARSET.INI:
[Set03]
Mode=1
Host=FLR2
Var01=/Plc/Datablock/Byte[c51,0,10]("!l%d,")
Var01=/Plc/Datablock/Byte[c51,30,50]("!l%d,")
R_VAR_M ("FLR1", "BAZ3", 0, 0, "Set03", "\0", "33|50");
Example 2
Called function
R_VAR_H ( Host,
Machine,
OrderNum,
VarMode
VarSet
VarDescr
VarData)
Meaning
RPC SINUMERIK transfers data read from the PLC or NCK to the host computer.
Data
Table 7-2 Variable data transfer to the host computer
Parameter Description Format
Host Name of the host computer 16 bytes (string)
Machine Machine name 16 bytes (string)
OrderNum Order number 4 bytes (long int)
VarMode Variable mode 4 bytes (long int)
VarSet Name of the variable set 16 bytes (string)
VarDescr * Data description 1024 bytes (string)
VarData * User data 10 KB (string)
*The variables in both the data description and the user data must be separated by
the ‘pipe’ symbol (‘|’ ASCII code 124).
Variable sets which are defined in SCVARSET.INI are reported.
Example:
R_VAR_H ("FLR1", "BAZ3", 0, 0, "Set02", "\0", "33|50");
Function call
T_VAR_M ( Host,
Machine,
OrderNum,
VarMode
VarSet
VarDescr)
Meaning
The host computer requests RPC SINUMERIK to read data from the PLC or NCK.
The data are then returned with R_VAR_H (). VarSet can only specify a variable
set defined in SCVARSET.INI. VarDescr is not evaluated.
Data
Table 7-3 Request variable data from the machine
Parameter Description Format
Host Name of the host computer 16 bytes (string)
Machine Machine name 16 bytes (string)
OrderNum Order number 4 bytes (long int)
VarMode Variable mode 4 bytes (long int)
VarSet Name of the variable set 16 bytes (string)
VarDescr * Data description 1024 bytes (string)
*The variables in both the data description and the user data must be separated by
the 'pipe' symbol ('|' ASCII code 124).
Example
T_VAR_M ("FLR1", "BAZ3", 0, 0, "Set02", "\0", "\0");
Called function
T_VAR_H ( Host,
Machine,
OrderNum,
VarMode
VarSet
VarDescr
VarData)
Meaning
RPC SINUMERIK requests data from the host computer. The data are then
returned to RPC SINUMERIK with R_VAR_M ().
Note
This RPC is not currently used by RPC SINUMERIK .
For notes
Meaning
Transmit TPS status data to the host computer.
Data
Table 8-1 Parameters of transport system status data
Parameter Description Format
Host Name of the host computer 16 bytes (string)
Machine TPS name 16 bytes (string)
OrderNum Order number 4 bytes (long int)
Mode Mode 4 bytes (long int)
SINUMERIK mode:
1: Automatic
2: MDA
4: JOG
Computer communication mode:
100: Host computer mode
300: Manual mode
1000: If bit 6=1 in RPC SINUMERIK mode
2000: If bit 7=1 in RPC SINUMERIK mode
MachineStatus Machine status 4 bytes (long int)
0: Cold restart
1: Inactive
2: Active
3: faulty
4: End of work (drives deactivated)
TpOStatus Transport job status 4 bytes (long int)
0: No transport job data
1: New transport job (not started)
2: In progress
4: WPC is on the vehicle
8: Job complete
16: Error, job not executable
32: Error, alternative destination
approached (DockPos)
DockPos[2] Docking position no. 4 bytes (long int)
The docking position no. corresponds to the
index in the docking position list of the
interface DB beginning at the 1st docking
position no. = 0 means: "not assigned".
DockPosStatus[ Docking position status 4 bytes (long int)
2] 0: Enabled
1: Disabled for transport control
system
2: faulty
WPC[2] Workpiece carrier name 6 bytes (string)*
Resint1 ** Reserve 1 4 bytes (long int)
Resint2 ** Reserve 2 4 bytes (long int)
Resbyte Reserve 3 8 bytes (string)
* WPC is defined as a 2-dimensional character array (char [2][6]), however each of the 2
workpiece carrier names must be specified as a string terminated by ‘\0’.
** Resint1 and Resint2 appear at the DB interface of the PLC. If values are entered there by the
PLC they are transferred to the host computer. These values have no impact on the computer
link. They are merely passed on to the host computer.
Notes on use
The TPS sets this RPC on every status change, mode selection, and at the
beginning and end of transport operations.
When RPC SINUMERIK is started on the SINUMERIK, this RPC is sent as a
startup message to each configured host computer.
Notes on use
The host computer can use this call to request TPS status data, e.g. during
synchronization. The TPS then returns the data with R_TPS_H().
Example
T_TPS_M ("FLR1", "BAZ3", 0);
Example
C_TPORDER_M ("FLR1", "BAZ3", 0, 3, 4, "WPC05", 0, 0, 0, 1, 0, 0, "\0");
Source and destination docking position
The source and destination docking positions include the index for the
corresponding docking position data record in the docking position list of the
interface DB; the index begins with 1.
Workpiece carrier
The name of the workpiece carrier can be used by the transport system for
plausibility checks.
The workpiece carrier type is an additional information for the transport system
which can contain the type or the size of a workpiece carrier.
With the parameter BufferFlag = 1, the host computer can inform the transport
system if a workpiece carrier shall be transported to a machine only for buffering
but shall not be machined there (auxiliary buffer location). If necessary,
the transport control system (TPS) must pass this information to the machine.
For all other transports, BufferFlag = 0 must be set.
Transport priority
The transport priority is an additional information, if several jobs may be transferred
to the transport system. The priority can be used to control the order in which they
are processed.
Job chaining
Job chaining is an additional information. In transport vehicles with two storage
locations and machines with only one docking position, two transport jobs can be
associated logically by means of a chain number.
For example, the first transport job includes the delivery of an unworked workpiece
carrier to a machine. A finished workpiece carrier is still placed on the machine, the
second transport job with the same job chaining number as the first one includes
the collection of the worked workpiece carrier from the machine to a buffer or
clamping location. In this case, the new pallet is fetched and moved to the machine
where the worked workpiece carrier is stored on the free location of the carriage.
Only then is it possible to complete the first job by restoring the unworked
workpiece carrier on the machine. Afterwards, it is possible to move to the
destination of transport two and to complete also this job.
Transport carriage
The transport carriage is a supplementary unit of information. In transport systems
with several transport vehicles, this parameter can be set by the host computer to
define which vehicle is to be used for transport.
FLR
Befehl
C_TPORDER_M ()
Transportauftrag
R_TPS_H()(optional)
Der WST wird abgeholt
R_TPS_H()
Transportauftrag
wurde ausgeführt
If a transport job is operational during synchronization, the end of this job may be
reported only after synchronization.
FLR
Befehl
C_SYNCH_M (SynchFlag = 1)
Synchronisationsbeginn
T_TPS_M () Transportsystemdaten
anfordern
R_TPS_H ()
Transportsystemdaten
melden
C_SYNCH_M (SynchFlag = 0)
Synchronisationsende
For notes
Note
Not all subfunction numbers (SFct) are possible in both directions.
Table 9-4 Subfunction number SFct for the general order function
Subfnc. no. Function Comments
(SFct)
2 Loading of NC programs Name1 = NC program name
Name2 = NCK name (optional)
Parameter1= Function (0,2,3)
3 Loading and selection of NC Name1 = NC program name
programs Name2 = NCK name (optional)
Parameter1= Function (0-3)
Parameter2= Channel number
4 Unloading of NC programs Name1 = NC program
Name2 = NCK name
5 Selection of NC programs Name1 = NC program name
Name2 = NCK name (optional)
Parameter1= Function (0,1)
Parameter2= Channel number
6 Selection of NC programs Name2 = NCK name (optional)
Parameter2= Channel number
100 Setting date/time on the Name2 = NCK name (optional)
SINUMERIK/PLC Parameter1 UNIX time
Parameter2= Date/time
SINUMERIK / PLC
10 RPC SINUMERIK-OCX
10
10.1 Introduction ................................................................ FBR/NFL/10-118
10.1 Introduction
What is RPC SINUMERIK-OCX?
The RPC SINUMERIK-OCX development package is an add-on product for the
RPC SINUMERIK computer link.
The RPC SINUMERIK computer link provides an interface for communication
between a SINUMERIK 840D machine control and a higher-level host computer.
Communication between the host computer and the machine control is performed
in this arrangement via RPCs (Remote Procedure Call). Because the RPCs are a
platform-independent standard, the RPC SINUMERIK interface can be used both
by MS Windows and by UNIX, LINUX and other systems.
Application range
However, use of the RPCs is usually only possible from the C/C++ programming
language.
Using the RPC SINUMERIK-OCX, the RPC SINUMERIK interface is accessible to
a whole range of common Windows development systems without the need to
program in C/C++. All development systems are supported that are capable of
linking 32-bit ActiveX components. This includes: MS Visual Basic V4.0 or later
(32Bit), MS Visual J++ 6.0, Internet Explorer V4.0 or later, WinDev and many other
development systems.
Method of operation
The RPC SINUMERIK-OCX encapsulates the RPC interface from RPC
SINUMERIK in COM calls (Component Object Model). The mode of operation of
the individual RPCs is not affected by the use of RPC SINUMERIK-OCX.
The mode of operation of the RPCs is described in the RPC SINUMERIK
documentation.
Operating systems
The RPC SINUMERIK-OCX can be used on WIN 9x/NT/2000/XP/2003 computers
with a TCP/IP network installed. One or more SINUMERIK 840D controls with RPC
SINUMERIK are required as communication partners.
Languages
RPC SINUMERIK generally supports all languages which are covered by the ASCII
character set or for which a language package has been installed on the
SINUMERIK. Languages which use an extended character set (e.g. Chinese,
Russian, etc.) are processed by SINUMERIK in DBCS format. In this case,
data are displayed correctly on the PCU if the application on the host computer
transmits the data in DBCS format.
During installation, you are asked to enter the target directory and the name of the
program folder in the start menu.
In addition, the Microsoft Visual Basic 6.0 (SP3) runtime system is installed in the
<Windows>\System directory, if it is not already present.
This is how to reach the installed files via the start menu:
10.3.1 Installation
With installation of the RPC SINUMERIK-OCX development package, file
RpcSinumerik.OCX is stored in the <Windows>\System directory and registered in
the Windows© registry.
Further computers
If you wish to use the RPC SINUMERIK-OCX component on other computers too,
it must be installed on them as well. This can be done with the installation
programs (such as: InstallShield) or by the following manual steps.
A TCP/IP link with the RPC SINUMERIK control must also exist.
0 - Min TimeOut
5 - Default TimeOut
9 - Max. TimeOut
The attributes HostID, HostPort, and HostEnabled apply to all instances of the RPC
SINUMERIK-OCX within an application (EXE). Any change made in one instance
is also made in all instances.
In all these methods, the first two parameters ( host and machine ) are not required.
These parameters are derived from the attributes: HostID and MachineID of the
instance in question.
Note
Empty strings must be represented in different ways for different programming
languages.
• Basic: ""
• C: "\0"
The RPCs from the RPC SINUMERIK are passed to the application as events of
the instance of the RPC SINUMERIK-OCX component.
Because some development systems (e.g.: Visual Basic) do not permit the "_"
character in the names of events, the "_" characters in the name of the RPC have
been replaced by "x".
These errors occur if an RPC cannot be sent to RPC SINUMERIK or the RPC
server cannot be activated by the RPC SINUMERIK-OCX. The error numbers in
this category are in the range 1700 to 1938 (RPC status codes).
You will find a description of the errors from this group occurring in practice in the
table below: "Typical error situations". The complete description is to be found in
the Microsoft Documentation.
http://msdn.microsoft.com/library/
under
Platform SDK -> Networking and Directory services -> Remote Procedure Calls
(RPC)
Wrong value for the attribute: HostPort 0, but no response from RPC SINUMERIK
At the same time, an entry is generated in the
MCIS_RPCERR.LOG in the control
Readiness of the RPC SINUMERIK-OCX 1720 (RPC_S_CANT_CREATE_ENDPOINT)
component to receive cannot be activated.
This error usually occurs if another application
on the same computer is already using the port
defined with attribute HostPort. e.g.: an attempt
is made to start an application that is using the
RPC SINUMERIK-OCX and, at the same time,
the RPC SINUMERIK Test application is being
executed – with the same HostPort value.
Interruption of the TCP/IP link 1722 or 1726 (after approx. 20 sec.)
After you have restored the link, the RPC calls return
0 again.
The application was written in Visual Basic 6.0. The source code for the application
is provided in the directory Siemens\MCIS\RPC SINUMERIK\ RPC SINUMERIK
Test (see also Section: 10.4.4 Source code for the RPC SINUMERIK Test
application)
Before you can use RPC SINUMERIK Test, the following conditions must be
fulfilled:
Languages
RPC SINUMERIK generally supports all languages which are covered by the ASCII
character set or for which a language package has been installed on the
SINUMERIK. Languages which use an extended character set (e.g. Chinese,
Russian, etc.) are processed by SINUMERIK in DBCS format. In this case, data
are displayed correctly on the PCU if the application on the host computer
transmits the data in DBCS format.
10.4.1 Configuration
Here is an example of the configuration in the following network architecture
The following entries result from the network architecture shown in the
configuration screen forms for RPC SINUMERIK Test. The configuration screen
forms can be opened from the Settings menu.
The link with the controls is established with the application scconfig.
For the network architecture shown, the following entries must be made.
For a more detailed description of scconfig, please refer to the sections above.
Machine 1
Machine 2
On tab card "Trace“ you can select which RPCs are to be traced. The traces are
output on the screen and logged in logfile RpcSinumerikTest.LOG, whose
maximum size you can define here.
The input fields have the same names as the corresponding RPC parameters in
the RPC SINUMERIK documentation. The meanings of these parameters are
given in this documentation. With parameter Machine, you can define to which
control the RPC is to be sent. This input field is implemented as a selection field.
It suggests the communication partners defined in the configuration.
All parameters that can have predefined values in the RPC SINUMERIK
documentation (e.g. SFct) are implemented as radio buttons.
For all other input fields you can select a previously used value with the button
"...".
With the "OK" button you can send the RPC. All RPCs sent are traced. The traces
are output to the screen in the main window of the RPC SINUMERIK Test
application and to the logfile: RpcSinumerikTest.LOG. For every RPC sent, the
return value is also logged and displayed in the status line (Ret=0). The meaning of
the return value is described in Section: "10.3.6 Error handling".
To test the basic link with RPC SINUMERIK, you can send the RPC
T_MACHINE_M. RPC SINUMERIK responds with the RPC R_MACHINE_H.
All RPCs received are traced. The traces are output to the screen in the main
window of the RPC SINUMERIK Test application and to the logfile:
RpcSinumerikTest.LOG. An interactive form containing all parameters of the RPC
is also displayed for each RPC.
The output fields have the same names as the corresponding RPC parameters in
the RPC SINUMERIK documentation. The meanings of these parameters are
given in this documentation.
It is possible to activate or deactivate display of the interactive forms for the RPCs
received with the radio button: "Popup on RPC" in the relevant form or in the
configuration (tab card: Popup on RPC).
Note
The string delimiter '\0' in the examples of the interface to the host computer
(chapter 5) is only necessary in applications created with C++.
All the steps are described that are necessary inside the Visual Basic development
environment to create the application.
After that, the icon of the RPC SINUMERIK-OCX appears in the toolbox window
(yellow machine)
You can now drag and drop the RPC SINUMERIK-OCX into a form.
The component is visible in the development environment. But it is no longer visible
during the runtime of a complete application.
In the properties window, you can now store attributes. The IP address of the
machine controller must be used in accordance with your network configuration.
When you change the attribute: MachineID, the display of the OCX in the form also
changes. Sending of the RPC T_MACHINE_M is triggered by clicking on the
"DoRPC" button. The RPC SINUMERIK application responds with the RPC
R_MACHINE_H. The response to this in the example application is a message box.
To activate the variable service of RPC SINUMERIK , at least one variable set
must be defined in the file c:\add_on\scvarset.ini on the controller. Changes in this
file only become effective after the next cold restart of the controller. If this is not
the case, RPC SINUMERIK responds with the RPC: R_REPRT_H() and
the error: -800.
Flowchart for
reading R parameters
The VisualBasic application requests the value of an R parameter with the RPC:
T_VAR_M().
RPC SINUMERIK supplies the current value of the R parameter with the RPC:
R_VAR_H().
Flowchart for
writing R parameters
The VisualBasic application passes the data for an R parameter with the RPC:
R_VAR_M() to RPC SINUMERIK. RPC SINUMERIK acknowledges the write
operation with the RPC: R_REPORT_H().
Visual Basic
source code
Integration of the RPC SINUMERIK-OCX is performed as already described in
section "10.5.1 Example 1 - Querying the machine state (Visual Basic) Integrating
the RPC SINUMERIK-OCX component in Visual Basic 6.0".
In input field: R parameter the number of the R parameter to be read and written is
entered. In input field: R value the current value of the R parameter is displayed on
reading or the new value entered for writing.
You send the RPCs T_VAR_M() and R_VAR_M() by clicking on the appropriate
buttons.
Date: \Examples\Example2\Example2.frm
Option Explicit
Option Explicit
Private Sub cmdR_VAR_M_Click()
'write R parameter
RParam = Val(txtRParam.Text)
RItem = "/Channel/Parameter/R[" & RParam & "]"
RValue = txtRValue.Text
End Sub
txtRValue.Text = VarData
End Sub
End Sub
In this example, a variable set with the name "Set01" consisting of R parameters
R1 and R5 is used.
The variable set is defined in file: c:\add_on\scvarset.ini on the control.
[Set01]
Mode=0
Host=FLR1
Var01=/Channel/Parameter/R[1]
Var02=/Channel/Parameter/R[5]
When the HTML page is loaded, the RPC T_VAR_M() is sent to RPC SINUMERIK
via a VBScript function. With this RPC, the current values of the variables in the set:
"Set01" are requested. This data is immediately supplied by RPC SINUMERIK
with the RPC: R_VAR_H().
RPC SINUMERIK signals any change to the variables from the set (R1 or R5) with
the RPC: R_VAR_H().
File: Examples\Example3\Example3.html
<HTML>
<HEAD>
<TITLE>MCIS_RPC.OCX Example 3</TITLE>
</HEAD>
<BODY>
<TR>
<TD> R1 = </TD> <TD><LABEL id=R1Param></LABEL> </TD>
</TR>
<TR>
<TD> R5 = </TD> <TD><LABEL id=R5Param></LABEL> </TD>
</TR>
</TABLE>
</BODY>
<SCRIPT LANGUAGE="VBScript">
Option Explicit
Sub Window_OnLoad
dim ret
End Sub
dim pos
if pos = 0 then
R1Param.innerText = VarData
else
R1Param.innerText = Left(VarData, pos-1)
R5Param.innerText = Mid (VarData, pos+1)
end if
End Sub
End Sub
</SCRIPT>
</HTML>
You send the RPCs T_VAR_M() and R_VAR_M() by clicking on the appropriate
buttons.
File: Examples\Example4\Form1.java
long ret;
String[] VarDescr = new String[1]; // item for access
String[] VarSet = new String[1];
VarSet[0] = "";
VarDescr[0] = "/Channel/Parameter/R[" + txtRParam.getText() + "]";
ret = machine1.T_VAR_M(0,0,VarSet,VarDescr );
if ( ret != 0 ) MessageBox.show("T_VAR_M() -> " + ret);
}
long ret;
String[] VarDescr = new String[1]; // item for access
String[] VarSet = new String[1];
String[] VarData = new String[1];
VarSet[0] = "";
VarDescr[0] = "/Channel/Parameter/R[" + txtRParam.getText() + "]";
VarData [0] = txtRValue.getText();
txtRValue.setText( e.VarData );
}
if ( ErrorNr != 0 )
{
MessageBox.show( "On RPC R_REPORT_H ( ... Number(0)->" + ErrorNr + " )" );
}
}
I Index
I
I.1 Keyword index
A I
E N
G Position Data.........................FBR/NPL/A-15
R S
WIN 9x/NT/2000/XP..........FBR/NFL/10-119
WinDev .............................FBR/NFL/10-118
SINUMERIK 840D/840Di/810D
RPC SINUMERIK Computer link
2.2 Production dialog between PLC/NCK and RPC SINUMERIK ..................................... FBR/NPL/2-19
4.6 Manual transport operations by the user at PLC level ................................................ FBR/NPL/4-49
5 Configuration Data........................................................................................................FBR/NPL/5-51
1.1 Description
Description of the interface between the computer communication software
(RPC SINUMERIK) and the machine PLC.
Fertigungsleitrechner
Windows-PCU Bedientafel
RPC
TDI
SINUMERIK
Transport-
Maschine
system
Note
References to Part 1 "Host Computer Interface" in the following sections are
specified using the following notation: (See /NFL/ <section no.> section title),
e.g. (See /NFL/Section 5.8: Accepting Transferred Data)
Machine
Global data
Transport system
Global data
Note
The individual entries of the data block are explained in the following table
sequence.
The PLC indicates changes in the interface with this byte. After it has enabled the
request byte, the PLC must enable the next bit in the trigger byte (see below).
The PLC can only write to the request byte again when it has been set to 0 by RPC
SINUMERIK after processing.
Report tool
Report tool is set by the PLC whenever a tool is to be reported to the host
computer (e.g. tool breakage). The data elements identify the tool which is to be
reported:
"Magazine number" and
"Location number or T number".
Status change
The PLC sets Status change for each status change (machine mode, RPC mode,
machine status, NC mode) that must be reported to the host computer.
RPC SINUMERIK must then send R_MACHINE_H() to the host computer
(e.g. workpiece carrier arrival, NC start, NC end, mode changes, etc.).
Change trigger
The computer link sets up a DDE hotlink to this byte.
The PLC sets a bit in this byte when changes take place on the PLC. For each new
trigger, the PLC must set the next bit and reset the last; after bit 7 it begins again
with bit 0.
Synchronization flag
The synchronization flag is set and reset by the host computer.
(See /NFL/Subsection 5.16.1: Synchronization Start/End C_SYNCH_M ()).
The machine status must remain unchanged for the duration of the synchronization
process. The PLC must not start a new machining operation or execute any pallet
movements.
Deactivate components
Deactivate components is set by the host computer (See /NFL/Section 5.15:
Mode Switching C_MODE_M ()). This requests the PLC to deactivate components
(drives) (see also machine modes, components deactivated).
Activate components
Activate components is set by the host computer (See /NFL/Section: 5.15 Mode
Switching C_MODE_M ()). This requests the PLC to activate components (drives)
(see also machine modes, components activated).
Machine mode
Table 1-4 Machine mode
Bit No. Function Access from
1 Units deactivated (end of the working day) PLC
2 Write access to docking position data allowed PLC
Components deactivated
Components deactivated is set by the PLC when this status is detected.
The request is set in bit 1 of the request flags.
Manual mode
In manual mode there is no automatic NC start, but material flow on the machine
is still automatic.
Special mode
In special mode there is neither an automatic NC start nor automatic material flow.
Offline
Offline means that there is no connection to the host computer, and no data are
sent to the host computer. Offline is canceled when RPC SINUMERIK detects the
reestablishment of the connection as a result of the arrival of an RPC from the host
computer.
and to transfer the tool data to the host computer. RPC SINUMERIK must
subsequently clear these data elements (by filling them with zeros).
Note
Tool messages which occur during tool loading and tool unloading are not
initiated by the PLC user program (for more information, please see /NFL/).
Number of program
assignments
The number of program assignments on the machine is stored statically during
commissioning of the machine. The number matches the number of NC program
assignment blocks in the interface (see Section 1.4: NC Program Assignment).
Machine status
Table 1-6 Machine status
Bit No. Function Access from
0 Machine is activated PLC
1 Machine fault detected PLC
2 Restart machine PLC
NC mode
Table 1-7 NC mode
Bit No. Function Access from
0 Automatic PLC
1 MDA PLC
2 JOG PLC
3 TEACH IN PLC
The machine status and the NC operating mode are signaled to the host computer
with R_MACHINE_H. They are not evaluated in the computer link server, however.
Reserve 1 and 2
These variables can be used as required by the machine manufacturer using the
PLC. The values are reported to the host computer by R_MACHINE_H (), although
these values are not usually processed by the host computer.
New arrival
The PLC allocates the status new arrival to a newly arrived workpiece carrier.
(Exception: Machining not required). This status causes the host computer to
perform the program assignment. When the program assignment is complete, the
"machining required" status is set by the computer link server.
Machining required
The PLC sets the prepare program selection status for workpiece carriers with
the status machining required as soon as the currently active machining
operation is complete.
Program selection
When the program selection is complete, i.e. when the program assigned to the
pallet by the host computer has been loaded in the NCK and selected for
execution, the computer link server enables the program selection complete
status for the associated workpiece carrier. The PLC can now trigger the NC Start.
It is however, the responsibility of the machine manufacturer to ensure that an NC
Start is not triggered by the PLC until all safety criteria have been met (e.g. safety
door shut, etc.).
Machining in progress
The PLC sets the machining in progress status when machining has started.
When the machining operation is complete, the PLC sets the machining finished
status for the corresponding workpiece carrier. Workpiece carriers with the status
machining finished are transported independently by the PLC to an unloading
station.
Machining finished
If the follow-up machining flag is set, the workpiece carrier remains at the
machining station. The computer link server sets the machining required status
again in response to the machining finished status. In response to this action, the
PLC uses the prepare program selection status to request the computer link
server to select a program for follow-up machining. The subsequent procedure is
the same as for the initial machining operation.
Machining aborted
The machining aborted status is set if a workpiece carrier is no longer processed
after a fault. This flag occurs chiefly during unmanned production. A workpiece
carrier with this flag may not be used for a further operation on another machine,
and may only be transported to a storage location.
Workpiece carrier
Name of the workpiece carrier currently located at the docking position
(e.g. "WST01"). This information is entered by the PLC. This assumes that the
information can be transferred from the transport system or directly from the
workpiece carrier. If no workpiece carrier is at the docking position, the array must
be filled with binary 0s.
The identifier must be terminated with '\0' after the last character because RPC
SINUMERIK expects a string. This means only identifiers up to 5 bytes long are
permissible.
Follow-up machining
This flag is enabled by the computer link server at the same time as the machining
status program selection complete is set. It informs the PLC whether a follow-up
machining operation is pending after the current operation. The PLC uses this
information in order to control transport of the workpiece carrier within the machine.
Machining side
This information is enabled by the computer link server at the same time as the
machining status program selection complete is set. The PLC uses this value to
set the side of a clamp cube for machining, or passes the value on to the NCK.
With cubes, the computer link defines the order of machining for the sides with
reference to the program assignment. If it is necessary to modify the machining
order from the PLC, the program assignment data can be mirrored in a separate
PLC data block by means of an entry in the configuration file of the computer link
server. This gives the PLC read access to the data. The machining side selected
by the PLC is reported to the computer link server in the machining side field.
This occurs at the same time as the machining status program selection
complete is set. The computer link server executes the program selection for the
side specified by the PLC. The remaining procedure is the same.
NC program flag
The NC program flag is used to indicate whether the same NC program is used on
several sides of a clamp cube. On entry by RPC SINUMERIK, "NCProgramMark" =
1 is set for the first side of a workpiece carrier. If the next side uses a different NC
program, "NCProgramMark" = 2 is set, etc. If the third side now has the same NC
program as side 1, the same "NCProgramMark" as side 1 is assigned. This makes
it possible to control the order of execution such that sides using the same NC
program are machined consecutively.
Clamp cube sides which are machined using the same NC programs are assigned
the same NC program flag.
Machining status
• Bit 1 = Machining is planned
• Bit 4 = Machining in progress
• Bit 5 = Machining finished
List size
The size of the list for NC program assignment is configurable and determines the
length required in the DB. It is calculated from the number of docking positions on
the machine times the maximum number of usable sides of a clamp cube.
Description
PCU Maschine
FLR
(PLC)
RPC DB-Nahtstelle
Der neu angelieferte Werkstückträger wird in der Haltestellen-
liste eingetragen mit dem Status: Neu Angelegt. Diese Än-
derung wird dem RK-Server mit der Kennung
R_Machine_H () Zustandsänderung gemeldet. Werkstückträger
Maschinenzustandsdaten neu angeliefert
For notes
General information
The interactive program in RPC SINUMERIK is available as a standalone area
application in the HMI Advanced user tree.
Languages
RPC SINUMERIK generally supports all languages which are covered by the ASCII
character set or for which a language package has been installed on the
SINUMERIK. Languages which use an extended character set (e.g. Chinese,
Russian, etc.) are processed by SINUMERIK in DBCS format. In this case,
data are displayed correctly on the PCU if the application on the host computer
transmits the data in DBCS format.
Fig. 3-1 The screen allows you to change the host computer mode
The operator can transfer files from the data management tree for the HMI
Advanced to the host computer with the "Transfer to host computer" softkey or to
the HMI Advanced with the "Request from host computer" softkey.
The screen allows the operator to enter the name of the NC program to be
requested from the host computer.
A text consisting of a maximum of 128 characters can be entered in the text box.
The following vertical softkeys are provided or are displayed when required.
• Acknowledge host message
• Select host
• Deleting text
• Send
Acknowledge
host message
If a message has been sent by the host to the MMC103/PCU50, it is entered with
the transferred message text as alarm 65535. The pending alarm can be deleted
with the "Acknowledge host message" softkey.
Select host
This button is only unhidden if more than one host has been configured. A list box
will appear from which the host to which the message is to be sent can be selected.
Note
Default host is the first host configured.
Deleting text
This softkey is used to delete the text you have entered.
Send
Pressing this softkey sends the entered text to the host.
MCIS TDI
This button is only visible if MCIS TDI tool handling (tool data information) is
installed on the HMI Advanced.
General information
The MCIS TDI tool handling module allows simulation of all tool handling
operations within a plant, carrying out of all loading/unloading and conversion
processes on the CNC machine or a tool store, and importing of tool data from a
host computer, for example. Any of the containers within a plant can be involved in
these processes. The TDI tool handling module can run in a network with
TDI Cell/Plant (optional) or on a single-user station (e.g. for importing tool data
from a host computer).
Note
MCIS TDI is not supplied as standard with RPC SINUMERIK and must be
ordered separately.
Tool handling/selection
The tools to be moved can be selected via the entry screen for tool handling.
The tool handling/selection screen form is divided into two parts. The top half
displays an Explorer view of all the tool magazines positioned above the local
component (operating / installation location) within the plant hierarchy.
In the bottom half the local plant component is displayed.
Note
Lower half of screen:
In the CNC version the view always shows the local component (unit).
In the PC version the view shows the entire plant, as set up in the configuration.
Depending on the movement operation (loading or unloading), both the top and the
bottom display can be the source or target of the movement.
Specific tools can be selected in the table (by placing check marks in the selection
box) for this movement.
Tools selected in this way are added to the movement list with the "Add" softkey.
One or more tools (e.g. cassette, tool carriage, loading magazine) can be selected
for the movement list.
If only one tool is selected (source), a specific location can be specified in the
target by placing a check mark in the table. This only works if you have selected a
single tool.
The source and target of the current movement summary are explicitly shown in
the status line. A movement is defined by the following information in the info line:
• Location
• Container
Note
• You may only specify one machine as the target for tool movements.
• If tools have been added to the movement list by means of the "Add"
operation, they can no longer be selected and the appearance of the check
mark changes (grayed). Changes can only be made in the "Organize
movements" screen form.
• If you change the selection of containers to be displayed in the Explorer view,
you invalidate the tool selection of the deselected container. This applies until
the selected tools are added to the movement list.
• The ticks for selected tools which you have transferred to the movement list
remain set until you complete the operation.
• The movement list can be extended at any time with "Add tool".
• One possible handling target is the dismantling container, which in the plant
configuration (Explorer) is represented by the trashcan symbol. Tools which
are transferred to the disposal container remain in the container list for only a
limited period. This list can be made available to a higher-level tool
management system for a dismantling function.
Description of softkeys
The following functions can be executed using the vertical softkeys:
Filter
This key accesses the screen for defining selection filters and for selecting the
columns that appear in the list. Filter settings made here only affect the part of the
screen in which the cursor is positioned.
Details
Click this key to access details of the selected tool in order to view and change tool
data. A distinction is made between NC data and PLC data.
Reuse
The selected tool movements are transferred to the tool movement list.
Tool movement
This key opens the list of all current tool movements.
Options
Opens the pop-up screen in which you can specify different sequences for tool
movements.
Explorer on/off
Shows/hides the plant component tree.
General
The tools to be moved can be selected via the entry screen for tool handling.
The tool handling/selection screen form is divided into two parts. In the top half all
the tool magazines assigned to the local component (point of use/installation) are
displayed in Explorer within the plant hierarchy (default setting). The local plant
component is displayed in the lower half.
Tool data are then requested from the host computer in the filter screen.
Pressing the "Filter>>" softkey opens the screen for defining selection filters.
The tool identifier and duplo number are selected here and the data entered for the
tool to be requested.
Press "OK" to request the data from the host computer and return to the tool
handling screen.
Once the requested tool data has arrived from the host computer, it is displayed in
the RPC container.
The tool can now be loaded (see Description of Functions for MCIS-TDI,
"TDI tool handling" section).
Once the loading operation from the RPC container has been successfully
completed, the tool data with the magazine and location numbers are reported to
the host computer.
Note
The file format for the tool data corresponds to the data backup format of the
NC840D (punched tape/ASCII format acc. to /BA/ ; such as in _N_TOx_TOA or
_N_TOx_INI). The complete description of data content and layout is provided in
/NFL/ chapter 4, Tool data.
Note
The file format for the tool data corresponds to the data backup format of the
NC840D (punched tape/ASCII format acc. to /BA/ ; such as in _N_TOx_TOA or
_N_TOx_INI). The complete description of data content and layout is provided in
/NFL/ chapter 4, Tool data.
If more than one tool has been unloaded via the RPC container, the tool data are
reported separately to the host computer for each tool.
Note
Once the tool data have been successfully reported to the host computer, the tool
is deleted from the RPC container.
4.1 Description
An interface DB is required for communication between RPC SINUMERIK and
TPS PLC. A Siemens-standard DB (DB12) is reserved for this purpose. The DB is
set up by the user. The data elements of the DB interface are organized in blocks,
each relating to an aspect of the interface (e.g. global data, transport job, docking
position data). The blocks are presented in tabular format. All blocks are stored
contiguously in the interface DB.
Binary data elements of the type "int(WORD)" and "Long(DWORD)" are stored in
the DB in S7 format (little-endian). When the PLC accesses these data elements,
it converts the data to Intel format (big-endian). Data elements which represent
names are implemented as byte fields with ASCII characters.
The interface is described in tabular format. The "Access" column indicates who
describes the field. The following abbreviations are used in this column:
• RPC SINUMERIK Computer link software (indirect from the host computer)
• PLC PLC user program
The PLC indicates changes in the interface with this byte. After it has enabled the
request byte, the PLC must enable the next bit in the trigger byte (see below).
The PLC can only write to the request byte again when it has been set to 0 by RPC
SINUMERIK after processing.
Status change
The PLC sets status change on every status change (machine mode, machine
status, NC mode) that has to be reported to the host computer. RPC SINUMERIK
must then send R_TPS_H () to the host computer.
Change trigger
RPC SINUMERIK reacts immediately to changes in this byte.
The PLC sets a bit in this byte when changes take place on the PLC. For each new
trigger, the PLC must set the next bit and reset the last; after bit 7 it begins again
with bit 0.
Synchronization flag
"Synchronization flag" is set and reset by the host computer. (See /NFL/ section
5.14 C_SYNCH_M ()) The status of the transport system must remain the same for
the duration of the synchronization process. The PLC must not execute any pallet
movements.
Deactivate components
Deactivate components is set by the host computer (See /NFL/section 5.15
Mode switching C_MODE_M ()). This requests the PLC to deactivate units (drives).
See also machine mode: Components deactivated.
Activate components
Activate components is set by the host computer (See /NFL/section 5.15 Mode
switching C_MODE_M ()). This requests the PLC to activate units (drives) again.
Machine status
Table 4-4 Status list of "Machine status"
Bit No. Function Access from
0 Machine is active PLC
1 Machine fault detected PLC
2 Restart machine PLC
NC mode
Table 4-5 Status list of "NC mode"
Bit No. Function Access from
0 Automatic PLC
1 MDI PLC
2 JOG PLC
3 TEACH IN PLC
The machine status and the NC operating mode are signaled to the host computer
with R_TPS_H. They are not evaluated in the computer link server, however.
Machine mode
Table 4-6 Status list of "Machine mode"
Bit No. Function Access from
0 Host computer mode PLC
1 Components deactivated PLC
4 Offline Host Computer RPC SINUMERIK
6 Is registered as Machine Mode 1000 in R_TPS_H PLC
7 Is registered as Machine Mode 2000 in R_TPS_H PLC
Components deactivated
Components deactivated is set by the PLC when this status is detected.
The request is set in bit 1 of the request flags (see below).
Reserve1, Reserve2
These variables can be used as required by the machine manufacturer by means
of the PLC. The values are reported to the host computer by R_MACHINE_H (),
although these values are not processed by the host computer as standard.
Workpiece carrier
The name of the workpiece carrier can be used by the PLC for plausibility checks.
For buffering
The buffer flag is set in cases where a workpiece carrier is transported to a
machine but where no machining is to take place (auxiliary buffer station).
The TPS must pass this information to the machine.
Priority
The priority is a supplementary unit of information. If several jobs are transferred,
the priority can be used to control the order in which they are processed.
Chain number
The chain number is a supplementary unit of information. In transport vehicles
with two storage locations and machines with only one docking position,
two transport jobs can be associated logically by means of a chain number.
Vehicle
The vehicle is a supplementary unit of information. In transport systems with
several transport vehicles, this parameter can be used to define which vehicle is to
be used for transport.
Transport status
Table 4-8 TPOStatus
Bit No. Function Access from
0 New transport job RPC SINUMERIK
1 Transport job started PLC
2 WPC on vehicle PLC
3 Job complete PLC
4 Error, job not executable PLC
5 Error, alternative destination approached PLC
(new destination is entered in DDockPos by the PLC)
The bit array describes the actual status of the docking position. It is set by the
PLC. If no bit is enabled, the docking position is available. The fault bit is set and
canceled in response to I/O signals. The cause of the fault is reported to the host
computer using the report function (see /NFL/ section 5.5 R_REPORT_H). The
PLC does not execute any pallet transports between stations which have the fault
status. If the docking position is disabled, it cannot be approached by the transport
system.
Assigned can be set by the PLC, primarily for internal purposes. The host
computer (and also RPC SINUMERIK) can detect from the workpiece carrier array
whether or not the docking position is assigned.
Workpiece carrier
Name of the workpiece carrier currently located at the docking position
(e.g. "WST01"). This information is entered by the PLC. If no workpiece carrier is at
the docking position, the array must be filled with binary 0s.
PLC actions
When the transport PLC starts the job, it must set the status TPOStatus = job
started. Bit 0 must be enabled in the "requests from PLC" byte so that RPC
SINUMERIK can read this status and inform the host computer. RPC SINUMERIK
resets the request byte, reads all the report data from the interface, and sends an
R_TPS_H call to the host computer.
When the workpiece carrier has been transferred to the transport vehicle, the PLC
can enable TPOStatus = WPC on vehicle and enable bit 0 in the "requests from
PLC" byte to send another R_TPS_H call to the host computer. It is not absolutely
necessary to report this intermediate status. It is also possible to enable the
request bit at the end of the transport operation. If it is set, another R_TPS_H call is
sent to the host computer. SDockPos is transferred in DockPos[0]. The number of
the transport vehicle is entered in DockPos[1].
When the workpiece carrier has been delivered to its destination docking position,
the PLC must enable TPOStatus = Job complete and enable bit 0 again in the
requests from PLC byte.
If the transport PLC is unable to execute a job, e.g. because the source docking
position is empty or disabled, it must set TPOStatus = error, job not executable.
If only the specified destination cannot be reached, and the workpiece carrier is
therefore diverted to another docking position, the transport PLC must enter the
new destination in DDockPos and enable the status TPO-Status = error,
alternative destination approached.
At the end of the transport job, another R_TPS_H call is initiated with
MachineStatus = inactive, DockPos[0] = DDockPos etc.
Each time TPOStatus is changed and this modification is to be sent to the host
computer with R_TPS_H (), bit 0 must be enabled in the requests from PLC byte.
TPO RPC SINUMERIK enters PLC starts WPC is on WPC has reached
Status TPA in interface TPA the vehicle reached
Bit 0
Bit 1
Bit 2
Bit 3
Machine Active
status Inactive
Req.
For notes
5 Configuration Data
5
5.1 Description ....................................................................... FBR/NPL/5-52
5.1 Description
The configuration data required for the computer link are entered in the Registry.
These data can be created and changed with the SCCONFIG.EXE program.
Note
For compatibility reasons the registry entries have not been changed to the new
name RPC SINUMERIK but can still be found under
HKEY_LOCAL_MACHINE\Software\SIEMENS\SinCOM\...
The configuration data are subdivided into machine-related data and computer-
related data. If several computers are connected with the computer link, there is
one data record with computer-related data (name, IP address ...) for each
computer. For each computer, which RPC is received by this computer and which
RPC is sent to the computer has to be determined.
Name
Name is the machine name which is entered as the second parameter for each
RPC.
Endpoint
The Endpoint number is needed for RPC in addition to the IP address.
Put directory
The Put Directory serves as a temporary directory in which RPC SINUMERIK
stores files before transferring them to the host computer. )*
Get directory
The Get Directory serves as a temporary directory if files are transferred from the
host computer. If the files are not processed any further by RPC SINUMERIK,
they remain in this directory. )*
Computer-related data
Overview
RPC SINUMERIK offers the possibility of communicating with several host
computers. This screen form has to be completed for each host computer.
Switchover between the host computer takes place by means of the arrows in the
top right area.
Host
Name is the host name which is entered as first parameter for each RPC call.
IP address
IP Address is the IP address of the host computer.
Put directory
The Put Directory is the directory into which RPC SINUMERIK transfers files on
the host computer.
Get directory
The Get Directory is the directory from which RPC SINUMERIK fetches files on
the host computer.
Ftp
If the host computer is a Windows computer (NT or Win95), Ftp does not have to
be used and the User and Password fields are then not relevant, because data
transfer can take place via SMB (Microsoft notation).
With other host computers, e.g. UNIX or Linux computers, data transfer has to take
place via FTP unless Samba, for example, is installed on the host computers,
which in turn allows Microsoft notation. The Ftp box must be selected and valid
entries for login on the host computer must be entered in User and Password.
The specified user must have write access to the directories specified with
Put Directory and read access to the directories specified with Get Directory.
Directories
The specified directories on the host computer and also on the PCU 50/70 must
exist or be created before RPC SINUMERIK is started for the first time. They are
not created by RPC SINUMERIK!
Reading of tool data of an NC tool requires one read call per data storage area.
If tool data are transferred to the host computer, it is not necessary to transfer all
tool data to the host computer in each case. For that reason, three tool structures
can be defined (Tv1-Tv3). Normally, the first structure includes all existing data
storage areas (if there are no user-related data storage areas, they should be
deselected). The other two structures should be defined as needed with a reduced
scope.
RPC functions
For each RPC function the host computer to which it is sent (RPC screen, left side)
and which RPC function is received from which host computer (RPC screen, right
side) must be determined.
Logging
The logging dialog box can be used to set the size of the log file and to choose a
trace level.
Global user data (Global User Data) can be created for NCK-specific tasks on the
SINUMERIK.
For more detailed information, please refer to Appendix / 8.13 / Creating
definition files.
The ASCII file with configuration data could look like the following:
[HKEY_LOCAL_MACHINE\Software\SIEMENS\SinCOM\Host1]
"Name"="FLR1"
"IpAdr"="195.212.26.110"
"Endpoint"="2010"
"FTPUser"=""
"FTPPassword"=""
"HostDirGet"="h:\\"
"HostDirPut"="h:\\"
"Ftp"=dword:00000000
[HKEY_LOCAL_MACHINE \Software\SIEMENS\SinCOM\RPC_H]
"R_MACHINE_H"=dword:0000ffff
"R_TPS_H"=dword:0000ffff
"R_DDEDATA_H"=dword:0000ffff
"R_REPORT_H"=dword:0000ffff
"T_VAR_H"=dword:00000000
"R_VAR_H"=dword:00000000
"T_DATA_H(1)"=dword:00000001
"T_DATA_H(10)"=dword:00000001
"T_DATA_H(20)"=dword:00000001
"T_DATA_H(21)"=dword:00000001
"T_DATA_H(22)"=dword:00000001
"T_DATA_H(23)"=dword:00000001
"T_DATA_H(26)"=dword:00000001
"T_DATA_H(27)"=dword:00000001
"T_DATA_H(28)"=dword:00000001
"T_DATA_H(90)"=dword:00000001
"R_DATA_H(1)"=dword:000000ff
"R_DATA_H(10)"=dword:000000ff
"R_DATA_H(20)"=dword:000000ff
"R_DATA_H(21)"=dword:00000001
"R_DATA_H(22)"=dword:00000001
"R_DATA_H(23)"=dword:00000001
"R_DATA_H(50)"=dword:00000001
"R_DATA_H(90)"=dword:00000001
[HKEY_LOCAL_MACHINE \Software\SIEMENS\SinCOM\RPC_M]
"T_MACHINE_M"=dword:0000ffff
"T_TPS_M"=dword:0000ffff
"T_DATA_M"=dword:00000001
"T_REPORT_M"=dword:00000001
"R_DATA_M"=dword:00000001
"R_NC4WPC_M"=dword:00000000
"R_DDEDATA_M"=dword:0000ffff
"R_REPORT_M"=dword:0000ffff
"C_DELETE_M"=dword:00000001
"C_TPORDER_M"=dword:00000001
"R_DATA_M(1)"=dword:00000001
"R_DATA_M(10)"=dword:00000001
"R_DATA_M(26)"=dword:00000001
"R_DATA_M(27)"=dword:00000001
"R_DATA_M(28)"=dword:00000001
"R_DATA_M(90)"=dword:00000001
"C_DELETE_M(1)"=dword:00000001
"C_ORDER_M(1)"=dword:00000001
[HKEY_LOCAL_MACHINE\Software\SIEMENS\SinCOM\Settings]
"Machine"="FMS-TPS________"
"EndpointMach"="3011"
"MMCDirGet"="C:\\TMP\\MMC"
"MMCDirPut"="C:\\TMP\\MMC"
"TraceFilesize"=dword:00000005
"TraceLevel"=dword:00000002
"ToolData1"=dword:0000003f
"ToolData2"=dword:00000015
"ToolData3"=dword:00000001
FilDocEnd
For Notes
I Index
I
I.1 Keyword index
D R
For notes
A Appendix
A
A.1 Interface Definition Language (IDL)
The IDL files describe the function calls and their parameters. With the ACF files
for the IDL compiler, it is determined whether an internal or external binding is
required. If the host computer is to communicate with a number of machines,
an external binding is used.
The ACF files supplied contain the appropriate instructions for both types, only one
of which however is commented on. Make sure that the required form is active and
the form not required is "comment".
From these files the IDL compiler generates the client and server stubs as well as
the header.
If Microsoft WINDOWS (>= WINDOWS 95) is used on the host, the VC++
development system is sufficient. It contains an IDL compiler as well as files,
otherwise necessary for the RPC.
! Important
It must be a DCE RPC development system and not a SUN RPC!
The RPCTEST installation contains the sources for a VC++ 6.0 prototype program
as a basis for an RPC SINUMERIK host computer application as well as a short
description of the most important program parts.
[ uuid(d3d7d860-c15a-11d0-a0cb-00a0244ce687),
version(1.0),
pointer_default(unique)
]
interface SINCOMHOST
{
void Shutdown_H(void);
[ uuid(d6542300-c15a-11d0-a0cb-00a0244ce687),
version(1.0),
pointer_default(unique)
]
interface SINCOMMACHINE
{
void Shutdown_M(void);
8
HMI <=> NCK/PLC (OEM) interface
Overview
There are three different communication services available to the developer:
8.1 General
Communication between applications and NC/PLC takes place via the OPC or
the Sinumerik COM interfaces. For compatibility reasons, direct access via the
NCDDE server is also possible for the time-being. With new developments,
however, the new COM interfaces must be front panel.
The NCDDE server can be configured by means of initialization files. This allows
the user to adapt the NCDDE to his development environment.
Is there a control available for testing purposes? Are there one or more NCUs from
which data is to be accessed?
Note
The use of the Windows environment means that there is no time guarantee for
SINUMERIK 840D. Real-time tasks can therefore not be implemented in HMI.
They must be implemented in the NCU area with the OEM package NCK.
Overview
The WINDOWS operating system provides application developers with the DDE
(Dynamic Data Exchange) mechanism as a communication tool between
WINDOWS processes.
DDE features
DDE characterizes the dynamic data exchange under WINDOWS with the
following Properties:
• DDE is communication between WINDOWS applications
• DDE is executed between two processes according to the client-server model
• One process acts as client: it requests data from the server
• One process acts as server: it provides the data for the client
• The connection is established by the client
• A program may act as server as well as client
• The communication is specified according to the internal WINDOWS protocol
Establishing a DDE connection
In order to establish a connection to a DDE server, the client developer must know
the following information:
Description
The NCDDE server is initialized via the [GLOBAL] section of the "MMC.INI" file.
This file is located in the directory \MMC2 of the OEM system.
Here the Link Server and the Link Topic to which the local NCDDE server
must connect are defined. The terms Link Server and Link Topic are explained in
section 8.2.
Depending on the scope of the installation, the NCDDE server can have one of four
basic configurations:
• Connection to one NC
• Connection to one or more NCs
(for the M:N feature see section 8.3.3)
• Local operation mode on a PC
Allows the developer to test his application locally on his PC without a
connection to an NC. In this case the NCDDE server supplies substitute values
which can be defined with the command "NEW" (section 8.8) and modified with
the command "ANIMATE" (section 8.8) to simulate an active NC.
• Local operation on a PC with NC simulator.
Allows the developer to test his application locally on a PC without a connection
to an NC. The NC simulator can be used to reproduce a behavior resembling
that of an NC.
NcddeServiceName
DDE Link Service name of the NCDDE server. The default name is always "ncdde".
Note
All examples in chapter 8 are based on "NcddeServiceName=ncdde". If the name
is different, these examples must be modified accordingly, otherwise they will not
work.
Ncdde-MachineName
The NCU name for the standard applications is entered here. If "MachineSwitch" is
entered here, you can switch between individual NCUs (for the M:N feature see
section 8.3.3).
NcddeDefault-MachineName
This initializes the M:N feature, i.e. a connection is established to this NCU when
the HMI starts up.
Ncdde-MachineNames
Here the names of the NCUs that can be connected are entered. For each NCU
name entered here a section of the same name must exist in the file MMC.INI.
NcddeStartupFile
The NSK file (section 8.3.2) to be loaded when starting up the NCDDE server.
NcddeMachineNamesAdd1
Identifier for an installed NC simulation. If no simulation has been installed, this
entry has no relevance.
[GLOBAL]
; for using M:N function set NcddeMachineName=MachineSwitch
; for working without NC set NcddeMachineName=local
; for working with SIMNC set NcddeMachineName=SIM1
; for connecting to a NC set NcddeMachineName=NCU840D
NcddeMachineName=local
; for using M:N function set NcddeDefaultMachineName=net:NCU_1
; for working without NC set NcddeDefaultMachineName=local
; for working with SIMNC set NcddeDefaultMachineName=SIM1
; for connecting to a NC set NcddeDefaultMachineName=NCU840D
NcddeDefaultMachineName=local
; for using M:N function set NcddeMachineNames=net,NCU840D
; for working without NC set NcddeMachineNames=
; for working with SIMNC set NcddeMachineNames=SIM1
; for connecting to a NC set NcddeMachineNames=NCU840D
NcddeMachineNames=
; for using M:N function set NcddeStartupFile=ncdde5.nsk
; for working without NC set NcddeStartupFile=ncdde202.nsk
; for working with SIMNC set NcddeStartupFile=sim1dde5.nsk
; for connecting to a NC set NcddeStartupFile=ncdde5.nsk
NcddeStartupFile=ncdde202.nsk
Name spaces
In LOCAL mode the NCDDE server does not differentiate between variables in
'name spaces'. Name space refers to a differentiation by TOPIC.
For example, if a variable is applied to TOPIC LOCAL and the same variable
to TOPIC Sim0, NCDDE does not differentiate between these variables.
This can mean that the current record display stops working in the simulation
if you switch to MACHINE in a screen with the current record display, since local
variables are applied there from the program and they supersede the 'simulation
variables'.
NSK files
The command files (with the extension .NSK) contain for example the Link items
to which the NCDDE connections refer. These files can contain commands,
which are described in section 8.8.
In these files the Data Link items that can be accessed are programmed.
Other .nsk files can also be included by means of CALL front panel. This allows
structuring. Example 8-2 shows a Link item (LastError) and the structuring of the
global variables for HMI with CALL instructions.
Note
You may load your own NSK files with CALL instructions. The NSK files can be
created with a MAP function (section 8.6.3).
M:N feature
This feature allows more than one HMI to be connected to more than one NCU.
For example, data from two NCUs can be accessed from one HMI.
The file "NETNAMES.INI" is interpreted in this basic configuration.
Connection part
The section "[conn MMC_1]" specifies the partners to which the HMI can connect.
Network parameters
In the section "[param network]" the transfer rate is set:
OPI 1.5 MBit
MPI 187.5 Kbit
Bus devices
In the sections "[param NCU_n]" the bus addresses of the NC and the PLC as well
as the NCU name are set. The HMI must use these names to address the NCU.
A description must be given for each NCU.
Application
In order for OEM applications to function correctly in an M:N configuration, the
following points must be observed:
• For any communication with the NC, only "machineswitch" should be used as
the Link Topic. This ensures that the application always communicates with the
NC that is selected if the M:N or NC is changed.
If on the other hand the name of a specific NCU is given when establishing a
communication connection in Link Topic, e.g. NCU1, it is disregarded if the M:N
is changed, i.e. if the operator panel is switched from NCU1 to another NC, the
connection is maintained. Such "fixed" or static connections to a specific NC
should only be set up by an application if the operator panel on which the
application is running is configured as the M:N server.
• For the OEM application an NC switch appears as an NC reset or
communication failure. The application should therefore also respond in the
same way as after an NC reset or communication failure. An NC reset can be
detected by the establishing of a hotlink to the OPI variable /bag/state/opmode.
In the event of an NCK reset the hotlink supplies the value "#".
• To prevent communication operations, e.g. file transfers, that are running in the
background from being interrupted or aborted by an M:N or NC switch, NC
switching should be disabled before the start of such operations and enabled
again on completion. The functions LockCurrentNCU/LockChanMenu and
UnlockCurrentNCU/UnlockChanMenu (see section 6.4) can be used for this.
LockCurrentNCU only disables switching to another NC, whilst allowing channel
switching on the current NC, whereas LockChanMenu disables channel
switching too.
• If certain services or variables are only available on a specific NCU, before the
application accesses these services or variables you must check that a
connection exists to the NCU in question. The NCU to which a connection
currently exists can be determined by reading the "machineswitch" variable
(LinkItem).
Note
In the examples below only the standard Visual Basic control "LABEL" is used for
DDE communication. An OEM application should use the Siemens control DCTL
(see section 8.9.3) for DDE communication, however.
The following requirements must be fulfilled for the examples below to work:
Development environment
• We recommend MS Visual Basic 4.0_16
• In order to test the examples on the SINUMERIK 840D directly from a PC,
an MPI connection is required and the NCDDE server must be configured for
NC operation.
If the NCDDE server is operated without SINUMERIK 840D, not all of the data
can be accessed.
• The NCDDE server (C:\MMC2\NCDDE.EXE) must have been started
(e.g. via Explorer or the Start menu).
Note
For one-off reading, "LinkMode" must be set to 2. The value is then also
requested by the first channel with the "LinkRequest" method.
Sub Form_Load ()
Label1.LinkTopic = "ncdde|local"
Label1.LinkItem=”/Channel/GeometricAxis/actToolBase-
Pos[u1,1]"
Label1.LinkMode = 2
Label1.LinkRequest
End Sub
Note
If the channel identifier "u1" is not specified, the first channel is accessed
automatically.
Note
For hotlinks "LinkMode" must be set to 1.
Sub Form_Load ()
Label1.LinkTopic = "ncdde|ncu840d"
Label1.LinkItem="/Channel/MachineAxis/actToolBasePos[u2,3]"
Label1.LinkMode = 1 ’Hotlink
End Sub
Note
For notifying when changed (Warmlink) "LinkMode" must be set to 3.
Sub Form_Load ()
Label1.LinkTopic = "ncdde|ncu840D"
Label1.LinkItem = "/PLC/Input/Byte[1]" Label1.LinkMode = 3
End Sub
Sub Label1_LinkNotify ()
Label1.LinkRequest
End Sub
Writing NC data
In this example the client writes the value "4" to the first R parameter R[1] of the
first channel.
Note
When writing data (Poke), "LinkMode" must be set to 2. The value is written with
LinkPoke.
Sub Form_Load ()
Label1.LinkTopic = "ncdde|ncu840d"
Label1.LinkItem = "/Channel/Parameter/R[1]"
Label1.LinkMode = 2 ’Manual
Label1.Caption = "4"
Label1.LinkPoke
End Sub
Sub Form_Load ()
Label1.LinkTopic = "ncdde|ncu840d"
Label1.LinkItem = "/PLC/Memory/Byte[5]"
Label1.LinkMode = 2 ’Manual
Label1.Caption = "250"
Label1.LinkPoke
End Sub
Executing a command
For executing commands described in sections 8.6.1, 8.6.3, 8.7 and 8.8.
The following example starts a file transfer of the "test.mpf" file from the HMI to the
NCK.
Note
When executing commands (Execute), "LinkMode" must be set to 2. The
command is executed with LinkExecute.
Sub Form_Load ()
Label1.LinkTopic = "ncdde|ncu840d"
Label1.LinkMode = 2
Label1.LinkExecute "COPY_TO_NC(""C:\NC\test.mpf"",
/NC/_N_MPF_DIR/N_TEST_MPF, trans)"
End Sub
Overview
C/C++ can make use of all the features of the DDE interface. In particular, it allows
asynchronous calls to be addressed to the DDE interface. This is also possible in
Visual Basic using OEM Visual Basic controls such as DCTL.
Note
DDE with C/C++ is recommended only for OEM users who are familiar with C
programming under WINDOWS and who require little or no integration in the
sequence control of the OEM package.
Overview
In Excel Advise (Hotlink) connections can be established to the NCDDE server's
interface for variables using cell formulas.
On the left you see the cell formula, on the right the resulting, continuously updated
display.
Note
A complete description of the variables that can be accessed can be found in
Chapter 11 Reference or in the online help for variables.
Note
If the types of the data selection and the variable actually read do not match,
there is no automatic adjustment of the data format, i.e. the wrong data are
displayed.
Example 8–12 Formatting with max. 11 digits before and a fixed 3 digits after the
decimal point
Sub Form_Load ()
Label1.LinkTopic = "ncdde|ncu840d"
Label1.LinkItem = "/Channel/MachineAxis/actToolBasePos[2]
Ä(""!d%11.3lf"")"
Label1.LinkMode = 2 ’Manual
Label1.LinkRequest
End Sub
Sub Form_Load ()
Label1.LinkTopic = "ncdde|ncu840d"
Label1.LinkItem = "/PLC/Memory/Byte[5] (""!l%02lx"")"
Label1.LinkMode = 2 ’Manual
Label1.LinkRequest
End Sub
Sub Form_Load ()
Label1.LinkTopic = "ncdde|ncu840d"
Label1.LinkItem = "/PLC/Memory/Word[5] (""!b%16.16s"")"
Label1.LinkMode = 2 ’Manual
Label1.LinkRequest
End Sub
Result: 10101010101010101
Sub Form_Load ()
Label1.LinkTopic = "ncdde|ncu840d"
Label1.LinkItem = "/PLC/DataBlock/Byte[c81,20,#10] (""!l%lc"")"
Label1.LinkMode = 2 ’Manual
Label1.LinkRequest
End Sub
Sub Form_Load
achsname(0).LinkTopic = g_chNCDDEServiceName
achsname(0).LinkItem = "/Channel/MachineAxis/name[1]"
achsname(0).LinkMode = 2
achsname(0).LinkRequest
achsname(1).LinkTopic = g_chNCDDEServiceName
achsname(1).LinkItem = "/Channel/MachineAxis/name[2]"
achsname(1).LinkMode = 2
achsname(1).LinkRequest
achsname(2).LinkTopic = g_chNCDDEServiceName
achsname(2).LinkItem = "/Channel/MachineAxis/name[3]"
achsname(2).LinkMode = 2
achsname(2).LinkRequest
End Sub
Application
An array access is advantageous when several data are to be read from one area.
This reduces the computing load on the NCDDE server and improves the
performance of the user's own applications. Example 8-16 is a bad example of this.
Note
Array accesses speed up the data access and as well the speed of the complete
system, since the time needed for communication is considerably reduced.
Syntax
As an introduction here is a brief glimpse of the syntax for array areas:
Variable name[ c, u, StartIndex, [EndIndex]]
Parameter
Table 8-1 Data access parameters
Name Description
Variable name Name of the NCK/PLC variable (see Chapter 11)
c When accessing NCK variables (see Chapter 11): Column index
c stands for column and applies to multi-dimensional arrays only.
When accessing PLC data blocks c characterizes the data
block to be accessed.
e Unit index for NCK variables only (e.g. channel): u stands for
unit
StartIndex Index for the variables to be read.
When accessing arrays this is the first of the values to be read.
EndIndex For accessing arrays only: Specifies the number of values to be
(optional) read.
m_a_namen.LinkTopic = g_chNCDDEServiceName
m_a_namen.LinkItem = "/Channel/MachineAxis/name[u1,1,3]"
m_a_namen.LinkMode = 2
m_a_namen.LinkRequest
achsname1.Caption = Trim$(Mid$(m_a_namen.Caption,1,2))
achsname2.Caption = Trim$(Mid$(m_a_namen.Caption,4,2))
achsname3.Caption = Trim$(Mid$(m_a_namen.Caption,7,2))
Label1.LinkTopic = "ncdde|ncu840d"
Label1.LinkItem = "/PLC/Datablock/Byte[c8,2,4]( ""!l%02lx"")"
Label1.LinkMode = 1 'hotlink
byte_1 = Trim$(Mid$(Label1.Caption,1,2))
byte_2 = Trim$(Mid$(Label1.Caption,3,2))
byte_3 = Trim$(Mid$(Label1.Caption,5,2))
Label1.LinkItem = "/PLC/Datablock/Word[c8,2,#5](""!l%04lx_"")"
Label1.LinkTopic = "ncdde|ncu840d"
Label1.LinkItem = "/CHANNEL/PARAMETER/R[U1,3,5]"
Label1.LinkMode = 2 ’Manual
Label1.Caption = ":2.2:3.5:4.9"
Label1.LinkPoke
Description
Using these functions you can transfer data/files between the HMI and the
NCK/PLC.
Application
These functions are suitable for transferring part programs and tool data to the
NCK or for transferring S7 and C programs to the PLC.
Functions without the extension "BINARY" can transfer files, e.g. part programs, to
the NC. The NCDDE server adds a block header to the data to be transferred. This
header contains the size and date of the block and the path in the NCK file system.
Note
• Used for data transfer to the NCK.
• Cannot be used for transferring files to the PLC because an NC block header
is always added to the data stream.
BINARY functions
Functions with the extension "BINARY" can transfer files, e.g. part programs, to
the NCK. The NCDDE server transfers the data without an NC block header.
Note
• Can be used for transferring files to the PLC and to the NCK.
• PLC modules are always copied to the passive file system of the PLC. At that
time they are not yet active. The passive blocks still have to be activated.
Syntax
The copy functions must be written as strings following the syntax:
COPY_FROM_NC (WinFile,NcFile,TransferState)
COPY_TO_NC (WinFile,NcFile,TransferState)
COPY_FROM_NC_BINARY (WinFile,NcFile,TransferState)
COPY_TO_NC_BINARY (WinFile,NcFile,TransferState)
Parameter
Table 8-3 Data access parameters
Name Description
WinFile Source or destination of the information in the HMI area
NcFile File name for the NCK/PLC environment
TransferState Variable characterizing the transfer state
WinFile parameter
Describes the source or the destination of the information on the HMI side.
The first character specifies the type.
This parameter is the default file name in a WINDOWS environment. It should
include the drive specification, the path and the file name. e.g.
"C:\NC\test.MPF".
Note
Suitable for reading and writing blocks up to a size of 500 bytes. Larger blocks
are refused by the NCDDE server.
During transfers to the NCK/PLC (download) DDE pokes fill the pipeline and thus
provide a direct transfer to the NCK/PLC. An empty poke indicates the end of the
transfer.
During transfers from the NCK/PLC (upload) DDE requests empty the pipeline that
is being filled for the running transfer. If a request returns empty data, this indicates
the end of the transfer.
struct NCDDE_DOMAINMAP_HEADER {
unsigned short handle; // buffer handle (HGLOBAL) is preassigned
// by client)
unsigned short header_size; // length of header (preassigned by client)
unsigned long shared_size; // useable length of data area (preassigned
// by client)
unsigned long fill_count; // number of valid bytes in data area (preassigned
// by client when downloading and by server when
// uploading)
unsigned long state; // corresponds to the transfer data variable in
// the transfer command
// < 100: Transfer is running; "state" shows what percentage
// of the transfer has been completed
// ==100: Transfer successfully completed
// > 100: Transfer was stopped with error,
// "state" shows the ncdde error code
// (set by the server)
unsigned long file_mod_time; // file modification time value:
// 0 denotes current time (preassigned by client when
// downloading and by server when uploading)
unsigned long server_private;// server-specific data (set by the server)
unsigned long client_private; // client-specific data (set by the client)
unsigned long magic; // signature for an additional type check, value always
// NCDDE_MAGIC = 0xF6F7F8F9 (preassigned
// by client)
};
NcFile parameter
The parameter "NcFile" is the path name in the NCK/PLC environment. This name
is built up of a configurable part that is required for addressing the NCK in question
and additionally the domain path in the NCK environment.
Domains in NCK are addressed via the NCDDE server using an NC file name.
/NC Which area: PLC or NCK
/_N_MPF_DIR Path specification for the NC
/_N_WS03_MPF File name
TransferState parameter
The parameter "TransferState" is the name of a local NCDDE variable (variable
type: fixed) to be used for returning the state of the transfer that is carried out in the
background. This variable can also be created by the NCDDE server.
The TransferState variable characterizes the state of the file transfer:
The range of values has been chosen, so that values <=100 indicate normal
conditions, whereas all other values indicate error conditions.
Note
As long as the variable has a value between 1 and 99 it cannot be used for
carrying out further file transfers.
Note
During a transfer in BINARY mode and during a transfer using pipes, no
information on the block size is available. Therefore no information regarding the
current percentage of transferred data can be provided to the variable
TransferState and it stays constant at 50%.
With very short files the display can jump immediately from 1 to 99. This is
essentially a problem with hotlinks, however, and is due to the fact that the
client/application does not retrieve the data quickly enough from the NCDDE server.
Uploading a part program
The following example copies the part program "BSP.MPF" to the file "test.mpf" in
the directory "C:\NC". The file "test.mpf" is newly created. The part program
"BSP.MPF" must exist in the NCK.
Sub Form_Load ()
'start pipe
Label1.LinkTopic = "NCDDE|ncu840d"
Label1.LinkMode = 2
Label1.LinkExecute "COPY_TO_NC(@pipe,
Ä/NC/_N_MPF_DIR/_N_PIPE1_MPF,trans)"
'describe pipe
Label2.LinkTopic = "NCDDE|NCU840D"
Label2.LinkMode = 2
Label2.LinkItem = "@pipe"
Label2.Caption = "G01 F11111 X5555"
Label2.LinkPoke
'end pipe
Label2.Caption = ""
Label2.LinkPoke
End Sub
Note
PLC blocks are always copied to the passive file system of the PLC.
At that time they are not yet active. The passive blocks then have to be
activated (see example 8-36).
Description
These functions allow the user to transfer data between the NCK/PLC and the HMI.
Application
These functions are especially suitable for transferring single blocks, sections of
part program or for editing part programs stored on the NC.
Note
The difference between the "normal" and "BINARY" variants of the functions is
described in section 8.6.1.
Syntax
The extended copy functions must be written as strings following the syntax below:
COPY_FROM_NC (WinFile,NcFile,seekPos,seekLen,compare
String,skipCount)
COPY_FROM_NC(_BINARY) (WinFile,NcFile,seekPos,seekLen,compare
String,skipCount)
COPY_TO_NC (WinFile,NcFile,seekPos,seekLen,compare
String,skipCount)
COPY_TO_NC(_BINARY) (WinFile,NcFile,seekPos,seekLen,compare
String,skipCount)
Parameter
The parameters are described in the table.
The commands return after having completely processed all of its sub-commands.
Errors which occur during the execution of the command, can be analyzed using
the variable LastError.
Sub Form_Load ()
Label1.LinkTopic = "NCDDE|NCU840D"
Label1.LinkMode = 2
Label1.LinkExecute"COPY_FROM_NC(C:\NC\test.dat,
Ä/NC/_N_MPF_DIR/_N_TP1_MPF,1 ,1024 , , 0
)"
End Sub
Sub Form_Load ()
Label1.LinkTopic = ”NCDDE|NCU840D”
Label1.LinkMode = 2
Label1.LinkExecute " COPY_TO_NC_BINARY ( @xpipe ,
Ä/NC/_N_MPF_DIR/_N_X_MPF , B2 , 3 , , 0 )"
End Sub
Transferring a block
Text transfer (max. text length: 200 bytes) to the 2nd block of the part program
TEST.MPF. The second block is overwritten.
Sub Form_Load ()
Label1.LinkTopic = "NCDDE|NCU840D"
Label1.LinkMode = 2
Label1.LinkExecute "COPY_TO_NC ( ""!This is the content of the
2nd block"" , /NC/_N_MPF_DIR/_N_TEST_MPF, B2 ,1 , , 0 )"
End Sub
MAP_ACC_NC
Description
This function allows the user to make global user data (GUD) and NCK machine
data available to the NCDDE server. These data are stored in files with the
extension ACC. Files with the extension ACC are located in the NCK and contain
access descriptions for the variables.
Application
The command MAP_ACC_NC allows ACC files from the NCK to be read and to be
prepared for use in the NCDDE interface i.e. the corresponding connections to
these data are created or identified in the NCDDE server.
Note
Allows the user to make new NCK data available to the NCDDE server.
Otherwise these variables/data could not be accessed.
The command works in the same way as the command COPY_FROM_NC except
that the information from the ACC file is also decoded and prepared in such a way
that it can be viewed on the DDE interface.
Syntax
The call follows the syntax below:
MAP_ACC_NC
Ä(WinFile, NcFile, TransferState, Area, DataBlock, Timeout, Prefix)
Parameter
Table 8-6 contains a more detailed description of the parameters. The first three
parameters correspond to those of the other domain services (see 9.6.1). For the
sake of completeness they are also included in the following table.
Note
If the parameter WinFile is a file with the extension .NSK, the Domain Service in
addition to an ACC file creates an NSK file, which contains the corresponding
LINK commands.
ACC files
Sub Form_Load ()
Label1.LinkTopic = "NCDDE|NCU840D"
Label1.LinkMode = 2
Label1.LinkExecute "MAP_ACC_NC (L:\MMC2\NCMDACC.NSK,
/NC/_N_VS_DIR/_N_VS_TEA_ACC,trans,5,7F,10,/ACC/driveVSA/MD/)"
End Sub
Sub Form_Load ()
Label1.LinkTopic = "NCDDE|NCU840D"
Label1.LinkMode = 2
Label1.LinkItem=
"/ACC/driveVSA/MD/$MD_TORQUE_THRESHOLD_X[1]"
Label1.LinkRequest
End Sub
8.7 PI services
Overview
IMC Command is used to execute program instance (PI) services on the NC/PLC.
For compatibility reasons jobs can also be determined via DDE on the NCK and
the PLC. A summary of the PI services can be found in PI.hlp.
The PI services on the NCDDE server comprise:
PI_START(_BINARY)
Description
This function allows you to send an instruction from the HMI to the NCK.
Application
These functions are suitable for starting jobs in the NCK.
The non-binary transfer is suitable for transfers to the NCK.
The binary transfer is suitable for transferring data to the PLC, the NC and the
drives.
Syntax
The command line for calling PI services follow the syntax:
PI_START(server name, parameter 1, parameter 2 ... parameter n, PI name)
PI_START_BINARY (server name, parameter , PI name)
The PI name for NCK starts with _N_ , followed by 6 characters. Slightly different
conventions apply to the PLC.
Parameter
The parameters are described in detail in the online help, since their functions
depend on the PI service in which they are used.
Activating OB 1
Activate an OB1 already stored in the passive file system:
Stop activating OB 1
Example 8–38 Stop activating OB 1
Sub Form_Load ()
Label1.LinkTopic = "NCDDE|NCU840D"
Label1.LinkMode = 2
Label1.LinkExecute "PI_STOP_BINARY( /PLC,
Ä""@1d1@1d0@@0800001P"", _INSE)"
End Sub
Overview
Other NCDDE server commands are summarized in Table 8-7:
Table 8-7
Command Meaning
NEW Create local variables
FREE Delete variables
ANIMATE Continuously change a local variable
CALL Execute NCDDE commands in files
PLC_MEMORYRESET Reset the PLC memory
NEW
Description
Creates a local/internal variable in the NCDDE server which can then be accessed.
Application
With the command NEW a new local/internal variable on the NCDDE server is
created. When accessing this variable, no communication with the NCK takes
place. If a variable by the name VarName already exists, it is deleted before the
new one is created (similar to the FREE command, section 8.8).
Syntax
NEW (VarName , value)
Parameter
Sub Form_Load ()
Label1.LinkTopic = "NCDDE|NCU840D"
Label1.LinkMode = 2
Label1.LinkExecute " NEW ( test , 10.0 )"
End Sub
FREE
Description
Deletes a variable in the NCDDE server
Application
The command "FREE" deletes variables created by the commands "NEW" and
"LINK". If the variable is currently being used by a file transfer service (section
9.6.1) as a state variable, the command "FREE" is rejected. If there exist Advise
Links (Hotlinks) to the variables, these links are removed. Other transactions with
the NCK and PLC are aborted.
Syntax
FREE (VarName)
Parameter
Sub Form_Load ()
Label1.LinkTopic = "NCDDE|NCU840D"
Label1.LinkMode = 2
Label1.LinkExecute " FREE( test )"
End Sub
ANIMATE
Description
Causes the NCDDE server to continuously change the value of a local variable that
has been created with "NEW". Values are incremented in cycles of approximately
1 second.
Application
Used for testing your application.
Syntax
Animate (VarName)
Parameter
Sub Form_Load ()
Label1.LinkTopic = "NCDDE|NCU840D"
Label1.LinkMode = 2
Label1.LinkExecute " ANIMATE( test )"
End Sub
CALL
Description
Interprets command files
Application
With the command CALL NCDDE commands recorded in files are executed. Each
line of the file is passed as a command to the NCDDE server. The file may contain
comments and space lines. The extension .NSK should be used consistently for all
NCDDE command files.
Note
Allows you to customize the NCDDE server for your applications.
Syntax
CALL (FileName)
Parameter
PLC_MEMORYRESET
Description
The command PLC_MEMORYRESET on the NCDDE server resets the PLC
memory. Specify /PLC as area address.
Application
Resets the PLC memory
Syntax
PLC_MEMORYRESET(AreaAddr)
Parameter
Sub Form_Load ()
Label1.LinkTopic = "NCDDE|NCU840D"
Label1.LinkMode = 2
Label1.LinkExecute "PLC_MEMORYRESET(/PLC)"
End Sub
Note
When developing an OEM application, we recommend that these OEM Visual
Basic controls be used for accessing the NCDDE server
Standard controls such as Label and TextField can be used for DDE
communication. This communication however has some insufficiencies:
• Events get lost.
There is no certainty that the change procedure in the VB program will be
initiated if the value of a DDE variable changes with LinkMode = 1. (The only
solution is to pole the value via "Timercontrol").
• The DDE functionality cannot be nested.
In a DDE change procedure, other DDE functions in the control cannot be
activated (only solution is via timers or the like).
• Only synchronous transactions are realized. The response time intervals for
installed Hotlinks and for requests are quite long. This especially applies, when
these actions involve more than one CPU (NCK, PLC).
• Demand for resources is high
For each control instance that uses DDE, a DDE connection is established.
Each connection uses 2 WINDOW handles, blocking scarce user resources.
• LastError is not handled conveniently in NCDDE
When communication with the NCK is being carried out via NCDDE, the
NCDDE server provides the DDE variable "LastError" for detailed analysis of
errors. This variable is specific for each DDE conversation and is valid only if
the DDE return is DDE_FNOTPROCESSED.
Overview
The Visual Basic control DCTL.OCX is a graphical control with extended DDE
capabilities. It is similar to the standard control Label but offers several additional
advantages:
• Minimal consumption of Windows resources:
"DDE Requests", "DDE Pokes" and "DDE Executes" use resources only
temporarily. With the DCTL.OCX control all DDE hotlinks in a Windows process
use only one Windows handle in total.
• Close cooperation with the NCDDE server:
For example, it supplies the LastError value in the event of failed DDE
transactions
• Higher speed:
Applications are speeded up because it allows multiple/parallel transactions
with a server.
• Faster output:
Optimized screen output and index filtering allows faster screen display.
Additionally it makes the BASIC programming easier.
• Avoiding side effects:
Typical side effects of Visual Basic controls like aborting programmed
connections by pressing the ESCAPE key can be avoided.
This section describes the features of this new control, followed by the additional
events. Finally, some examples illustrate the potential applications of DCTL.OCX.
Characteristics
Most properties of the DCTL.OCX control correspond to those of standard Visual
Basic controls. These accesses include:
• Style properties
• Color properties
• Base properties
• Drag properties
• Font properties.
DDE properties
The DDE properties include
LinkItem
LinkTopic (the default NCDDE)
LinkTimeout (for synchronizing LinkCmd).
HorAlignment property
This property controls the horizontal text justification of the caption display:
VertAlignment/
Multiline property
This property controls the vertical text justification of the caption display;
alternatively to a vertical text justification you can select multiline display.
In this case the word wrapping is determined by the WordBreak property:
WordBreak property
If the property VertAlignment/Multiline has been set Multiline (value = 3),
the property WordBreak determines the word wrapping:
TabSize property
This property defines the tab increment. The default value is 8 characters.
The value range can go up to 255.
LastError property
This property allows error messages to be sent.
The error variable LastError is reset (LastError = 0) when a DDE connection is
established with a server. When an error occurs during a transaction and DCTL
control detects this error, it then will ask for a detailed error code, that can be
accessed using the property LastError.
Note
The DCTL control does not decode errors which are transferred as data:
These include # characters and spaces from the NCDDE server.
The LastError variable for the DCTL control is described in more detail in section
11.7.1.
Data property
The Data property is used as an argument for the following DDE transactions:
DataToCaption property
The DataToCaption property determines the destination of data from a DDE
transaction.
LinkCmd property
Changes to the LinkCmd property initiate DDE activities in the DCTL control.
If there is no activity, LinkCmd = 0.
Actions
The actions used in the above table are:
Action (1)
An attempt is made to call the event procedure DdeNotify. If Visual Basic does not
call an event procedure at this point or if the parameter of the event procedure has
not been changed, the DCTL control tries ten times per second to send this event
as long as the parameter for the DdeNotify event procedure remains unchanged.
Action (2)
The DCTL control calls the DdeNotify event procedure when it receives a paint
message from WINDOWS. To ensure that these paint messages are created, the
pixel in the top left corner of the control is invalid as long as the parameter of
DdeNotify remains unchanged. In effect, this mechanism suppresses the display if
the control is not visible.
Note
New DDE activities should be started only after preceding DDE activities have
been terminated. This can be achieved using the parameter in the rightmost
column (terminated by) of the table.
The Hotlinks of all DCTL controls located in the same window share one DDE
connection if they use the same "LinkTopic" property. The DDE connections of the
other activities (excluding hotlink) are dynamically created and deleted. Because of
that and since a DCTL control does not have a window, the demand on WINDOWS
resources is reduced dramatically.
Note
Changing the LinkCmd property causes the LinkTopic, LinkTimeout and LinkItem
properties to be evaluated. This means that any errors in these values will
emerge when the LinkCmd property is changed. Therefore they must be
evaluated at this point.
LinkNext property
The optional property LinkNext holds the name and optionally the index of another
DCTL control.
If the LinkNext property is not empty, the DCTL control scans a string transmitted
via AdviseLink for the NCDDE index specifications (5 digits followed by 'a colon').
It separates the string into indexed substrings and forwards these along the
chained list of DCTL controls built up by the LinkNext properties. The control
whose LinkFilter property matches the index receives the corresponding substring.
Substrings not taken in this way get lost.
LinkFilter property
The value for LinkFilter can be between 0 and 65535. Its use is illustrated in the
LinkNext paragraph above.
Event DdeNotify
The DdeNotify event was created especially for DDE communication: It indicates
the arrival of new AdviseLink data or the conclusion of an asynchronous DDE
transaction. Details of application are described in the paragraph LinkCmd (actions
(1) and (2)).
Syntax
Sub ctlname_DdeNotify (Flag as integer)
with the argument Flag, which indicates to the DCTL control that the event has
actually arrived at the basic level.
The value of Flag is expected to change whenever the event procedure is called.
This is because the DCTL control continues to initiate the DdeNotify event until the
Flag argument changes. If this change does not take place, a cooperative
permanent activity results, that unnecessarily burdens the system.
Sub Form_Load ()
Dctl1.LinkItem = "/Channel/Parameter/R[1]" ’ the variable name
Dctl1.DataToCaption = TRUE ’that’s default, can be omitted
Dctl1.LinkCmd = 11 ’ commands the reading
' here Dctl1.Caption holds the value of the DDE variable
End Sub
Sub Form_Load ()
Dctl1.LinkItem = "/Channel/Parameter/R[1]" ’ the variable name
Dctl1.DataToCaption = FALSE ’ routing data to the Data property
Dctl1.LinkCmd = 11 ’ commands the reading
' here Dctl1.Data holds the value of the DDE variable
End Sub
Sub Form_Load ()
Dctl1.LinkItem = "/Channel/Parameter/R[1]" ’ the variable name
Dctl1.Data = 12 ’ the value
Dctl1.LinkCmd = 19 ’ commands the writing
' here the NC variable is already successfully set to 12
End Sub
Executing a command
A DDE command is to be transferred to a server. Then a LABEL type DCTL control
(e.g. named DCTL4) is to be positioned in a form. The associated code would then
look like this:
Error Handling
The typical error handling for reading, writing and executing is illustrated here.
Overview
Among other things, the testing functions of the NCDDE server give information on
the local and external variables that were declared in the NCDDE server at the time
the file was created. They are called as follows:
1. Start the NCDDE server in the SINUMERIK 840D MMC-OEM program group
2. Press ALT+TAB to switch to the NCDDE program, i.e. the NC communication
DDE server; an icon is created
3. Click the icon: The following window appears.
These functions are mainly intended for debugging in the environment of the
NCDDE server.
Hotlinks
Here a list is created which contains all existing Advise Links (Hotlinks and
Warmlinks). It is organized as a 5-column table with the following meanings:
Variables
Shows the variables to which the NCDDE server is linked and where they are
located: "LOCAL" or "PLC/NC".
Snapshot
Pressing this button creates a file named "NCDDE_X.TXT" that contains the status,
hotlinks and variables for the NCDDE server.
DDE test
Pressing this button starts a testing program "DDETEST.EXE" with the following
features
Variable NcState
The server makes known the state of its connection to the CNC via its local
variable NcState. This variable exists immediately after the server has been started.
It differs from the other local variables of the server only by the fact that it cannot
be modified via the DDE interface.
The variable can have one of the following states:
8.10.3 Troubleshooting
Overview
The multivariable service allows DDE access to multiple variables with a single
NCDDE job. This accelerates access to a number of single variables but can only
be used for read and write operations (not hotlinks).
As Item you should enter the items for the corresponding single variables/arrays,
separated by '|'. The data supplied in read access is tightly packed. As with array
access operations in the past, separators must be configured via format definitions
or via a new access modification (see section 8.12.3). In read access operations
the first character of the data supplied is interpreted as a separator for the
individual data blocks.
Limits
• A maximum of 8 tightly packed PDUs are sent per order. This means that
normally more than 100 individual access operations can be executed in a
single job. (The exact number must be determined by trial and error)
• The PDUs are all sent to a single destination address. This means that PLC
and NC access operations cannot be combined in a single job. In addition,
channel-specific access operations for different channels cannot be mixed.
(NC requirement). The same applies to access operations to drive-specific
variables.
• Only true variables (OPI interface/PLC BUB) can be addressed with the
multivariable service. This means that date and time, system status list,
directory information, etc., cannot be accessed.
• Note that the DDE item size is limited to 255 characters. If the item string
exceeds this size, the item must be specified indirectly (see section 8.12.2).
Example for writing and reading with the multivariable service
Item:
/channel/parameter/r[1,2](|"!l%ld")|/channel/parameter/r[10](|)
Data e.g.: |1|2|10.000000
Exec: NEW(x,“/channel/parameter/r[10]“)
Item: >x
Data e.g. 10.000000
Note
When writing variables and executing commands in the NCDDE server the data
length is restricted to 4KB. If this value is exceeded, error message 0X01050414
is returned.
'|' In CF_TEXT read access operations, inserts a '|' character in front of each data
item. This is not evaluated in write access operations (see the example
for the multivariable service in section 8.12.1).
'^' For a variable labeled in this way, hotlink disconnection (DEBA/DEBR) is
disabled.
Channel-specific global user variables exist once for each channel. They are
suitable for channel-specific settings and for data transfer between different
programs running in one channel.
The same applies to local user data. The same comments apply accordingly.
First of all you have to define and activate user variables before the NCDDE server
can access them. For clustering the variables you then have to create and
integrate the corresponding NSK files. This is done in five steps:
In the HMI:
A definition file for global variables with the file name MGUD.DEF, as can be
created in the HMI, is located in the directory C:\TMP, for example, and consists of:
• Definitions
• Terminating instruction M02, M17 or M30.
Note
This file must also be transferred from the HMI to the directory /_N_DEF_DIR
on the NCK. This is done with the domain service
COPY_TO_NC:COPY_TO_NC(C:\TMP\MGUD.DEF,/NC/_N_DEF_DIR/
Ä_N_MGUD_DEF,trans)
Note
Backup all programs, frames and machine data before you load the file
INITIAL.INI, since this reformats the static memory.
Note
The NSK file is generated in both binary format (*.MAP) and ASCII format
(*.NSK).
Note
You can find more details on how to create and apply user data in the Installation
and Start-up Guide /IAD/ and in the Programming Guide /PA/.
Additional functions
Using the online help for variables you can also
• Print topics
• Insert your own comments on each topic
• Define bookmarks for quickly finding the information most frequently needed.
Note
Comments on the online help for variables are stored in the file BTSS_VAR.ANN
(ANN is short for annex), the bookmark is located in the file WINHELP.BMK
(BMK is short for bookmark) in the WINDOWS directory.
8.15 Troubleshooting
8.15.1 Connection breakdown with NCK/PLC
• Connecting cable
• MPI drivers need to be installed
• Check MMC.INI
• WINSTART.BAT
• S7DPMPI.INI
Cause
For some commands the NCDDE server expects a connection to the NC to exist
already.
Solution
First create a hotlink to an NC variable.
A.3 Abbreviations
For notes
I Index
I
I.1 Keyword index
A I
E N
G Position Data.........................FBR/NPL/A-15
R S
WIN 9x/NT/2000/XP..........FBR/NFL/10-119
WinDev .............................FBR/NFL/10-118
Siemens AG Corrections
For Publication/Manual:
A&D MC MS
P.O. Box 3180 Motion Control Information System
Safety
SINUMERIK SINUMERIK Integrated SINUMERIK SINUMERIK SINUMERIK SINUMERIK
840D/810D 840D/840Di/ Application 840D/810D/ 840D/840Di/ 840D/840Di/ 840D/840Di/
810D Manual FM-NC 810D 810D 810D
Manufacturer/Service Documentation
SINUMERIK
SIMODRIVE SINUMERIK SINUMERIK SINUMERIK SINUMERIK SINUMERIK SINUMERIK
611D 840D/840Di/ 840D/840Di/ 840D/810D 840D/810D 840D/810D 840D/810D
840D/810D 810D 810D
Manufacturer/Service Documentation
MOTION
SINUMERIK SINUMERIK SINUMERIK SINUMERIK SINUMERIK CONTROL
SIMODRIVE SINUMERIK SIMODRIVE SIMODRIVE SIMODRIVE SIMODRIVE SYSTEMS
840D 840D/840Di 840D 840D
810D 611D 611D
611D