# Interfacing

There are 2 options for interface connection (described below):

- Selection via HMI or via CNC objects
- Commands and display via HLI

## Commands via CNC objects

Visualisation can be parameterised and visualisation data can be queried using CNC objects.

All object accesses are made using the COM task. The individual data/parameters are accessed via the following index groups/offsets.

For the index group, the channel number must be used for the placeholder <c>, whereby <c> lies within [1; max. number of channels].

Parameter | Format: | Description | Index-Group | Index-Offset
mc_command_execution_mode_r, mc_command_execution_mode_w | UNS32 | Select nominal contour visualisation 0x0000 ISG_STANDARD Normal mode 0x0002 SOLLKON Nominal contour visualisation 0x0004 ON_LINE Online-Visu

0x0008 SYNCHK

Syntax check

0x2010<c>

c element [1; max. channel]

0x40,

0x3f

mc_contour_visu_grid_w mc_contour_visu_grid_r | UNS32 | Output grid for nominal contour visualisation for linear blocks (G00/G01) in [0.1 µm] | 0x2010<c> c element [1; max. channel] | 0x89, 0x8a
mc_contour_rel_curv_error_w | REAL64 | Maximum relative path error in [0.1%] for nominal contour visualisation of circles or polynomials | 0x2010<c> c element [1; max. channel] | 0x8b
mc_contour_abs_curv_error_w | REAL64 | Maximum absolute path error in [0.1 µm] for nominal contour visualisation of circles and polynomials | 0x2010<c> c element [1; max. channel] | 0x8c

## Notice

For curved contour elements (circles, polynomials), the parameter that results in the smallest output grid is used.

## Commands and display via HLI

Contour visualisation can be commanded and displayed via the HLI. The table below lists the parameters that must be assigned.

Channel operation mode
Description | Selects a special channel operation mode, e.g. syntax check or machining time calculation
Data type | MC_CONTROL_SGN32_UNIT, see description of Control Unit
Access | PLC reads request_r + state_r and writes command_w + enable_w
ST path | gpCh[channel_idx]^.decoder_mc_control.execution_mode
Commanded, requested and return values
ST element | .command_w .request_r .state_r
Data type | DINT
Value range | Value | Constant | Meaning
0x0000 | ISG_STANDARD | Normal mode
0x0001 | SV | Block search
0x0002 | SOLLKON | Nominal contour visualisation simulation with output of visualisation data
0x0802 | SOLLKON_SUPRESS_OUTPUT & SOLLKON | Nominal contour visualisation simulation without output of visualisation data
0x0004 | ON_LINE | Online visualisation simulation
0x0008 | SYNCHK | Syntax check simulation
0x0010 | PROD_TIME | Simulation machining time calculation (in TwinCAT without function)
0x0020 | ONLINE_PROD_TIME | Simulation online machining time calculation
0x0040 | MACHINE_LOCK | Dry run without axis motion
0x0080 | ADD_MDI_BLOCK | Extended manual block mode: the end of a manual block is not evaluated as a program end. It permits the commanding of further manual blocks.
0x0100 | KIN_TRAFO_OFF | Overwrites automatic enable for kinematic transformations by a characteristic parameter defined in the channel parameters (sda_mds*.lis).
0x1000 | BEARB_MODE_SCENE | When SCENE mode is enabled, the output of #SCENE commands is activated on the interface (see also [FCT-C17// Scene contour visualisation]). An additional client is linked to this output via DataFactory / CORBA.
0x2000 | SUPPRESS_TECHNO_OUTPUT | Without output of technology functions (M/H/T). Set implicitly in connection with syntax check.
0x10000 | SUPPRESS_POSITION_REQUEST | Fast program start without position request at program start
0x20000 | SUPPRESS_PROG_START_INIT | Suppress program start sequence for machining on the belt
Redirection
ST element | .enable_w

## Output

The visualisation data can be read via CNC objects.

