Skip to main content
Skip table of contents

Niagara - Network Protocols - BQL Queries for Device Identification Across Multiple Network Protocols

Introduction

Identifying devices across various network protocols using Building Query Language (BQL) can be challenging due to the differences in device types. This guide provides a systematic approach to constructing BQL queries that can efficiently identify devices across different networks.

Good Practice

To construct an effective BQL query for identifying devices across multiple different network protocols, follow these detailed steps:

  1. Identify Device Type:

    • Begin by determining the specific type of device component you need to query. This involves understanding the network component structure and accessing the AX Slot Sheet view or similar tools within your Niagara system.

      image-20240116-110343.png

      Figure 1. Different Modbus Networks


      modbus type.png

      Figure 2. Type of the component to use in the BQL query

  2. Use Correct Device Type in Query:

    • Replace generic types in your query with specific device types. For example, if querying in a ModbusAsyncNetwork, use modbusAsync:ModbusAsyncDevice instead of a generic type like control:NumericPoint.

  3. Find Common Device Types:

    • When querying devices from different network drivers (e.g., ModbusAsyncNetwork and ModbusTcpNetwork), it's crucial to identify a common parent device type. Access Bajadoc help documentation to find the base classes (e.g., BModbusAsyncDevice and BModbusTcpDevice).

      image-20240116-111055.png

      Figure 3. ModbusAsyncDevice and it’s parent class

      image-20240116-111140.png

      Figure 4. ModbusTcpDevice and it’s parent class

    • Parent classes are not the same. Trace their inheritance further to discover a common parent such as BModbusClientDevice.

      image-20240116-111921.png

      Figure 5. ModbusTcpDevice and it’s grandparent class

      image-20240116-112356.png

      Figure 6. Common parent class

  4. Formulate the BQL Query:

    • Modify the device type string appropriately by removing prefixes and suffixes (e.g., remove "B" prefix and "-rt" suffix) and combine them with a colon separator to form something like modbusCore:ModbusClientDevice.

    • Construct your BQL query using this type. For example: station:|slot:/Drivers|bql:select * from modbusCore:ModbusClientDevice. This query will now be able to retrieve all devices of the specified type across the queried networks.

  5. Expand Query to Include Multiple Protocols:

    • If you need to include devices from additional protocols (e.g., SNMP, BACnet), repeat the process to find a common type across all required protocols. This might involve more extensive research into device inheritance and might also lead to the discovery of a universal type that encompasses multiple protocols. However common class for all of those networks can possibly also include devices from other protocols like M-Bus, NiagaraDriver etc.

  6. Alternative Query Method - NEQL:

    • For a more flexible querying method that can accommodate diverse and non-standard device types, consider using Network Equipment Query Language (NEQL). This approach requires tagging each device manually with a custom tag (e.g., my:deviceForQuery) and then querying based on these tags. While this method involves more setup time, it provides greater control over the query results.

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.