Display of the parts program
Reading of the current NC line via ADS
This ADS Read command returns a maximum of 3 lines of the current parts program, i.e. the current line of code and perhaps two previously processed lines.
Function |
ADS-Read |
Port |
500 (dec) |
Index Group |
0x2300 + channel ID |
Index Offset |
0x2000 0001 |
Data |
string (30 bytes min.) |
Reading of the current program name
This ADS Read command returns the program name of the current main NC program (in this case 1_1.nc).
Function |
ADS-Read |
Port |
500 (dec) |
Index Group |
0x2100 + channel ID |
Index Offset |
0x7 |
Data |
string, 100 characters max. |
Reading of the current file information
from TwinCAT V2.10, Build 1243
In contrast to the 'Reading the current NC line' function, in this case not the line itself is read, but associated line information. The return value is the current program name (e.g. file name of the subroutine) and a file offset. Based on this information, the user interface can open the associated file and highlight the respective line. The display is no longer limited to 3 rows, i.e. any number of lines can be displayed.
In the event of an NCI load or run-time error, information about the associated line of code can be obtained via this route.
Function |
ADS-Read | |
Port |
500 (dec) | |
Index Group |
0x2100 + channel ID | |
Index Offset |
0x12 | |
Data |
UINT32 |
Current display of |
UINT32 |
File offset | |
char[260] |
path + program name |