Indexgroup | Index offset | Data type | Description
0x2010<c> | 0x2000 | SOLLKONT_VISU_PDU | Data record from channel-specific output buffer (FIFO).
0x2010<c> | 0x2001 | UNS32 | Number of data records in the channel-specific output FIFO
0x2010<c> | 0x2002 | SOLLKONT_VISU_PDU | Data record from global output FIFO
0x2010<c> | 0x2003 | UNS32 | Number of data records in the global output FIFO

The data package read has the following structure:

| SOLLKONT_VISU_PDU
SGN32 | count, number of structures SOLLKONT_VISU_DATA_V0 … SOLLKONT_VISU_DATA_V5 in the current message
UNS32 | Version identifier of visualisation data P-STUP-00039
SOLLKONT_VISU_DATA_V0 | v0[ MAX_SOLLKONT_VISU_DATA_COUNT_V0 - 1 ] Structure with visualisation data if P-STUP-00039 has the value 0.
or SOLLKONT_VISU_DATA_V1 | v1[ MAX_SOLLKONT_VISU_DATA_COUNT_V1 - 1 ] Structure with visualisation data if P-STUP-00039 hat the value 1.
or SOLLKONT_VISU_DATA_V2 | V2[ MAX_SOLLKONT_VISU_DATA_COUNT_V2 - 1 ] Structure with visualisation data if P-STUP-00039 hat the value 2.
or SOLLKONT_VISU_DATA_V3 | v3[ MAX_SOLLKONT_VISU_DATA_COUNT_V3 - 1 ] Structure with visualisation data if P-STUP-00039 hat the value 3.
or SOLLKONT_VISU_DATA_V4 | v4[ MAX_SOLLKONT_VISU_DATA_COUNT_V4 - 1 ] Structure with visualisation data if P-STUP-00039 hat the value 4.
or SOLLKONT_VISU_DATA_V5 | V5[ MAX_SOLLKONT_VISU_DATA_COUNT_V5 - 1 ] Structure with visualisation data if P-STUP-00039 hat the value 5.
or SOLLKONT_VISU_DATA_V6 | v6[ MAX_SOLLKONT_VISU_DATA_COUNT_V6 - 1 ] Structure with visualisation data if P-STUP-00039 hat the value 6.
or SOLLKONT_VISU_DATA_V7 | v7[ MAX_SOLLKONT_VISU_DATA_COUNT_V7 - 1 ] Structure with visualisation data if P-STUP-00039 hat the value 7.
or SOLLKONT_VISU_DATA_V8 | V8[ MAX_SOLLKONT_VISU_DATA_COUNT_V8 - 1 ] Structure with visualisation data if P-STUP-00039 has the value 8.
or SOLLKONT_VISU_DATA_V9 | V9[ MAX_SOLLKONT_VISU_DATA_COUNT_V9 - 1 ] Structure with visualisation data if P-STUP-00039 has the value 9.
or SOLLKONT_VISU_DATA_V10 | V10[ MAX_SOLLKONT_VISU_DATA_COUNT_V10 - 1 ] Structure with visualisation data if P-STUP-00039 has the value 10.
or SOLLKONT_VISU_DATA_V11 | V11[ MAX_SOLLKONT_VISU_DATA_COUNT_V11 - 1 ] Structure with visualisation data if P-STUP-00039 has the value 11.

| SOLLKONT_VISU_DATA_V0
SOLLKONT_VISU_CH_DATA_STD | Visu_data_std
SOLLKONT_VISU_ACHS_DATA_STD | Simu_achs_data_std[ANZ_SIMU_KOORD] Axis-specific visualisation data.

| SOLLKONT_VISU_DATA_V1
SOLLKONT_VISU_CH_DATA_STD | Visu_data_std
IF_FILE_NAME | File_name
SOLLKONT_VISU_ACHS_DATA_STD | Simu_achs_data_std[ANZ_SIMU_KOORD] Axis-specific visualisation data.

