Configuring Devices Via the Service Channel
The Sercos master can use the Service Channel (SVC) to read and write IDNs and procedure commands. Communication via the SVC uses the real-time channel, but it is non-cyclic. The typical execution time of a 4-byte parameter is approximately 10 Sercos cycles. Depending on the availability of the SVC, the execution time can be considerably longer. Since it is possible to queue up to 20 procedure commands and IDN read and write operations in a common buffer, a given procedure command or IDN read or write operation may take an extended time to finish.
Refer to Non-Cyclic Sercos Communication Via the RTC for details on the SVC and to the section Sercos Parameters for details in IDNs and procedure commands.
Reading and Writing Procedure Commands
Procedure commands are executed asynchronously. This means that calling a procedure command does not block the task. You must read the status of the procedure command if you want to know if the procedure command has terminated.
There are two ways of executing a procedure command:
oVia FC_ExecuteProcedureCommandAsync with input parameters topology address and IDN
oVia FC_ExecuteProcedureCommandAsyncViaHandle with input parameters handle and IDN
Possible return values:
DINT |
Name (ET_Result) |
Description |
---|---|---|
0 |
Ok |
Procedure command executed. |
8 |
Pending |
Procedure command waiting for execution. |
-1 |
DeviceManagerInvalidDeviceHandle |
Procedure command cannot be executed. Only for call via handle. |
-2 |
DeviceManagerNoPhysicalSlaveConnected |
Procedure command cannot be executed. |
-11 |
TopologicalAddressOutOfBounds |
Procedure command cannot be executed. Only for call via topological address. |
-15 |
ServiceChannelIdnInvalid |
Procedure command cannot be executed. |
-43 |
ServiceChannelBusy |
Procedure command cannot be executed. |
-99 |
UnexpectedFeedback |
Procedure command cannot be executed. |
There are two ways of reading the status of a procedure command:
oVia FC_ReadProcedureCommandAsync with input parameter topology address
oVia FC_ReadProcedureCommandAsyncViaHandle with input parameter handle
The return values are the same as for executing a procedure command. The call returns the status of the procedure command being processed. If no procedure command is being processed, the call returns the status of the next procedure command in the queue. A procedure command is finished if the return value is not 8.
Reading or writing a parameter is performed asynchronously. This means that the task is not blocked.
Use the function block FB_WriteIDN to write a parameter and the function block FB_ReadIDN to read the values of a parameter.
The timeout is one of the input parameters for FB_WriteIDN and FB_ReadIDN. The default value for the timeout is 1000000 µs (1 s). The timeout starts to run when the read or write command is triggered, not when it is started in the queue. depending on the number of items in the queue and the time required to process these items, it may be possible that a read or write command reaches its timeout even before it is started to be processed.