FB_AX2000_Parameter

FB_AX2000_Parameter 1:

Reading/writing the parameters via the parameter channel.

VAR_INPUT

VAR_INPUT
    iSlaveAddress   : BYTE := 0;(* Station Address of the Slave *)
    iPnu            : WORD := 16#03A2;(* Parameter-Number *)
    nAxis           : BYTE := 1;(* Number of Axis *)
    iLength         : BYTE := 4;(* Length of the parameter (2 or 4) *)
    iParameterValue : DWORD := 2;(* Parameter value *)
    iFC310xDeviceId : WORD := 1;(* Device-ID of the FCxxxx *)
    bStartRead      : BOOL;(* StartFlag to start the PKW-Read *)
    bStartWrite     : BOOL;(* StartFlag to start the PKW-Write *)
    tTimeOut        : TIME := DEFAULT_ADS_TIMEOUT;
END_VAR

iSlaveAddress: Station address.

iPnu: Selection of the parameter to be read or written. List of the available parameter numbers.

nAxis: Axis ID.

iLength: Length of the parameter (2 or 4).

iParameterValue : Value of the parameter to be read or written.

iFC310xDeviceId : Device-Id

bStartRead : A rising edge at this boolean input sends a command to the axis to start reading the parameters selected with "Pnu".

bStartWrite : A rising edge at this boolean input sends a command to the axis to start writing the parameters selected with "Pnu". When changing operating mode, the write command is only effective if Stop = TRUE at the FB_AX2000_AXACT block.

tTimeOut: Maximum time allowed for the execution of the command.

VAR_OUTPUT

VAR_OUTPUT
    bBusy      :BOOL;
    iErrorId   :DWORD;
    iReadValue :DINT;
END_VAR

bBusy: This output remains TRUE until the block has executed a command. While Busy = TRUE, no new command will be accepted at the inputs. Please note that it is not the execution of the service but its acceptance whose time is monitored.

iErrorId: contains the command-specific error code of the most recently executed command. Is reset to 0 by the execution of a command at the inputs.

iReadValue: Parameter value as a response to the "StartRead" command.

Requirements

Development environment

Target platform

IO hardware

PLC libraries to be integrated (category group)

TwinCAT v3.1.0

PC or CX (x86)

AX2000 Profibus box

Tc2_IoFunctions (IO)