| SOLLKONT_VISU_DATA_V2
SOLLKONT_VISU_CH_DATA_V1 | Visu_data_v1
IF_FILE_NAME | Filename of the NC main program
SOLLKONT_VISU_ACHS_DATA_STD | Simu_achs_data_std[ANZ_SIMU_KOORD] Axis-specific visualisation data.

| SOLLKONT_VISU_DATA_V3
SOLLKONT_VISU_CH_DATA_STD | Visu_data_std
SOLLKONT_VISU_ACHS_DATA_V1 | Simu_achs_data_v1[ANZ_SIMU_KOORD] Axis-specific visualisation data.

| SOLLKONT_VISU_DATA_V4
SOLLKONT_VISU_CH_DATA_STD | Visu_data_std
IF_FILE_NAME | Filename of the NC main program
SOLLKONT_VISU_ACHS_DATA_V1 | Simu_achs_data_v1[ANZ_SIMU_KOORD] Axis-specific visualisation data.

| SOLLKONT_VISU_DATA_V5
SOLLKONT_VISU_CH_DATA_V1 | Visu_data_v1
IF_FILE_NAME | Filename of the NC main program
SOLLKONT_VISU_ACHS_DATA_V1 | Simu_achs_data_v1[ANZ_SIMU_KOORD] Axis-specific visualisation data.

| SOLLKONT_VISU_DATA_V6
SOLLKONT_VISU_CH_DATA_STD | Visu_data_std
SOLLKONT_VISU_ACHS_DATA_V2 | Simu_achs_data_v2[ANZ_SIMU_KOORD] Axis-specific visualisation data.

| SOLLKONT_VISU_DATA_V7
SOLLKONT_VISU_CH_DATA_STD | Visu_data_std
IF_FILE_NAME | Filename of the NC main program
SOLLKONT_VISU_ACHS_DATA_V2 | Simu_achs_data_v2[ANZ_SIMU_KOORD] Axis-specific visualisation data.

| SOLLKONT_VISU_DATA_V8
SOLLKONT_VISU_CH_DATA_V1 | Visu_data_v1
IF_FILE_NAME | Filename of the NC main program
SOLLKONT_VISU_ACHS_DATA_V2 | Simu_achs_data_v2[ANZ_SIMU_KOORD] Axis-specific visualisation data.

| SOLLKONT_VISU_DATA_V9
SOLLKONT_VISU_CH_DATA_V2 | Visu_data_v2
IF_FILE_NAME | Filename of the NC main program
SOLLKONT_VISU_ACHS_DATA_STD | Simu_achs_data_std[ANZ_SIMU_KOORD] Axis-specific visualisation data.

| SOLLKONT_VISU_DATA_V10
SOLLKONT_VISU_CH_DATA_V2 | Visu_data_v2
IF_FILE_NAME | Filename of the NC main program
SOLLKONT_VISU_ACHS_DATA_V1 | Simu_achs_data_v1[ANZ_SIMU_KOORD] Axis-specific visualisation data.

| SOLLKONT_VISU_DATA_V11
SOLLKONT_VISU_CH_DATA_V2 | Visu_data_v2
IF_FILE_NAME | Filename of the NC main program
SOLLKONT_VISU_ACHS_DATA_V2 | Simu_achs_data_v2[ANZ_SIMU_KOORD] Axis-specific visualisation data.

| SOLLKONT_VISU_CH_DATA_STD
SGN32 | nc_satz_nr, block number in the NC program
SGN32 | fileoffset, file offset from file start in bytes >= 0 : valid data offset when program is active == -1 : Offset not valid since no program is active
UNS16 | channel_nr, channel number
SGN16 | g_function >= 0 : G function : G0, G1, G2, G3, G61 for polynomial blocks == -1 : no G function active
UNS32 | circle_radius, radius in [0.1 µm] for G2 / G3 blocks
REAL64 | circle_center_point[2] Absolute position of circle centre point in the active machining plane (G17,G18,G19) in [0.1 µm] for G2 / G3 blocks (as of CNC Build V2.10.1032.03 and V2.10.1505.05)

