FB_WriteOutput_analog

FB_WriteOutput_analog 1:

VAR_IN_OUT

VAR_IN_OUT
    stParameterBuffer:      ST_ParameterBuffer; 
END_VAR

stParameterBuffer: Data buffer for background communication

VAR_INPUT

VAR_INPUT
    iSlaveaddress       :BYTE;
    iChannel            :BYTE;
    iSlavevalue         :WORD;
    bCycleMode          :BOOL;      (*0: Acyclic , 1:Cyclic (permanent Read/Write) *)
    bStart              :BOOL;
END_VAR

iSlaveaddress: Slave address

iChannel: Slave channel

iSlavevalue: Data to be written

bCycleMode: 0: Acyclic , 1:Cyclic (permanent Read/Write) If this bit is set, the output bBusy will only be reset if the input bStart will become FALSE. If the input bStart becomes to early FALSE, no current value exists at the output.

bStart : Addressing is carried out via a rising edge of this boolean input

VAR_OUTPUT

VAR_OUTPUT
    bBusy               :BOOL;
    bErr                :BOOL;
    iErrornumber        :DWORD;     (*errorcode of ASI-Master*)
    iReadValue          :WORD;
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.

bErr: This output shows the error status

iErrornumber: 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.

bValid: If this output is set the read data are valid.

bOverflow: The value of the slave is out of range.

Requirements

Development Environment

Target System

IO-Hardware

PLC Libraries to include

TwinCAT Version >= 2.8.0 Build > 739

PC (i386)

ASI-Master-Terminal

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