Tools

Siemens AGSiemens AG

Site ExplorerSite Explorer
Close site explorer

Output on an external device

Archiving the machining parameters

Production with CNC machine tools requires a large quantity of measurement data and parameters to guarantee the quality and verify the production in accordance with the legal requirements. This applies particularly to the medical technology and aircraft construction sectors. Both sectors are confronted with very high demands on quality and the accountability for the manufactured parts over decades.

In order to prevent the loss of machining parameters during the production process, the EXTOPEN, WRITE and EXTCLOSE high-level language elements can be used to archive the machining parameters, for example, to safeguard the production. Archiving using a log file is possible in all machining channels of the NCK for all of the available output devices at the machine.

The example below should provide users with an application to output data at an external device using the EXTOPEN, WRITE and EXTCLOSE high-level language elements.

EXTOPEN/WRITE/EXTCLOSE

Writing data from the part program to a predefined device outside the NCK using language commands is possible using the high-level language elements WRITE. For example, in order that production of measurement data can be backed up or measurement data logged, the WRITE high-level language element must be used in conjunction with the EXTOPEN command.

In this combination, EXTOPEN initiates that the external, predefined device is opened before the data or data sets are read out using WRITE and written to the target folder. After the data have been successfully output on the external device, the operation is terminated using EXTCLOSE, when the end of the program is reached M30 or for a "Channel reset". For instance, files on a local CompactFlash card are considered as external devices or files.

Structure of programming command

Output to an external device/file is realized in 3 steps.

  1. Open the external device/file
    An external device/file is opened for the channel for writing using the EXTOPEN command.

  2. Data are written
    The WRITE command is used for writing

  3. Closing the external device/file
    The device/file is released again using the EXTCLOSE command or when the end the program (M30) is reached.


Syntax

The EXTOPEN, WRITE and EXTCLOSE commands are structured as following:

DEF INT <error>
DEF STRING[<n>] <output>

EXTOPEN (<error>,“<ExtG>“,<processing mode>,<use mode>,<write mode>)

<output>="output data"
WRITE(<error>,“<ExtG>“,<output>)

EXTCLOSE(<error,“<ExtG>“)

Command

Description

STRING

Character string of a defined length

EXTOPEN

Command to open an external device/file

<error>

Variable for returning the error value

<ExtG>

Symbolic identifier for the external device to be opened

<processing mode>

Processing mode for the write commands to this device

<use mode>

Use mode for this device (shared/exclusive)

<write mode>

"O" = Overwrite, "A" = Append

WRITE

Command for attaching a block or data to the end of a specified file.

<error>

Variable for returning the error value.

<file name>

The name of the file in the passive file system in which the specified block or specified data is to be added.

<ExtG>

A symbolic identifier must be specified for the external device to be opened.

<data/block>

The block or data that is to be added to the specified file.

EXTCLOSE

Command to close an external device/file that has been opened

<error>

Variable for returning the error value

<ExtG>

Symbolic identifier for the external device/file to be closed


Further information

The programms and the documentation are available at the Siemens Support-Portal:


2014-11-13 | Author: Name