Exchnge

From IPLOG
Jump to: navigation, search

Back to Libraries

Exchange library

Filesystem

These FBs allows to export or import values between IEC61131-3 program variables and filesystem.

Exported values are stored in:

  • PERM = 0: /tmp/metel/iec_61131-3/export/
  • PERM = 1: /usr/local/metel/iec_61131-3/export

Imported values are primarily read from the temporary location /tmp/metel/iec_61131-3/import/. If this value is not found in the temporary location, it is searched in the permanent location /usr/local/metel/iec_61131-3/export.

Filename is composed as datatype.name

Reading and writing is proceed inside of program cycle, right at the moment, when it is called!

Each imported value should be called only once in each cycle, else it is possible to read different values in several calls.

To more precise timing of read and write to files, MEMORY AT variables should be used.

FS_EXPORT_BOOL

Exports boolean value to file

in NAME string name of exported value
in VALUE bool value to export
in PERM bool 0 - until reboot, 1 - permanent
out ERR bool indicates some error occurs (0 = OK)
out ERR_ID uint identifies occured error by unique code

FS_EXPORT_INT

Exports signed integer value to file

in NAME string name of exported value
in VALUE int value to export
in PERM bool 0 - until reboot, 1 - permanent
out ERR bool indicates some error occurs (0 = OK)
out ERR_ID uint identifies occured error by unique code

FS_EXPORT_UINT

Exports unsigned integer value to file

in NAME string name of exported value
in VALUE uint value to export
in PERM bool 0 - until reboot, 1 - permanent
out ERR bool indicates some error occurs (0 = OK)
out ERR_ID uint identifies occured error by unique code

FS_EXPORT_REAL

Exports real integer value to file

in NAME string name of exported value
in VALUE real value to export
in PERM bool 0 - until reboot, 1 - permanent
out ERR bool indicates some error occurs (0 = OK)
out ERR_ID uint identifies occured error by unique code

FS_EXPORT_STRING

Exports string value to file

in NAME string name of exported value
in VALUE string value to export
in PERM bool 0 - until reboot, 1 - permanent
out ERR bool indicates some error occurs (0 = OK)
out ERR_ID uint identifies occured error by unique code

FS_IMPORT_BOOL

Imports boolean value from file

in NAME string name of value to import
out ERR bool indicates some error occurs (0 = OK)
out ERR_ID uint identifies occured error by unique code
out VALUE bool imported value

FS_IMPORT_INT

Imports signd integer value from file

in NAME string name of value to import
out ERR bool indicates some error occurs (0 = OK)
out ERR_ID uint identifies occured error by unique code
out VALUE int imported value

FS_IMPORT_UINT

Imports unsigned integer value from file

in NAME string name of value to import
out ERR bool indicates some error occurs (0 = OK)
out ERR_ID uint identifies occured error by unique code
out VALUE uint imported value

FS_IMPORT_REAL

Imports real value from file

in NAME string name of value to import
out ERR bool indicates some error occurs (0 = OK)
out ERR_ID uint identifies occured error by unique code
out VALUE real imported value

FS_IMPORT_STRING

Imports string value from file

in NAME string name of value to import
out ERR bool indicates some error occurs (0 = OK)
out ERR_ID uint identifies occured error by unique code
out VALUE string imported value