| SOLLKONT_VISU_CH_DATA_V2
SGN32 | Nc_satz_nr, block number in the NC program
SGN32 | fileoffset, file offset from file start in bytes >= 0 : valid data offset when program is active == -1 : Offset not valid since no program is active
UNS16 | channel_nr, channel number
SGN16 | g_function >= 0 : G function : G0, G1, G2, G3, G61 for polynomial blocks == -1 : no G function active
UNS32 | circle_radius, radius in [0.1 µm] for G2 / G3 blocks
REAL64 | circle_center_point[2] Absolute position of circle centre point in the active machining plane (G17,G18,G19) in [0.1 µm] for G2 / G3 blocks (as of CNC Build V2.10.1032.03 and V2.10.1505.05)
SGN32 | vb_prog, programmed path velocity
SOLLKONT_VISU_DATA_TECHNO_V1 | Techno_v1, technology information
UNS32 | Fillup (alignment data)

| SOLLKONT_VISU_DATA_TECHNO_V1
UNS16 | Axis_number, axis number of the axis to which technology information was output. An axis number of 0 means that technology information was output to the channel interface
UNS16 | Fillup, used to force structure alignment
UNS32 | m_h_count, number of assigned entries in the vector m_h_data[]
SOLLKONT_M_H_PROCESS_V1 | M_h_data_v1[MAX_M_H_DATA] Vector containing information about M/H functions
UNS32 | S_count, number of entries in the vector s_proc[]
SOLLKONT_S_PROCESS | s_proc[] Vector containing information about spindle functions
SGN32 | vb_prog, programmed path velocity

## Notice

Data offset indicates whether a program is being edited or was terminated.

An invalid G function (-1) is triggered by an NC line containing an M function, for example.

| IF_FILE_NAME
ISG_CHAR | file_name[128] Filename of the current NC program. To obtain the additional output of the filename, the version identifier of the display data “contour_visu_ifc_version” (P-STUP-00039) must be set to the value 1, 2, 4, or 5 (as of CNC Build V2.10.1032.08 and V2.10.1507. 06).

| SOLLKONT_VISU_ACHS_DATA_STD
SGN32 | Akt_sollwert, current command position of the axis in [0.1 µm]
UNS16 | Log_achs_nr, logical axis number
UNS16 | <alignment bytes>

| SOLLKONT_VISU_ACHS_DATA_V1
SGN32 | Akt_sollwert, current command position of the axis in [0.1 µm]
SGN32 | Akt_sollwert_wcs0, current command position of the axis in the WCS0 system in [0.1 µm]. This value is only calculated if channel parameter P-CHAN-00145 has the value 1 and the channel parameter P-CHAN-00032 is assigned a value > 0.
UNS16 | Log_achs_nr, logical axis number
UNS16 | <alignment bytes>

| SOLLKONT_VISU_ACHS_DATA_V2
SGN32 | Akt_sollwert, current command position of the axis in [0.1 µm]
SGN32 | Akt_sollwert_wcs0, current command position of the axis in the WCS0 system in [0.1 µm]. This value is only calculated if channel parameter P-CHAN-00145 has the value 1 and the channel parameter P-CHAN-00032 is assigned a value > 0.
SGN32 | Akt_sollwert_wcs, current command position of the axis in the WCS system in [0.1 µm]. This value is only calculated if channel parameter P-CHAN-00145 has the value 1 and the channel parameter P-CHAN-00032 is assigned a value > 0.
UNS16 | Log_achs_nr, logical axis number
UNS16 | <alignment bytes>

| SOLLKONT_VISU_CH_DATA_V1
SGN32 | Nc_satz_nr, block number in the NC program
SGN32 | fileoffset, file offset from file start in bytes >= 0 : valid data offset when program is active == -1 : Offset not valid since no program is active
UNS16 | channel_nr, channel number
SGN16 | g_function >= 0 : G function : G0, G1, G2, G3, G61 for polynomial blocks == -1 : no G function active
UNS32 | circle_radius, radius in [0.1 µm] for G2 / G3 blocks
REAL64 | circle_center_point[2] Absolute position of circle centre point in the active machining plane (G17,G18,G19) in [0.1 µm] for G2 / G3 blocks (as of CNC Build V2.10.1032.03 and V2.10.1505.05)
SGN32 | vb_prog, programmed path velocity
SOLLKONT_VISU_DATA_TECHNO | techno, technology information

| SOLLKONT_VISU_DATA_TECHNO
UNS16 | Axis_number, axis number of the axis to which technology information was output. An axis number of 0 means that technology information was output to the channel interface
UNS16 | Fillup, used to force structure alignment
UNS32 | m_h_count, number of assigned entries in the vector m_h_data[]
SOLLKONT_M_H_PROCESS | M_h_data[MAX_M_H_DATA] Vector containing information about M/H functions
UNS32 | S_count, number of entries in the vector s_proc[]
SOLLKONT_S_PROCESS | s_proc[] Vector containing information about spindle functions
SOLLKONT_TOOL_ID | Tool, information about the current valid tool number

| SOLLKONT_M_H_PROCESS
UNS32 | nr, number of the M/H function
UNS32 | sync, synchronisation type of the M/H function, see [CHAN// Configuration of PLC functions]
UNS32 | type, 1 = M function, 2 = H function

| SOLLKONT_S_PROCESS
UNS16 | Ax_nr, axis number of the spindle axis
UNS16 | Cmd, spindle command: |
Value | Command
3 | M3
4 | M4
5 | M5
19 | M19
UNS32 | Sync, synchronisation type of the spindle function
SGN32 | Position; target position in 0.1 µm if position moves
SGN32 | Revolution, command speed of the spindle in 10E-3°/s or µm/s.

| SOLLKONT_TOOL_ID
SGN32 | Basic, basic number of the tool
SGN32 | Sister, sister number of the tool, -1 means unassigned.
SGN32 | Variant, variant number of the tool, -1 means unassigned.

| SOLLKONT_M_H_PROCESS_V1
UNS32 | nr, number of the M/H function
UNS32 | sync, synchronisation type of the M/H function, see [CHAN// Configuration of PLC functions]
UNS32 | type, 1 = M function, 2 = H function
SGN32 | Add_value, additional value programmed in M/H function.

## Constants

Constant | Value
MAX_SOLLKONT_VISU_DATA_COUNT_V0 | 15
MAX_SOLLKONT_VISU_DATA_COUNT_V1 | 10
MAX_SOLLKONT_VISU_DATA_COUNT_V2 | 5
MAX_SOLLKONT_VISU_DATA_COUNT_V3 | 10
MAX_SOLLKONT_VISU_DATA_COUNT_V4 | 7
MAX_SOLLKONT_VISU_DATA_COUNT_V5 | 4
MAX_SOLLKONT_VISU_DATA_COUNT_V6 | 7
MAX_SOLLKONT_VISU_DATA_COUNT_V7 | 6
MAX_SOLLKONT_VISU_DATA_COUNT_V8 | 4
MAX_SOLLKONT_VISU_DATA_COUNT_V9 | 5
MAX_SOLLKONT_VISU_DATA_COUNT_V10 | 4
MAX_SOLLKONT_VISU_DATA_COUNT_V11 | 3
ANZ_SIMU_KOORD | 32
MAX_M_H_DATA | 20
MAX_SPINDLE_DATA | 6

## Datentypen

Data type | C Datentyp | Description
SGN16 | signed short | Signed 16 bit integer
UNS16 | unsigned short | Unsigned 16 bit integer
SGN32 | signed long | Signed 32 bit integer
UNS32 | unsigned long | Unsigned 32 bit integer
REAL64 | double | 64-bit floating point number
ISG_CHAR | char | 8-bit text character