Generating the output file (#EXPORT VE)
The NC command #EXPORT VE [..] generates the required data structure for the V.E. variables for the channel in which the command is used.
With multi-channel systems, the NC command must be used in each channel in order to generate the data structure for the particular channel.
![]() | The identifier <i> in the filename of the output file is a placeholder for the CNC channel number. |
Syntax: | |
#EXPORT VE [ 3S | TWINCAT | KW ] | |
3S / TWINCAT | For TwinCAT 2 and the original 3S CODESYS 2.3 PLC environment: Output file: plc_3s_ve_types_ch_<i>.exp For TwinCAT 3 and the original 3S CODESYS 3.5 PLC environment: Output file: plc_3s_ve_types_ch_<i>.xml Output directory:
|
KW | For MULTIPROG PLC environment: Output file: plc_kw_ve_types_ch_<i>.exp Output directory: application-specific (P-STUP-00020 or using P-CHAN-00403) as of V3.1.3052.05 and higher |
If no output directory is specified in a TwinCAT configuration, the output file is placed in the following directory depending on the TwinCAT version:
- TwinCAT 2 32-bit: Main directory C:\
- TwinCAT 3 64-bit: C:\Windows\SysWOW64
This is dependent on the corresponding write authorisations in each directory.
![]() | The call of the CNC command #EXPORT VE absolutely requires the specification of the PLC destination system as parameter. The result is named accordingly. An error message 20509 is output if the parameter is missing. |
Programming Example
Generate the output file
The command can be placed in an NC program or can be executed as a manual block. The command generates a file which is declared in a data structure compliant with IEC 61131-3 for all V.E variables created in the NC channel.
The generated file corresponds to the import/export format for the CODESYS or MULTIPROG development environments and can be imported there directly.
![]() | Additional structure declarations are required in the output file. |