File Management
File Management functions A function calculates a result according to the current value of its inputs. A function has no internal data and is not linked to declared instances. provide the ability to:
- Read machine The complete assembly of all connected parts or devices, of which at least one is movable. recipes or other machine operational data into the KAS Kollmorgen Automation Suite program The act of performing a sequence of instructions or commands. from the SD card, USB Universal Serial Bus - A serial bus standard to interface devices. flash drive In electrical engineering, a drive is an electronic device to provide power to a motor or servo. Control device for regulating the speed, torque and position of a motor. A unit controlling a motor using the current and timing in its coils., or a shared directory.
- Read cam tables into the program from the SD card, USB flash drive, or a shared directory.
- Store machine operational data on internal PxMM or PCMM2G flash memory (retrievable through the Web server), the SD card, USB flash drive, or a shared directory.
-
A shared directory connection is setup through the Web server.
-
-
- Functions to parse out information from a file using a string format can be found in String Operations.
- If the file is in a .CSV Comma-separated values - The CSV file format is a file type that stores tabular data. format, these functions can be used: LogFileCSV, ApplyRecipeColumn.
- You can create, store, and retrieve recipes and other data using either:
- the AKI Terminals. For more information see the KVB Kollmorgen Visual Builder for HMI manual.
- an external bus connection to the PxMM or PCMM2G with a supported fieldbus An industrial network system for real-time distributed control (e.g., CAN or PROFIBUS, Sercos®). It is a way of connecting instruments in a plant design. (e.g., UDP User Datagram Protocol or HTTP).
Sequential Read / Write Function Blocks
Name |
Description |
---|---|
Closes an open file. |
|
Copies a file's contents to a new file. |
|
Removes a file from the file system. |
|
Test if the end of the file is reached in a file that is open for reading. |
|
Tests if a file exists. |
|
Create or open a file in append mode. |
|
Open a file for reading. |
|
Create or reset New start of the microprocessor. a file and open it for writing. |
|
Read binary data from a file. |
|
Reads a string value from a text file. |
|
Renames a file. |
|
Gets the size of a file. |
|
Write binary data to a file. |
|
Writes a string value to a text file. |
SD card Functions
These functions handle mounting of SD cards:
Name |
Use |
---|---|
Verify the SD card is mounted. |
|
Mount the SD card. |
|
Unmount the SD card. |
Each file is identified in the application by a unique handle manipulated as a DINT value.
- The file handles are allocated by the target system.
- Handles are returned by the Open function blocks and used by all other function blocks for identifying the file.
Related Function Blocks
LogFileCSV log values of variables to a CSV file
-
-
- Files are opened and closed directly The orientation components of a vector in space. by the Operating System of the target.
- Verify each file successfully opened using FileOpenA, FileOpenR, and FileOpenW.
- The FileOpenW has a corresponding FileClose to close the file.
- Closing the file releases the file ID, making it available for operations on other files.
-
-
- Opening a file with FileOpenA, FileOpenR, and FileOpenW can be unsuccessful (invalid path Set of continuous positions and orientation information in multi-dimensional space.
Geometrical description of a space curve that the TCP of an axesgroup moves along. or file name, too many open files.)
- Your application must check the file ID for a NULL value.
- If the file ID is NULL (zero), then file read or write operations will fail.
- File management may be unavailable on some targets.
- Memory on the SD card is available in addition to the existing flash memory.
- Valid paths for storing files depend on the target implementation.
- Error messages are logged in the Controller log section of KAS Runtime In computer science, runtime (or run-time) describes the operation of a computer program, the duration of its execution, from beginning to termination (compare compile time). In KAS, runtime refers to the virtual machine that manage the program written in a computer language while it is running. where there is a failure in any related function block.
- Using the KAS Simulator, all path names are ignored, and files are stored in a reserved directory. Only the file name passed to the Open functions is taken into account.
- AKD PDMM / PCMM files are big endian.
- PCMM2G files are little endian.
- Opening a file with FileOpenA, FileOpenR, and FileOpenW can be unsuccessful (invalid path Set of continuous positions and orientation information in multi-dimensional space.
Geometrical description of a space curve that the TCP of an axesgroup moves along. or file name, too many open files.)
-
- Review the File Path Conventions to understand hardware-based functional differences.