FC_AppendToWriteFile - General Information

Overview

Type:

Function

Available as of:

SystemInterface_1.32.6.0

Versions:

Current version

Task

Open the file to append data. The file is opened with writing- and reading rights.

NOTE: The operating system on the PacDrive III controller allows opening a file multiple times at the same time. When opening a file the complete content of the file is loaded into the memory and referenced via a file ID.

Via the file ID the content can be processed and the file can be closed.

When closing the file the (maybe changed) content is transferred to the file on the drive from the memory.

NOTE: If a file is opened and edited multiple times, then the content of the last file closed (last released file ID) is saved after closing all the file versions. Any modifications from other opened versions are overwritten.
NOTICE
LOSS OF DATA
Do not open a file multiple times.
Failure to follow these instructions can result in equipment damage.

Description

This function opens a file (i_sFilename) to append data. The writing- or reading indicator is set to the file end.

If the file could not be opened (error detected), the function returns the value -1. If the file does not exist, the function creates it.

The standard device is "ide0:". i_sFilename can be a short standard name or a complex name. A default name consists of one to eight characters (A ... Z, 0 ... 9). The device name "ide0:" and the file name extension ".dat" are appended by the system. A complex name consists of device name, file name, and file name extension.

NOTE: The processing time of this function is a few hundred milliseconds. There must be a one-time increase in the times for the cycle check of the task in which the function is executed. For example FC_CycleCheckTimeSet(500, 2).

If you try to open a system file that is not editable with this function, then you get -5 as the return value (see below). The system file is not being opened.

Controller-specific system files

System file

Meaning

Protection

PacDrive LMC Eco

  • ESYSTEM/BOOTC4.SYS

Boot loader

Not editable / not deletable

PacDrive LMC Pro

  • ESYSTEM/BOOTC3.SYS

Boot loader

Not editable / not deletable

PacDrive LMC Pro2

  • ESYSTEM/BOOTC5.SYS

Boot loader

Not editable / not deletable

General system files

System file

Meaning

Protection

ESYSTEM/SYSC3.CFG

Firmware configuration file

Editable, but not deletable

ESYSTEM/3S.DAT

3S

Not editable / not deletable

ESYSTEM/FBUSFW/CIFXRCX.NXF

Fieldbus firmware

Not editable / not deletable

ESYSTEM/FBUSFW/COMXRCX.NXF

Fieldbus firmware

Not editable / not deletable

ESYSTEM/FBUSFW/COM_XC1.NXO

Fieldbus firmware

Not editable / not deletable

ESYSTEM/FBUSFW/COM_XC2.NXO

Fieldbus firmware

Not editable / not deletable

ESYSTEM/FBUSFW/DPM_XC0.NXO

Fieldbus firmware

Not editable / not deletable

ESYSTEM/FBUSFW/DPM_XC2.NXO

Fieldbus firmware

Not editable / not deletable

ESYSTEM/FBUSFW/DPS_XC0.NXO

Fieldbus firmware

Not editable / not deletable

ESYSTEM/FBUSFW/DPS_XC2.NXO

Fieldbus firmware

Not editable / not deletable

ESYSTEM/FBUSFW/NETX100-BSL.BIN

Fieldbus firmware

Not editable / not deletable

ESYSTEM/FBUSFW/NX100EIM.NXO

Fieldbus firmware

Not editable / not deletable

ESYSTEM/FBUSFW/NX100EIS.NXO

Fieldbus firmware

Not editable / not deletable

ESYSTEM/FBUSFW/NX100PNM.NXO

Fieldbus firmware

Not editable / not deletable

ESYSTEM/FBUSFW/NX100ETH.NXO

Fieldbus firmware

Not editable / not deletable

ESYSTEM/FBUSFW/NX100PNS.NXO

Fieldbus firmware

Not editable / not deletable

ESYSTEM/FBUSFW/NX100S3S.NXO

Fieldbus firmware

Not editable / not deletable

ESYSTEM/FBUSFW/NX100ECM.NXO

Fieldbus firmware

Not editable / not deletable

ESYSTEM/FBUSFW/NX100ECS.NXO

Fieldbus firmware

Not editable / not deletable

ESYSTEM/LANGUAGES/ENGLISH.XML

Languages

Not editable / not deletable

ESYSTEM/LANGUAGES/GERMAN.XML

Languages

Not editable / not deletable

ESYSTEM/OPCUA/PKI/ISSUER/DONOTDELETE.TXT

OPC UA

Not editable / not deletable

ESYSTEM/OPCUA/PKI/OWN/DONOTDELETE.TXT

OPC UA

Not editable / not deletable

ESYSTEM/OPCUA/PKI/REJECTED/DONOTDELETE.TXT

OPC UA

Not editable / not deletable

ESYSTEM/OPCUA/PKI/TRUSTED/DONOTDELETE.TXT

OPC UA

Not editable / not deletable

ESYSTEM/OPCUA/SERVERCONFIG.INI

OPC UA

Not editable / not deletable

ESYSTEM/PROJECT/PROJECTDATA.XML

Project

Not editable / not deletable

Interface

Input

Data type

Description

i_sFilename

STRING[80]

Name of the file to which data is to be attached.

Return Value

Data type

Description

DINT

FileID: Indication number of an opened file <1000000-1000009>

-1: File could not be opened (error detected)

-2: Too many files open

-5: Trying to open a system.