# IND400 with MQTT

## Smart Weighing with MQTT- IND400 in ACTION

The **Mettler Toledo IND400** is a **smart weighing indicator** designed for industrial applications. It supports modern protocols such as **MQTT, OPC UA, and Ethernet/IP**, making it **IIoT-ready** for digital factories.

## [LIVE Demo](https://www.youtube.com/watch?v=TQSgtSBYDMo)

<figure><img src="/files/2BNIVBtKLFSeXuTuMkYF" alt=""><figcaption></figcaption></figure>

{% embed url="<https://www.youtube.com/watch?v=TQSgtSBYDMo>" %}

### Data Communication and Integration

* IND400 smart weighing indicator communicates via Modbus TCP, RTU, OpenAPI, MQTT, and OPCUA for real-time data transmission to the cloud or an MQTT broker.
* IND400 can be **connected to Node-RED** for easy **data visualization** and **real-time monitoring** of MQTT data and device status.

### Remote Control and Monitoring

1. IND400 supports **remote monitoring and control via VNC**, enabling **easy access** and **real-time observation** of weighing data and device status.
2. The scale can be **controlled remotely using MQTT and Node-RED**, allowing for **real-time data and command exchange,** including zeroing, taring, preset taring, and clearing.

### Operational Modes

IND400 can be configured to send data via **Transfer mode** or **ComOne mode**, enabling **real-time data transmission** and remote control.

### Industry-Specific Features

IND400 is ideal for **pharmaceutical industries** and **food production systems**, providing **audit trails, secure data, time synchronization, and LDAP support** for GMP environments.

## Key notes:

{% embed url="<https://www.canva.com/design/DAGv3REvTV0/5uFimJ3Us1yHAuF1JDVV4Q/view>" %}

## Resources:

The following is the code that was used in the LIVE demonstration in the video.

## Transfer Mode

{% code overflow="wrap" lineNumbers="true" %}

```javascript
// Converting String to JSON
let input = msg.payload;

// Remove extra spaces and split by lines
let lines = input.trim().split('\n');

let result = {};

for (let line of lines) {
    let [key, ...valueParts] = line.split(':');
    if (!key || valueParts.length === 0) continue;

    let value = valueParts.join(':').trim();

    switch (key.trim()) {
        case 'Kopie / Kopien insgesamt':
            result.copies = value;
            break;
        case 'Datum':
            result.date = value;
            break;
        case 'Zeit':
            result.time = value;
            break;
        case 'Brutto':
            result.brutto = value;
            break;
        case 'Netto':
            result.netto = value;
            break;
        case 'Tara':
            result.tara = value;
            break;
        case 'Waage Nr.':
            result.scale_id = value;
            break;
        default:
            result[key.trim()] = value;
    }
}

msg.payload = result;
return msg;

```

{% endcode %}

## ComOne mode

### 1. Get measurements

{% code overflow="wrap" lineNumbers="true" %}

```javascript
msg.payload = {
    "Message": {
        "Header": {
            "Version": "v1.0.0",
            "MessageType": "Request",
            "ActionCode": "Read",
            "MessageID": "1234",
            "Path": "Measurement/Weight"
        }
    }
}

return msg;
```

{% endcode %}

### 2. Zero the scale

{% code overflow="wrap" lineNumbers="true" %}

```javascript
msg.payload = {
    "Message": {
        "Header": 
        {
            "Version": "v1.0.0",
            "MessageType": "Request",
            "ActionCode": "Update",
            "MessageID": "1234",
            "Path": "Command"
        },
        "Command": 
        {
            "DeviceName": "Scale1",
            "CommandCode": "Zero"
        }
    }
}
return msg;
```

{% endcode %}

### 3. Tare the scale

{% code overflow="wrap" lineNumbers="true" %}

```javascript
msg.payload = {
    "Message": {
        "Header":
        {
            "Version": "v1.0.0",
            "MessageType": "Request",
            "ActionCode": "Update",
            "MessageID": "1234",
            "Path": "Command"
        },
        "Command":
        {
            "DeviceName": "Scale1",
            "CommandCode": "Tare"
        }
    }
}
return msg;
```

{% endcode %}

### 4. Preset Tare the scale

{% code overflow="wrap" lineNumbers="true" %}

```javascript
msg.payload = {
    "Message": {
        "Header": {
            "Version": "v1.0.0",
            "MessageType": "Request",
            "ActionCode": "Update",
            "MessageID": "1234",
            "Path": "Command"
        },
        "Command": {
            "DeviceName": "Scale1",
            "CommandCode": "PresetTare",
            "Value": 0.05,
            "Unit": "kg"
        }
    }
}
return msg;

```

{% endcode %}

### 5. Clear the scale

{% code overflow="wrap" lineNumbers="true" %}

```javascript
msg.payload = {
    "Message": {
        "Header": {
            "Version": "v1.0.0",
            "MessageType": "Request",
            "ActionCode": "Update",
            "MessageID": "1234",
            "Path": "Command"
        },
        "Command": {
            "DeviceName": "Scale1",
            "CommandCode": "Clear"
        }
    }
}
return msg;
```

{% endcode %}

## Node-RED Example Code

The Node-RED flow used in the video can be found in the GitHub repository mentioned below:

<https://github.com/Code-and-Compile/Mettler_Toledo_IND400_MQTT>

## ♥️ Work With Me

I regularly test **industrial automation and IIoT devices**. If you’d like me to **review your product** or showcase it in my courses and YouTube channel:

📧 Email: <rajvir@codeandcompile.com> or drop me a message on [LinkedIn](https://www.linkedin.com/in/singhrajvir/)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://wiki.codeandcompile.com/product-reviews/smart-devices/smart-weighing-indicator/ind400-with-mqtt.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
