# ClientReadProperties\_NameValueUnitDescription

## `ClientReadProperties_NameValueUnitDescription` (FB)

FUNCTION\_BLOCK ClientReadProperties\_NameValueUnitDescription

### Short description

> Updating four specified properties of a BACNET object (read access)\
> Typical application: Querying the properties of an ANALOG-INPUT object via BACNET

### Representation

<figure><img src="https://2592874069-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FQR4vCFzt6ixgsqlR3pdR%2Fuploads%2Fgit-blob-6d2b03058e5393dd2d37633c837e9bf0fb7e0b82%2FClientReadProperties_NameValueUnitDescription_FB.png?alt=media" alt="" width="298"><figcaption></figcaption></figure>

### Interfaces

#### Inputs

| Name            | Data type            | Value range | Initial value | Function                                                                                  |
| --------------- | -------------------- | ----------- | ------------- | ----------------------------------------------------------------------------------------- |
| *xEn*           | BOOL                 |             | TRUE          | Enable / disable communication ( TRUE = enabled )                                         |
| *itfServer*     | BACnet.IBACnetServer |             |               | Interface variable for referencing the server                                             |
| *xUpdateActual* | BOOL                 |             | FALSE         | Update of actual values ( on each rising edge )                                           |
| *xResError*     | BOOL                 |             | FALSE         | Reset of the error outputs ‘eErrorCodeCom’ and ‘eRepyErrorCode.XXX’ (on each rising edge) |

#### Outputs

| Name                   | Data type                                  | Value range | Initial value | Function                                                                                     |
| ---------------------- | ------------------------------------------ | ----------- | ------------- | -------------------------------------------------------------------------------------------- |
| *dwDeviceID\_Fb*       | DWORD                                      |             | 0             | Number of the BACnet target device (range: 0 - 4194302) - feedback                           |
| *eObjectType\_Fb*      | BACnet.CmpBACnet.IEC\_BACnet\_Object\_Type |             |               | Type of the object - feedback                                                                |
| *dwObjectInstance\_Fb* | DWORD                                      |             | 0             | Number of the object (range: 0 - 4194303) - feedback                                         |
| *sObjectName*          | STRING                                     |             |               | Name of the object                                                                           |
| *sValueOutput*         | STRING                                     |             | ‘’            | Display of the output for the current value (PRESENT\_VALUE) of the object                   |
| *xValidValue*          | BOOL                                       |             | FALSE         | Status of the validity of the current value (PRESENT\_VALUE) (TRUE = current value valid)    |
| *rValue*               | REAL                                       |             |               | Current value of the property in REAL format (floating point according to IEEE754 - 32 bit)  |
| *xValue*               | REAL                                       |             |               | Current value of the property in BOOL format                                                 |
| *sValue*               | STRING                                     |             |               | Current value of the property in STRING format (character string)                            |
| *diValue*              | DINT                                       |             |               | Current value of the property in DINT format (signed integer)                                |
| *udiValue*             | UDINT                                      |             |               | Current value of the property in UDINT format (unsigned integer)                             |
| *byValue*              | BYTE                                       |             |               | Current value of the property in BYTE format (integer 0 - 255)                               |
| *lrValue*              | LREAL                                      |             |               | Current value of the property in LREAL format (floating point according to IEEE754 - 64 bit) |
| *sObjectUnit*          | STRING                                     |             |               | Unit for the current value (PRESENT\_VALUE) of the object                                    |
| *sObjectDescription*   | STRING                                     |             |               | Description of the object                                                                    |
| *xRegToServer*         | BOOL                                       |             | FALSE         | Status of registration at the BACnet server (TRUE = successful registration)                 |
| *xConfigObject*        | BOOL                                       |             | FALSE         | Status of the object's configuration (TRUE = successful configuration)                       |
| *eState*               | BACnet.CmpBACnet.IEC\_BACNET\_STATUS       |             |               | Status of communication                                                                      |
| *eErrorCodeCom*        | BACnet.CmpBACnet.IEC\_BACNET\_STATUS       |             |               | Most recent communication error                                                              |
| *eErrorCodeDevice*     | BACnet.CmpBACnet.IEC\_BACNET\_ERROR\_CODE  |             |               | Most recent device error transmitted by the BACnet target device (BACnet server)             |
| *eReplyErrorCode*      | TYPE\_OF\_REPLY\_ERROR\_CODE               |             |               | Most recent communication error in the reply to one's own request                            |
| *xAlarm*               | BOOL                                       |             | FALSE         | General fault ( TRUE = fault )                                                               |
| *xAlarmCom*            | BOOL                                       |             | FALSE         | General fault - communication ( TRUE = fault )                                               |
| *xBusy*                | BOOL                                       |             |               | Communication indicator ( TRUE = communication )                                             |

#### Setpoints / parameters

