Sample: FirstNciSample
Overview
The example FirstNciSample shows how an NC program is loaded from the PLC and processing is triggered.
Amongst other activities, this includes
- the creation of an interpolation group
- loading an NC program (parts program)
- starting the NC program
- acknowledging M-functions
- dissolving the interpolation group
Further information on the function blocks used can be found in sections PLC Library: NC Configuration and PLC Library: NCI Interpreter.
Installing the sample program
The file FirstNciSample.exe is self-extracting and can be copied to any directory.
After successful unpacking of the data, the directory contains the following files:
- FirstNciSample.pro (PLC program)
- FirstNciSample.tsm (configuration file for the TwinCAT System Manager)
- ScopeFirstNciSample.scp (configuration file for TwinCAT Scope)
- TestIt.nc (sample NC program)
Starting the sample program
- 1. Copy TestIt.nc into the TwinCAT\CNC directory (otherwise the parts program will not be found during loading). Alternatively adjust the path in the PLC program.
- 2. Compile the PLC project FirstNciSample.pro
- 3. Open FirstNciSample.tsm and activate the configuration
- 4. Set PLC to run mode
- The NC program will now be executed once. The scope configuration ScopeFirstNciSample.scp can be used to log the positions and velocities.
To execute the NC program again, use the variable bExec in the main part of the PLC to trigger the execution.
Download
Installing FirstNciSample