---
title: Topic Use Cases (PLC Status, Poll-once, Write, Manage, Batch Write)
slug: bhdo/topic-use-cases-plc-status-poll-once-write-manage-batch-write
createdAt: 2023-04-12T13:51:09.000Z
---

Refer to the following use cases for DeviceHub topics.&#x20;

:::hint{type="info"}
**Notes**:

- You need to follow the following guidelines for topic names: [Subject-Based Messaging](https://docs.nats.io/nats-concepts/subjects).&#x20;
- When publishing structured data such as JSON, you must convert to a byte array (string) first. To do this in a flow, you can use the **json&#x20;**&#x6E;ode.&#x20;
:::

# Add DeviceHub Device

For these use cases, follow the steps to [Connect a Device](https://public-docs.litmus.io/bhdo/connect-a-device) and make the following selections.&#x20;

**Device Type**: Simulator

**Driver Name**: Generator

**Name**: Enter a name for the device.&#x20;

After adding the device, it shows a connected status. The Generator device will be used to simulate a PLC device connected to Belden Horizon Data Operations.&#x20;

::Image[]{src="https://api.archbee.com/api/optimize/SSUUxKZUk9bFTEPNn_6Zo/HU0725E3E-ghhy5ygqKCT_image.png" size="60" width="437" height="368" caption="Generator device is successfully connected" position="center" showCaption="true"}

# Use Case 1: PLC Status Topic

The PLC status topic is used to verify the connection of DeviceHub devices.&#x20;

**To use the PLC status topic:&#x20;**

1. Follow the steps in the *Add DeviceHub Device* section.&#x20;
2. Navigate to **DeviceHub**.&#x20;
3. In the Generator device tile, click th&#x65;**&#x20;Display Copy Options&#x20;**&#x69;con and select the PLC status topic. This will copy the PLC status topic. You will refer to this topic later on.&#x20;

   ::Image[]{src="https://api.archbee.com/api/optimize/SSUUxKZUk9bFTEPNn_6Zo/QMy8hxZv4CM5FZLn_sfsH_copy-plc-status.png" size="80" width="671" height="373" caption="Copy the PLC status topic" position="center" showCaption="true"}
4. Navigate to **Flows Manager**.&#x20;
5. For a Flows Manager, click the **Go To Flow Definition** icon.&#x20;
   The Flow canvas opens in a new browser tab.&#x20;

   ::Image[]{src="https://api.archbee.com/api/optimize/SSUUxKZUk9bFTEPNn_6Zo/jf1-qnDDkdTBeT6Q0snCS_go-to-flow-definitionbhdo.png" size="80" width="931" height="481" caption="Go To Flow Definition icon" position="center" showCaption="true"}
6. On the Flow canvas, drag the **Datahub Subscribe** node and **debug&#x20;**&#x6E;ode onto the canvas. Then, connect the two nodes.&#x20;

   ::Image[]{src="https://api.archbee.com/api/optimize/SSUUxKZUk9bFTEPNn_6Zo/rFBhmtBOhyKLZca06yEtQ_plc-status-nodes.png" size="80" width="870" height="494" caption="Nodes needed for PLC status" position="center" showCaption="true"}
7. Double-click the **DataHub Subscribe** node.
   The *Edit DataHub Subscribe node* dialog box appears.
   - In the **Topic&#x20;**&#x66;ield, paste the PLC status topic you copied in step 3.&#x20;
   - If needed, configure the Datahub Subscribe connection. See the *Step 3: Configure Connector Nodes* section in [Create a Flow](https://public-docs.litmus.io/bhdo/create-a-flow) to learn more.&#x20;
   - Click **Done**, and then click **Deploy**.&#x20;
8. Expand the message window beneath the flow to view debug messages.&#x20;

   ::Image[]{src="https://api.archbee.com/api/optimize/SSUUxKZUk9bFTEPNn_6Zo/JX5Q6gfezPd36MMFlrwFH_message-bar.png" size="80" width="1920" height="937" caption="The message window" position="center" showCaption="true"}
9. Click the **Debug&#x20;**&#x69;con.&#x20;

   ::Image[]{src="https://api.archbee.com/api/optimize/SSUUxKZUk9bFTEPNn_6Zo/JC4cy7D-QXdzNqDI_czdP_debug-icon.png" size="80" width="1920" height="643" caption="The Debug icon" position="center" showCaption="true"}
10. Click the **Activate Debug** button. This triggers the debug node to display messages in the debug message window.&#x20;

    ::Image[]{src="https://api.archbee.com/api/optimize/SSUUxKZUk9bFTEPNn_6Zo/Ape1kZ4p0O1vNuxlL6wr4_activate-debug.png" size="80" width="1062" height="648" caption="The activate debug button" position="center" showCaption="true"}
11. The debug window displays a `"success": true` message, which means the device is successfully connected to Belden Horizon Data Operations. If you manually disconnected the device in Belden Horizon Data Operations, the debug window would display `"success": false`.&#x20;

    ::Image[]{src="https://api.archbee.com/api/optimize/SSUUxKZUk9bFTEPNn_6Zo/k9cbCEQNSQyQzuHN7_1j2_success-true.png" size="80" width="1616" height="767" caption="Success true message" position="center" showCaption="true"}

The rest of the payload displays the following information from the device:

- **Data type**: The data type used to verify the PLC status. The bit data type displays two values: 0 for on/connected and 1 for off/disconnected.&#x20;
- **Value**: The bit value that displays the status of the device. The value 0 means the device is on/connected.&#x20;
- **Device Name**: The device name you configured in Belden Horizon Data Operations.&#x20;
- **Timestamp**: Date and time data for the PLC status message.&#x20;
- **Device ID**: The device ID for the DataHub device generated in Belden Horizon Data Operations.&#x20;
- **Description**: The default description for the PLC status topic (Poll Register).&#x20;

# Use Case 2: Manage Topic

The Manage topic allows you to control the DeviceHub device.&#x20;

For this use case, you will stop the DeviceHub device using the Manage topic.&#x20;

**To use the Manage topic:**

1. Follow the steps in the *Add DeviceHub Device* section.&#x20;
2. Navigate to **DeviceHub**.
3. In the Generator device tile, click the **Display Copy Options** icon and select the Manage topic. This will copy the Manage status topic.  You will refer to this topic later on.&#x20;

   ::Image[]{src="https://api.archbee.com/api/optimize/SSUUxKZUk9bFTEPNn_6Zo/Xrjcj8WXfmFsYunbDWeNN_copy-manage-topic.png" size="80" width="671" height="373" caption="Copy the manage topic" position="center" showCaption="true"}
4. Navigate to **Flows Manager**.&#x20;
5. For a Flows Manager, click the **Go To Flow Definition** icon.&#x20;
   The Flow canvas opens in a new browser tab.&#x20;

   ::Image[]{src="https://api.archbee.com/api/optimize/SSUUxKZUk9bFTEPNn_6Zo/raLzuHTymRrXJ2vCmiQAl_go-to-flow-definitionbhdo.png" size="80" width="931" height="481" caption="Go To Flow Definition icon" position="center" showCaption="true"}
6. On the Flow canvas, copy the **DataHub Publish** node and **inject&#x20;**&#x6E;ode onto the canvas. Then, connect the two nodes.&#x20;

   ::Image[]{src="https://api.archbee.com/api/optimize/SSUUxKZUk9bFTEPNn_6Zo/hxeBGHjI4zRRnTQbC11Lj_manage-nodes.png" size="80" width="767" height="503" caption="The nodes needed for the manage topic" position="center" showCaption="true"}
7. Double-click the DataHub Publish node.&#x20;
   - In the **Topic&#x20;**&#x66;ield, paste the Manage topic you copied in step 3.&#x20;
   - If needed, configure the Datahub Subscribe connection. See the *Step 3: Configure Connector Nodes* section in [Create a Flow](https://public-docs.litmus.io/bhdo/create-a-flow) to learn more.&#x20;
   - Click **Done**.&#x20;
8. Double-click the **inject&#x20;**&#x6E;ode.&#x20;
   The *Edit inject* node dialog box displays.&#x20;
9. For **msg.payload**, select **string**.&#x20;

   ::Image[]{src="https://api.archbee.com/api/optimize/SSUUxKZUk9bFTEPNn_6Zo/kq5hmoJOK102KwP524Kd-_string-payload.png" size="80" width="565" height="883" caption="Select a string payload" position="center" showCaption="true"}
10. For **msg.payload**, enter `{"command" : "stop"}`.&#x20;

    ::Image[]{src="https://api.archbee.com/api/optimize/SSUUxKZUk9bFTEPNn_6Zo/r2q-Y9AvRkXGIstxxuL4m_stop-command.png" size="60" width="561" height="890" caption="Command to stop device" position="center" showCaption="true"}
11. Click **Done**, and then click **Deploy**.
12. Click the **inject&#x20;**&#x62;utton. This triggers the payload message you configured for the node.&#x20;

    ![](https://api.archbee.com/api/optimize/SSUUxKZUk9bFTEPNn_6Zo/5Asv74QwMTjgwjEd4worC_activate-inject-button.png "The inject button")
13. Return to the Belden Horizon Data Operations browser window and navigate to **DeviceHub**. The device now shows a *Stopped&#x20;*&#x73;tatus.&#x20;

    ::Image[]{src="https://api.archbee.com/api/optimize/SSUUxKZUk9bFTEPNn_6Zo/wsChus5eqPIHIu0c5pHIC_device-stopped.png" size="60" width="431" height="360" caption="Stopped status" position="center" showCaption="true"}

To restart the device, you can use the following command: `{"command" : "resume"}`.

# Use Case 3: Poll-Once Topic

The Poll-once topic is used for tags that have a poll interval set to 0. If there is no poll interval, you can use the Poll-once topic to retrieve a register value when an event occurs. The poll-once topic will manually trigger the polling of register values.&#x20;

**To use the Poll-once topic:&#x20;**

1. Follow the steps in the *Add DeviceHub Device* section.&#x20;
2. Follow the steps to [Add Tags](https://public-docs.litmus.io/bhdo/add-tags) and create one tag with the following parameters.&#x20;
   - **Name**: S - Random value generator
   - **Value Type**: int64
   - **Polling Interval**: 0
   - **Tag Name**: Enter a name for the tag.&#x20;
   - **Address**: 1
3. Click the **Copy&#x20;**&#x69;con for the tag's RAW Topic. You will refer to this later.&#x20;

   ::Image[]{src="https://api.archbee.com/api/optimize/SSUUxKZUk9bFTEPNn_6Zo/h0oW4o7FLMmVkLi6lDBNu_copy-raw-topicbhdo.png" size="80" width="1623" height="481" caption="Copy RAW Topic icon" position="center" showCaption="true"}
4. Click the **Action menu** for the tag and select **View Poll Topic**.&#x20;
   The *Poll Once* dialog box displays.&#x20;

   ::Image[]{src="https://api.archbee.com/api/optimize/SSUUxKZUk9bFTEPNn_6Zo/NHCh7dqU9UQhTnSPYXBuv_view-poll-topicbhdo.png" size="80" width="1623" height="481" position="center" showCaption="false"}
5. Click the **Copy&#x20;**&#x69;con for the tag. You will refer to this later.&#x20;

   ::Image[]{src="https://api.archbee.com/api/optimize/SSUUxKZUk9bFTEPNn_6Zo/EThwL2CwxG13aPAVDd953_poll-once-icon.png" size="80" width="786" height="316" position="center" showCaption="false"}
6. Navigate to **Flows Manager**.&#x20;
7. For a Flows Manager, click th&#x65;**&#x20;Go To Flow Definition** icon.&#x20;
   The Flow canvas opens in a new browser tab.

   ::Image[]{src="https://api.archbee.com/api/optimize/SSUUxKZUk9bFTEPNn_6Zo/Jn4WcLPljqJZTfUT0CMZ4_go-to-flow-definitionbhdo.png" size="80" width="931" height="481" caption="Go To Flow Definition icon" position="center" showCaption="true"}
8. On the Flow canvas, drag the **inject&#x20;**&#x6E;ode and **DataHub Publish** node onto the canvas. Then, connect the two nodes.&#x20;

   ::Image[]{src="https://api.archbee.com/api/optimize/SSUUxKZUk9bFTEPNn_6Zo/DezwjDs5jwEmTUqko9Bqq_inject-and-publish-nodes.png" size="80" width="862" height="555" caption="The inject and DataHub Publish nodes" position="center" showCaption="true"}
9. Double-click the **DataHub Publish&#x20;**&#x6E;ode.&#x20;
   The *Edit DataHub Publish* node dialog box displays.&#x20;
   - In the **Topic&#x20;**&#x66;ield, paste the Poll-once topic you copied in step 5.&#x20;
   - If needed, configure the Datahub Subscribe connection. See the *Step 3: Configure Connector Nodes* section in [Create a Flow](https://public-docs.litmus.io/bhdo/create-a-flow) to learn more.&#x20;
   - Click **Done**.&#x20;
10. Drag the **DataHub Subscribe** node and **debug&#x20;**&#x6E;ode onto the canvas.&#x20;

    ::Image[]{src="https://api.archbee.com/api/optimize/SSUUxKZUk9bFTEPNn_6Zo/E9uIt7zH_PdKJpsS1HOYl_subscribe-and-debug-nodes.png" size="80" width="801" height="462" caption="The DataHub Subscribe and debug nodes" position="center" showCaption="true"}
11. Double-click the **DataHub Subscribe** node.&#x20;
    The *Edit DataHub Subscribe* node dialog box displays.&#x20;
    - In the **Topic&#x20;**&#x66;ield, paste the Raw Topic you copied in step 2.&#x20;
    - Click **Done**, and then **Deploy**.&#x20;
12. Expand the message window beneath the flow to view debug messages.&#x20;

    ::Image[]{src="https://api.archbee.com/api/optimize/SSUUxKZUk9bFTEPNn_6Zo/Zh___1Jnu2LMvcPHcAmSQ_poll-once-message-bar.png" size="80" width="1713" height="892" caption="The message window" position="center" showCaption="true"}
13. Click the **Debug&#x20;**&#x69;con. This triggers the debug node to display messages.&#x20;

    ::Image[]{src="https://api.archbee.com/api/optimize/SSUUxKZUk9bFTEPNn_6Zo/tnKgBHcMjkJX1PYETh0Yt_poll-once-debug-icon.png" size="80" width="1712" height="625" caption="The debug icon" position="center" showCaption="true"}
14. Click the **Inject&#x20;**&#x62;utton. This triggers the timestamp message, which will then trigger the poll once tag to be activated.&#x20;

    ::Image[]{src="https://api.archbee.com/api/optimize/SSUUxKZUk9bFTEPNn_6Zo/DNQ7i4TPmQUvsbGOiS2O4_poll-once-inject-button.png" size="80" width="820" height="500" caption="The nject button" position="center" showCaption="true"}
15. Click the **Activate Debug** button. This triggers the debug node to display messages in the debug message window.&#x20;

    ::Image[]{src="https://api.archbee.com/api/optimize/SSUUxKZUk9bFTEPNn_6Zo/KCp1K7jEKyfaQioiTaG-x_poll-once-debug-button.png" size="80" width="801" height="462" caption="The Activate Debug button" position="center" showCaption="true"}
16. The debug window displays a `"success" :true` message, which means the poll-once tag successfully polled the device and displayed the data for the tag.      &#x20;

    ::Image[]{src="https://api.archbee.com/api/optimize/SSUUxKZUk9bFTEPNn_6Zo/cO5Ut4NUShhaFKWyEG-uZ_poll-once-success-message.png" size="80" width="1920" height="937" position="center" showCaption="false"}

The rest of the payload displays the following information for the tag:

- **Data Type**: The data type configured for the tag you created in step 1.&#x20;
- **Timestamp**: Date and time data for the poll-once message.&#x20;
- **Register ID**: The register ID for the tag generated in Belden Horizon Data Operations.&#x20;
- **Value**: The value generated for the tag when the poll was triggered. Since the tag was configured with *S - Random value generator*, a random value is generated.&#x20;
- **Device ID**: The device ID for the DataHub device generated in Belden Horizon Data Operations.&#x20;
- **Tag Name**: The name you configured for the tag.&#x20;
- **Device Name**: The name you configured for the device.&#x20;
- **Description**: The description you entered for the tag. Since no description was entered for the tag in this use case, no value was displayed.&#x20;
- **Metadata**: The meta data configured for the tag. Since no meta data was configured for the tag in this use case, no value was displayed.&#x20;

# Use Case 4: Write Topic

The Write Topic allows you to write data to a PLC device.&#x20;

## Step 1: Send Data to the Write Topic

You will first send the data to the Write topic.&#x20;

**To send the data to the Write topic:&#x20;**

1. Follow the steps in the *Add DeviceHub Device* section.&#x20;
2. Follow the steps to [Add Tags](https://public-docs.litmus.io/bhdo/add-tags) and create one tag with the following parameters.&#x20;
   - **Name**: M - Memory Register
   - **Value Type**: int64
   - **Polling Interval**: 5
   - **Tag Name**: Enter a name for the tag.&#x20;
   - **Address**: 1
3. Click the **Action menu&#x20;**&#x66;or the tag and select **View Write Topic**.&#x20;
   The *Write&#x20;*&#x64;ialog box displays.

   ::Image[]{src="https://api.archbee.com/api/optimize/SSUUxKZUk9bFTEPNn_6Zo/emy34GPmsOz_UFA_h_cL3_view-write-topicbhdo.png" size="80" width="1623" height="535" caption="View Write Topic option" position="center" showCaption="true"}
4. Click the **Copy&#x20;**&#x69;con for the tag. You will refer to this later.&#x20;

   ::Image[]{src="https://api.archbee.com/api/optimize/SSUUxKZUk9bFTEPNn_6Zo/-wZeZfJ0BfCPf5LefXSEI_copy-write-topic.png" size="80" width="788" height="320" caption="Copy icon for Write topic" position="center" showCaption="true"}
5. For a Flows Manager, click the **Go To Flow Definition** icon.&#x20;
   The Flow canvas opens in a new browser tab.

   ::Image[]{src="https://api.archbee.com/api/optimize/SSUUxKZUk9bFTEPNn_6Zo/DTraaEexmGJNFjyI4mlDh_go-to-flow-definitionbhdo.png" size="80" width="931" height="481" position="center" showCaption="false"}
6. On the Flow canvas, drag the **inject&#x20;**&#x6E;ode and **DataHub Publish** node onto the canvas. Then, connect the two nodes.&#x20;

   ::Image[]{src="https://api.archbee.com/api/optimize/SSUUxKZUk9bFTEPNn_6Zo/NVB_Ibwtx1yNe01-rswWG_inject-and-publish-nodes.png" size="80" width="862" height="555" position="center" showCaption="false"}
7. Double-click the **DataHub Publish&#x20;**&#x6E;ode.&#x20;
   The *Edit DataHub Publish* node dialog box displays.&#x20;
   - In the **Topic&#x20;**&#x66;ield, paste the Write topic you copied in step 4.&#x20;
   - If needed, configure the Datahub Subscribe connection. See the *Step 3: Configure Connector Nodes* section in [Create a Flow](https://public-docs.litmus.io/bhdo/create-a-flow) to learn more.&#x20;
   - Click **Done**.&#x20;
8. Double-click the **inject&#x20;**&#x6E;ode.
   The Edit inject node dialog box displays.&#x20;
   - For **msg.payload**, update the **timestamp&#x20;**&#x73;election and select **string**.&#x20;
   - In the **string&#x20;**&#x66;ield, enter **test**.&#x20;
   - Click **Done**.&#x20;
9. Drag the **debug&#x20;**&#x6E;ode onto the canvas and connect it to the **inject&#x20;**&#x6E;ode.&#x20;

   ::Image[]{src="https://api.archbee.com/api/optimize/SSUUxKZUk9bFTEPNn_6Zo/dDA1yCX8E6XQJotCafimu_inject-publish-and-debug-nodes.png" size="60" width="742" height="588" caption="The debug node connected to existing flow" position="center" showCaption="true"}
10. Click **Deploy**.&#x20;
11. Expand the message window beneath the flow to view debug messages.&#x20;

    ::Image[]{src="https://api.archbee.com/api/optimize/SSUUxKZUk9bFTEPNn_6Zo/KXSBnPPATqy0NudI_dDS8_write-message-bar.png" size="78" width="1718" height="797" caption="The message window" position="center" showCaption="true"}
12. Click the **Debug&#x20;**&#x69;con. This triggers the debug node to display messages.&#x20;

    ::Image[]{src="https://api.archbee.com/api/optimize/SSUUxKZUk9bFTEPNn_6Zo/-yx4hX3O4AV25lKC-mghV_write-debug-icon.png" size="80" width="1717" height="511" caption="The debug icon" position="center" showCaption="true"}
13. Click the **Activate debug** button and **inject&#x20;**&#x62;utton.&#x20;
    The message test displays in the debug window.&#x20;

    ::Image[]{src="https://api.archbee.com/api/optimize/SSUUxKZUk9bFTEPNn_6Zo/Yhm1CKEE63NdGTGX-gYth_write-test-message.png" size="80" width="1028" height="585" caption="Successful write message" position="center" showCaption="true"}

After sending the data to the Write topic, you can then read the data that was sent.&#x20;

## Step 2: Read Data That Was Sent

**To read the data that was sent:&#x20;**

1. Drag the **DataHub Subscribe** node and **debug&#x20;**&#x6E;ode onto the canvas. Then, connect the two nodes.&#x20;

   ::Image[]{src="https://api.archbee.com/api/optimize/SSUUxKZUk9bFTEPNn_6Zo/KT1TP35hlSO8SeAaT-umC_write-subscribe-and-debug-nodes.png" size="80" width="1006" height="526" caption="The DataHub Subscribe and debug nodes" position="center" showCaption="true"}
2. Double-click the **DataHub Subscribe** node.&#x20;
   The *Edit DataHub Subscribe* node dialog box displays.
   - In the **Topic&#x20;**&#x66;ield, paste the Write Topic you copied in step 4.&#x20;
   - Click **Done**, and then **Deploy**.&#x20;
3. Deactivate the **debug&#x20;**&#x6E;ode connected to the **inject&#x20;**&#x6E;ode and activate the **debug&#x20;**&#x6E;ode connected to the **DataHub Subscribe** node.&#x20;

   ::Image[]{src="https://api.archbee.com/api/optimize/SSUUxKZUk9bFTEPNn_6Zo/wxubd9dT1PXk0VsNTYBgP_write-debug-buttons.png" size="80" width="873" height="546" caption="Deactivate top debug node and activate bottom debug node" position="center" showCaption="true"}
4. Click the **inject&#x20;**&#x62;utton. The message that was sent to the Write topic is displayed by the debug node in the debug window.&#x20;

   ::Image[]{src="https://api.archbee.com/api/optimize/SSUUxKZUk9bFTEPNn_6Zo/KvKC6kBm6FjsHqFJubMF2_write-read-test-message.png" size="80" width="793" height="711" caption="Test message is read by debug node" position="center" showCaption="true"}

# Use Case 5: Batch Write Topic

You can use the Batch Write Topic to send multiple write requests simultaneously.&#x20;

:::hint{type="warning"}
**Important**:

- Only Gen 2 drivers can use batch write topics. See the [Industrial Systems Connection Guide](https://public-docs.litmus.io/bhdo/industrial-systems-connection-guide) to review available Gen 2 drivers.&#x20;
- This is only available for devices that don't select th&#x65;**&#x20;Enable Alias Topics** check box in the device configuration. You must use tags in the raw topic format. See [Connect a Device](https://public-docs.litmus.io/bhdo/connect-a-device) and [Manage Devices](https://public-docs.litmus.io/bhdo/manage-devices) for more information.&#x20;
:::

## Before You Begin

You will need the register IDs for the tags included in the batch write operation. If you don't have these values, you can get them by completing the steps in *Step 2: Configure Nodes* below.&#x20;

## Step 1: Set Up Flow Canvas

**To set up the Flow canvas:**

1. Follow the steps in the *Add DeviceHub Device* section.&#x20;
2. Follow the steps to [Add Tags](https://public-docs.litmus.io/bhdo/add-tags) and create three tags with the following parameters.
   - **Name**: M - Memory Register
   - **Value Type**: int64
   - **Polling Interval**: 10
   - **Tag Name**: Enter a name for each tag.&#x20;
   - **Address**: Enter 1 for the first tag, 2 for the second, and 3 for the third.&#x20;
3. Navigate to **DeviceHub&#x20;**> **Devices**.&#x20;
4. In the Generator device tile, click the **Display Copy Options** icon and select the **Manage&#x20;**&#x74;opic. This will copy the PLC Manage topic. You will refer to this topic later on.&#x20;

   ::Image[]{src="https://api.archbee.com/api/optimize/SSUUxKZUk9bFTEPNn_6Zo/nk9-19PTw9RWUiepfqejr_copy-manage-topic.png" size="80" width="671" height="373" caption="The manage topic" position="center" showCaption="true"}
5. Copy the **Raw&#x20;**&#x54;opic. This will copy the RAW topic.  You will refer to this topic later on.&#x20;

   ::Image[]{src="https://api.archbee.com/api/optimize/SSUUxKZUk9bFTEPNn_6Zo/4mjaEluZMCfFmxr6dFxqD_copy-device-raw-topic.png" size="80" width="668" height="385" caption="The device Raw Topic" position="center" showCaption="true"}
6. Navigate to **Flows Manager**.&#x20;
7. For a Flows Manager, click the **Go To Flow Definition** icon.&#x20;
   The Flow canvas opens in a new browser tab.&#x20;

   ::Image[]{src="https://api.archbee.com/api/optimize/SSUUxKZUk9bFTEPNn_6Zo/dG_yeZrUUrVF7Jk_c0F1h_go-to-flow-definitionbhdo.png" size="80" width="931" height="481" caption="Go To Flow Definition icon" position="center" showCaption="true"}
8. On the Flow canvas, do the following:
   Drag the **DataHub Subscribe** node and **debug&#x20;**&#x6E;ode on the canvas. Then, connect the two nodes.&#x20;
   Drag the **inject&#x20;**&#x6E;ode and the **DataHub Publish&#x20;**&#x6E;ode onto the canvas. Then, connect the two nodes.&#x20;

   ::Image[]{src="https://api.archbee.com/api/optimize/SSUUxKZUk9bFTEPNn_6Zo/Shx9UdNx5PcnpI-CzhyQX_batch-write-four-nodes.png" size="80" width="922" height="536" caption="Set up the four nodes for batch write" position="center" showCaption="true"}

You can now configure the nodes on the canvas.&#x20;

## Step 2: Configure Nodes

**To configure the nodes:**

1. Double-click the **DataHub Subscribe** node.&#x20;
   The *Edit DataHub Subscribe&#x20;*&#x6E;ode dialog box displays.
   - In the **Topic&#x20;**&#x66;ield, paste the Raw topic you copied previously.&#x20;
   - If needed, configure the Datahub Subscribe connection. See the *Step 3: Configure Connector Nodes* section in [Create a Flow](https://public-docs.litmus.io/bhdo/create-a-flow) to learn more.
   - Click **Done**, and then click **Deploy**.&#x20;
2. Expand the message window beneath the flow to view debug messages.

   ::Image[]{src="https://api.archbee.com/api/optimize/SSUUxKZUk9bFTEPNn_6Zo/lAkehfri9Opxk0GUaHv7B_batch-write-message-bar.png" size="80" width="1920" height="937" caption="The message window" position="center" showCaption="true"}
3. Click the **Debug&#x20;**&#x69;con. This triggers the debug node to display messages.&#x20;

   ::Image[]{src="https://api.archbee.com/api/optimize/SSUUxKZUk9bFTEPNn_6Zo/Y8QE7Chyax0W07kwl3TAd_batch-write-debug-icon.png" size="80" width="1920" height="552" caption="The debug icon" position="center" showCaption="true"}
4. If not already activated, click the debug button to activate it. Then, wait for the first debug message to appear.&#x20;

   ::Image[]{src="https://api.archbee.com/api/optimize/SSUUxKZUk9bFTEPNn_6Zo/TAqS_cDsdu6eH-Xjxo-T4_batch-write-debug-button.png" size="80" width="1920" height="572" caption="The debug button" position="center" showCaption="true"}
5. When the first debug message displays, copy the **registerID&#x20;**&#x76;alues. You may need to wait about 10 seconds (as this was the set polling interval value) for the **registerID** values to show up. These are the register IDs for each tag you created. You will use these values to configure the inject node.&#x20;

   ::Image[]{src="https://api.archbee.com/api/optimize/SSUUxKZUk9bFTEPNn_6Zo/-NxEO5h_sofYMNgurwu0s_batch-write-register-ids.png" size="80" width="1920" height="813" caption="Register IDs for tags" position="center" showCaption="true"}
6. Double-click the inject node.&#x20;
   - For **msg.payload**, update the **timestamp&#x20;**&#x73;election and select **string**.
   - In the **string&#x20;**&#x66;ield, enter the payload in the following format: `{"registerID_1": value_1, "registerID_2": value_2, "registerID_3": value_3}`. Keep in mind that the order of the register IDs you configure is based on the address values you configured for the tags. `value_1`, `value_2`, `value_3` can be replaced with any value of your choosing.
   - For example, for this use case, the payload will be: `{"C3E1CC7C-143F-46DA-BB70-C40196E56763": 11, "BE047C8C-875F-4D47-84AE-4D224733FE1D": 22, "BB1D6677-F4AE-41FD-A5AA-25E9E4AC7917": 33}`. The first register ID is the one configured with **Address&#x20;**&#x31; in the tag configuration, the second register ID is the one configured with **Address&#x20;**&#x32;, and the third register ID is the one configured with **Address&#x20;**&#x33;. `11`, `22`, `33` are values chosen for this example.
   - Click **Done**.&#x20;
7. Double-click the DataHub Publish node.&#x20;
   The *Edit DataHub Publish* node dialog box displays.
   - In the Topic field, paste the Manage topic you copied previously. Then, replace `manage` in the topic with `batch_write`. For example, `devicehub.manage.0F992AC9-4A73-4D7A-8134-6AB374BBE628` is changed to `devicehub.batch_write.0F992AC9-4A73-4D7A-8134-6AB374BBE628`.
   - Click **Done**, and then click **Deploy**.&#x20;

You can now send the batch data to the device tags.&#x20;

## Step 3: Send Batch Data

**To send the batch data:**

1. Click inject button. This sends the data to all the tags configured in the inject node simultaneously. For this use case, the inject node sends the values 11, 22, and 33 to the three device tags.&#x20;

   ::Image[]{src="https://api.archbee.com/api/optimize/SSUUxKZUk9bFTEPNn_6Zo/9hY_bkZ_RBmCL8J0Igo5i_batch-write-inject-button.png" size="80" width="1564" height="427" caption="The inject node button" position="center" showCaption="true"}
2. Wait up to 10 seconds for the next debug message. The three values display based on the **Address&#x20;**&#x61;nd **value&#x20;**&#x70;arameters you configured previously.&#x20;

   ::Image[]{src="https://api.archbee.com/api/optimize/SSUUxKZUk9bFTEPNn_6Zo/5fUCh4bpouOO4c-SQosx3_batch-write-messages.png" size="80" width="1920" height="937" caption="The batch write messages" position="center" showCaption="true"}



