TwinCAT System Service
The TwinCAT System Service offers an interface for the TwinCAT server for Windows NT services. At present, data access and "System Shutdown" are supported. Refer to the documentation for the ADS DLL and for the ADS OCX for further explanations of ADS services.
File access
Files can be opened or closed, read, and written via ADS index group and ADS index offset. The index groups and index offsets are described below.
Process | Description |
---|---|
Open/create file
Indexgroup: Indexoffset: | The stated file is opened for read and write access. If the file does not exist, a file is created and opened. If the file exists, it is opened, and the contents are deleted. ADS Service: ADS Write |
Opening file for reading
Indexgroup: Indexoffset: | The stated field is opened for read access. If the file does not exist, the service returns the value -1. |
Opening file for writing
Indexgroup: Indexoffset: | The stated file is opened for read and write access. If the file does not exist, the service returns the value -1. If the file exists. it is opened and the contents are deleted. In the event of an error: -1 |
Close file
Indexgroup: Indexoffset: | The file which belongs to the File Handle is closed. It must be noted that the data length for this service must be 0! |
Write data to file
Indexgroup: Indexoffset: Seek Offset in byte | The number of bytes stated in the data length is written to the file. If an index offset is not equal to -1, the index offset is interpreted as the offset in the file. |
Read data from file Indexgroup: Indexoffset: Seek Offset in byte | The number of bytes stated in the data length is read from the file. If the index offset is unequal to -1, the index offset is interpreted as the offset in the file. With a data length of 0, only the file indicator in the file is offset by the value in the index offset. |
System shutdown | ADS WriteControl enables the TwinCAT System Service to be instructed to shut down the operating system. |