| Name                  | Data type                                  | Value range | Initial value                                                 | Function                                                                                                                |
| --------------------- | ------------------------------------------ | ----------- | ------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------- |
| **tTimeUpdateActual** | TIME                                       |             | T#3s                                                          | Update interval for operations influenced by the input 'xUpdateActual' ( 0 = no automatic update, > 0 cyclical update ) |
| **dwDeviceID**        | DWORD                                      |             |                                                               | Number of the BACnet target device (range: 0 - 4194302)                                                                 |
| **eObjectType**       | BACnet.CmpBACnet.IEC\_BACnet\_Object\_Type |             | BACnet.CmpBACnet.IEC\_BACnet\_Object\_Type.OBJ\_ANALOG\_INPUT | Type of the object                                                                                                      |
| **dwObjectInstance**  | DWORD                                      |             |                                                               | Number of the object (range: 0 - 4194303)                                                                               |

### Function description

#### General

This function block transfers four predefined properties of an object via BACNET communication (read access).\
The properties OBJECT\_NAME, PRESENT\_VALUE, UNITS and DESCRIPTION (as far as possible) are read.\
The selection of the object to be read is made via the parameters **dwDeviceID**, **eObjectType** and **dwObjectInstance**.\
The validity of the current value (PRESENT\_VALUE) after a transfer is signaled at the output 'xValidValue'.\
The output with the current value (PRESENT\_VALUE) is presented at the output 'sValueOutput' after a successful transfer.\
\\

#### Enable / disable communication

Enable/disable of communication is done via the input 'xEn' (Default = TRUE = enabled).\
On each rising edge at the input 'xEn', a transfer of the current value with the current settings is triggered.\
In the disabled state the outputs assume predefined states, and an unregister from the server takes place at the same time.\
\\

#### Triggering a transfer

The transfer of the property's current value can be triggered as follows (precondition: xRegToServer = TRUE)\
\\

