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:=t#5s;
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: The maximum timeout - this time must not be exceeded.

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 an instruction at the inputs.

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

Requirements

Development Environment

Target System

IO Hardware

PLC Libraries to include

TwinCAT v2.8.0 Build > 737

PC (i386)

AX2000 Profibus box

TcIoFunctions.Lib

( Standard.Lib; TcBase.Lib; TcSystem.Lib; TcUtilities.Lib are included automatically )