BACnetClientWriteProperty (FB)

FUNCTION_BLOCK PUBLIC FINAL BACnetClientWriteProperty EXTENDS BACnetClientBase

Common Behaviour Model conform (ETrigA) FB to execute a Write-Property-Request in the BACnet-Network. If execution completed successfully and xDone is TRUE, the Write-Request was successful. In any other case eStatus and errorResult may hold additional information of what failed.

InOut:

Scope

Name

Type

Initial

Comment

Inherited from

Input

xExecute

BOOL

Rising edge: Starts defined operation
FALSE: Resets the defined operation after ready condition was reached

ETrigATo

xAbort

BOOL

TRUE: Aborts the operation

ETrigATo

udiTimeOut

UDINT

Max. operating time for executing [µs], 0: No operating time limit

ETrigATo

Output

xDone

BOOL

TRUE: Ready condition reached

ETrigATo

xBusy

BOOL

TRUE: Operation is running

ETrigATo

xError

BOOL

TRUE: Error condition reached

ETrigATo

xAborted

BOOL

TRUE: Abort condition reached

ETrigATo

Input

dwTargetDeviceNumber

DWORD

The device number of the targeted device in the BACnet- Network.

BACnetClientBase

pTargetDeviceAddress

POINTER TO CmpBACnet.IEC_BACNET_ADDRESS

0

Optional: The device address of the targeted device in the BACnet-Network. If an adress is given the given device number is ignored.

BACnetClientBase

Output

eStatus

CmpBACnet.IEC_BACNET_STATUS

CmpBACnet.IEC_BACNET_STATUS.BACNET_STATUS_OK

If an error occured, the error state.

BACnetClientBase

errorResult

CmpBACnet.IEC_BACNET_ERROR

STRUCT(tag := CmpBACnet.IEC_BACNET_FAILURE_TYPE._FAILURE_MAX_SIZE)

If an error occured (this means eStatus <> BACNET_STATUS_OK), whereas the sent BACnet-Request was answered with an specific error information, the latter is contained in this structure.

BACnetClientBase

iState

DINT

0

The State in which the FB is during execution:
  • 0: No execution, resetted state

  • 1: Searching for the Target-Device and a valid address for it

  • 2: Sending the BACnet-Request into the network

  • 3: Waiting for the answer (if there is one) to the BACnet-Request made in 2

  • 4: Finishing the call, setting of the output variables

BACnetClientBase

Input

objType

CmpBACnet.IEC_BACNET_OBJECT_TYPE

The type of the object under the targeted device to write the property to.

objInst

CmpBACnet.IEC_BACNET_DWORD

The instance number of the object under the targeted device to write the property to.

propID

CmpBACnet.IEC_BACNET_PROPERTY_ID

The property ID of the property of the object under the targeted device to write.

nWritePriority

CmpBACnet.IEC_BACNET_SIGNED

The priority used to write the property. Must be a value within 1..16.

propertyContents

CmpBACnet.IEC_BACNET_PROPERTY_CONTENTS

The contents to be written into the property.

nIndex

CmpBACnet.IEC_BACNET_SIGNED

-1

Optional: The Index of the element of the property written. Only use for constant array properties. Otherwise use index -1 or leave empty.

Properties:

Methods:

Structure: