Example: Reading parameters

Parameters can be read using the READ SDO service. For this purpose, the index and subindex of the parameter to be read must be known.

In the MOVISUITE® engineering software, the index is displayed in the tooltip of the parameter. The subindex is separated from the index number by a dot.

The SDO service is described in detail in an example. In the example, the service is carried out in a POWERLINK master from B&R Industrial Automation GmbH in the Automation Studio engineering tool.

Proceed as follows:

  • The ZIP file of the SEWLib function block is stored locally on the engineering PC and unpacked.
  1. Start the Automation Studio engineering tool and create a new Automation Studio project.
  2. In the System Designer, open the "Libraries" folder in the "Logical View" tab.
  3. Filter the toolbox for "Library" and open the "Existing library" entry. Navigate to the local storage location of the unpacked SEWLib function block.
  4. Click the [Finish] button.
  5. Create an instance of the FB_ParameterCoE_ReadWrite-GenC function block.
  6. Assign the following inputs of the function block (see Sample function block from SEW-EURODRIVE):
    • Interface
    • PLKStation
    • nIndex
    • nSubindex
    • nCoEService (enter the value "1" for this input.)
    • nAxisNumber
    • nByteSize
  7. To start the process, the xEnable input must detect a rising edge.
    • If all inputs are set correctly, the xInit output is set to "TRUE" and the read operation is performed.
    • If the xCoEDone output has the value "TRUE", access was successful and the actual value of the parameter is displayed in the nReadValue output.
    • If an error occurs when running the SDO service and you have set the xError_CoE output, the error information is displayed in the nErrId_ADS output.