Generating the output file with CNC command #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.

Programming syntax

#EXPORT VE [ 3S | KW ]                      (non-modal)


PLC environment for 3S CODESYS:

Output file: plc_3s_ve_types_ch_<i>.exp


PLC environment for MULTIPROG:

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

#EXPORT VE [ 3S | TWINCAT | KW ] (non-modal)


For TwinCAT and the original 3S CODESYS PLC environment:

Output file: plc_3s_ve_types_ch_<i>.exp

Output directory:
see TwinCAT SystemManager CNC configuration - CNC task GEO - HLI tab - Entry box: NC file path


For MULTIPROG PLC environment:

Output file: plc_kw_ve_types_ch_<i>.exp

Output directory: application-specific (P-STUP-00020 or, as of Build V3.1.3052.05 and higher, with P-CHAN-00403)

If no output directory is specified for a TwinCAT configuration, the output file is placed in the following directory depending on the TwinCAT version:

This depends on whether the user has the appropriate write access rights to the directory.

With other operating systems the output directory can be configured in the start-up list by P-STUP-00020 or, as of Build V3.1.3052.05 and higher, also in the channel list by P-CHAN-00403.



The identifier <i> in the filename of the output file is a placeholder for the CNC channel number.



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.

Programing Example


Generate the output file

#EXPORT VE [TWINCAT] ;Generate the V.E. PLC structure for TwinCAT

#EXPORT VE [KW] ; Generate the V.E. PLC structure for MULTIPROG from KW

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.