* every rising edge at the input 'xEn'
* every rising edge at the input 'xUpdateActual'
* periodically at the interval 'tTimeUpdateAvtual' (Default: T#3s)
* once after each download
* once after each change of configuration\
  \\

#### Configuration of the BACNET object

The BACNET object is uniquely defined by the following parameters:\
\\

* Device address 'dwDeviceID'
* Object address 'dwObjectInstance'
* Object type 'eObjectType'\\

#### Feedback of the current parameters

At the outputs with the index '\_Fb' the current settings of the BACNET parameters are available for display purposes.\\

#### Output 'sValueOutput'

At this output the name of the output variable containing the valid current value (PRESENT\_VALUE) is available after a successful transfer.\\

#### Output 'xValidValue'

At this output the validity of the current value (PRESENT\_VALUE) is available after a successful transfer.\\

#### Outputs for the current value of the object

Depending on the validity of the current value (xValidValue = TRUE) and the name of the output variable (sValueOutput)\
the current value is available at the corresponding output.\\

#### Output 'xRegToServer'

This output permanently provides the status of the internal connection to the BACNET server. Successful connection establishment to the server\
is a prerequisite for transferring the setpoint.\\

#### Output 'xConfigObject'

This output permanently provides the status of the successful configuration of the BACNET object.\\

#### Display of faults

Fault indication is displayed at the collective output 'xAlarm' (= TRUE).\
It includes the current states of communication errors (xAlarmCom) and device errors (xAlarmDevice).\
Communication faults are displayed at the output xAlarmCom with a time delay: gc\_Parameters.gc\_tOnDelayxAlarmCom (Default = 60s).\
Device faults are displayed without delay at the output xAlarmDevice.\
In case of a communication error, an explanatory text for the cause is available at the output 'eErrorCodeCom'. It always shows the\
cause of the last communication error.\
In case of a device error, an explanatory text for the cause is available at the output 'eErrorCodeDevice'. It always shows and updates the\
cause of the last communication error.\
In case of an error in the reply telegram, an explanatory text for the cause is available at the output 'eReplyErrorCode'.\\

#### Output 'xBusy'

This output signals the active transfer of the current value (= TRUE).\\

### CODESYS

InOut:

| Scope       | Name                  | Type                                      | Initial                                                       | Comment                                                                                                                                   |
| ----------- | --------------------- | ----------------------------------------- | ------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- |
| Input       | `xEn`                 | `BOOL`                                    | TRUE                                                          | Enable / disable communication ( TRUE = enabled )                                                                                         |
| Input       | `itfServer`           | `BACnet.IBACnetServer`                    |                                                               | Interface variable for referencing the server                                                                                             |
| Input       | `xUpdateActual`       | `BOOL`                                    | FALSE                                                         | <p>Update of actual values (on every rising edge<br>)</p>                                                                                 |
| Input       | `xResError`           | `BOOL`                                    | FALSE                                                         | <p>Reset of the output 'eError' (on each rising<br>edge)</p>                                                                              |
| Output      | `dwDeviceID_Fb`       | `DWORD`                                   |                                                               | <p>Number of the BACnet target device (range: 0 - 4194302) -<br>feedback</p>                                                              |
| Output      | `eObjectType_Fb`      | `BACnet.CmpBACnet.IEC_BACnet_Object_Type` |                                                               | Type of the object - feedback                                                                                                             |
| Output      | `dwObjectInstance_Fb` | `DWORD`                                   |                                                               | Number of the object (range: 0 - 4194303) - feedback                                                                                      |
| Output      | `sObjectName`         | `STRING`                                  |                                                               | Name of the object                                                                                                                        |
| Output      | `sValueOutput`        | `STRING`                                  | ‘’                                                            | Display of the output for the current value of the property                                                                               |
| Output      | `xValidValue`         | `BOOL`                                    | FALSE                                                         | <p>Status of the validity of the current value of a property (FALSE<br>= current value invalid)</p>                                       |
| Output      | `rValue`              | `REAL`                                    |                                                               | <p>Current value of the property in REAL format (floating point<br>according to IEEE754 - 32 bit)</p>                                     |
| Output      | `xValue`              | `BOOL`                                    |                                                               | Current value of the property in BOOL format                                                                                              |
| Output      | `sValue`              | `STRING(255)`                             |                                                               | Current value of the property in STRING format (character string)                                                                         |
| Output      | `diValue`             | `DINT`                                    |                                                               | <p>Current value of the property in DINT format (signed<br>integer)</p>                                                                   |
| Output      | `udiValue`            | `UDINT`                                   |                                                               | <p>Current value of the property in UDINT format (unsigned<br>integer)</p>                                                                |
| Output      | `byValue`             | `BYTE`                                    |                                                               | Current value of the property in BYTE format (integer 0 - 255)                                                                            |
| Output      | `lrValue`             | `LREAL`                                   |                                                               | <p>Current value of the property in LREAL format (floating point<br>according to IEEE754 - 64 bit)</p>                                    |
| Output      | `sObjectUnit`         | `STRING`                                  |                                                               | Unit of the measured value                                                                                                                |
| Output      | `sObjectDescription`  | `STRING`                                  |                                                               | Description of the object                                                                                                                 |
| Output      | `xRegToServer`        | `BOOL`                                    |                                                               | <p>Status of registration at the BACnet server (TRUE =<br>successful registration)</p>                                                    |
| Output      | `xConfigObject`       | `BOOL`                                    |                                                               | <p>Status of the object's configuration (TRUE = successful<br>configuration)</p>                                                          |
| Output      | `eCBMState`           | `BACnet.CmpBACnet.IEC_BACNET_STATUS`      |                                                               | CBM - communication status (updates: states DONE, ERROR and ABORT)                                                                        |
| Output      | `eComState`           | ClientReadProperty\_ComStates             |                                                               | <p>Communication status (updates: states<br>No\_Execution, Target\_Device\_Searching, Request\_Sending,<br>Reply\_Waiting, Finishing)</p> |
| Output      | `eErrorCodeCom`       | `BACnet.CmpBACnet.IEC_BACNET_STATUS`      |                                                               | Most recent communication error                                                                                                           |
| Output      | `eErrorCodeDevice`    | `BACnet.CmpBACnet.IEC_BACNET_ERROR_CODE`  |                                                               | Most recent device error transmitted by the BACnet target device (BACnet server)                                                          |
| Output      | `eReplyErrorCode`     | TYPE\_OF\_REPLY\_ERROR\_CODE              |                                                               | Most recent communication error in the reply to one's own request                                                                         |
| Output      | `xAlarm`              | `BOOL`                                    |                                                               | General fault ( TRUE = fault )                                                                                                            |
| Output      | `xAlarmCom`           | `BOOL`                                    |                                                               | General fault - communication ( TRUE = fault )                                                                                            |
| Output      | `xBusy`               | `BOOL`                                    |                                                               | Communication indicator ( TRUE = communication )                                                                                          |
| Input Const | `dwObjectInstance`    | `DWORD`                                   |                                                               | Number of the object (range: 0 - 4194303)                                                                                                 |
| Input Const | `eObjectType`         | `BACnet.CmpBACnet.IEC_BACnet_Object_Type` | BACnet.CmpBACnet.IEC\_BACnet\_Object\_Type.OBJ\_ANALOG\_INPUT | Type of the object                                                                                                                        |
| Input Const | `dwDeviceID`          | `DWORD`                                   |                                                               | Number of the BACnet target device (range: 0 - 4194302)                                                                                   |
| Input Const | `tTimeUpdateActual`   | `TIME`                                    | TIME#3s0ms                                                    | <p>Update interval for operations influenced by the input<br>'xUpdateActual'</p>                                                          |
