> For the complete documentation index, see [llms.txt](https://docs.roboflow.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.roboflow.com/roboflow/roboflow-hi/deploy/device-manager/plc-relay.md).

# PLC Relay

PLC Relay एक edge container service है जो PLC tags को पढ़ने और लिखने के लिए एक HTTP API प्रदान करता है। आप इसे Deployment Manager UI के माध्यम से एक protocol चुनकर, connection details दर्ज करके, और tags परिभाषित करके configure करते हैं।

{% hint style="info" %}
PLC Relay केवल Enterprise ग्राहकों के लिए उपलब्ध है। [Roboflow sales team से संपर्क करें](https://roboflow.com/sales) अधिक जानने के लिए।
{% endhint %}

## समर्थित प्रोटोकॉल

PLC Relay service जोड़ते या संपादित करते समय, आप तीन protocols में से एक चुनते हैं। प्रत्येक protocol की अपनी connection settings और tag format होता है।

| प्रोटोकॉल                   | PLCs                                 | डिफ़ॉल्ट पोर्ट |
| --------------------------- | ------------------------------------ | -------------- |
| Allen-Bradley (EtherNet/IP) | CompactLogix, ControlLogix, Micro800 | 44818          |
| Modbus TCP                  | कोई भी Modbus TCP device             | 502            |
| Siemens S7                  | S7-300, S7-400, S7-1200, S7-1500     | 102            |

{% hint style="warning" %}
Protocols बदलने पर सभी configured tags साफ़ हो जाते हैं क्योंकि tag address formats protocols के बीच interchangeable नहीं होते। बदलाव लागू करने से पहले UI पुष्टि के लिए prompt करेगा।
{% endhint %}

## कनेक्शन सेटिंग्स

### PLC पता

Address format चयनित protocol पर निर्भर करता है:

* **Allen-Bradley:** IP या होस्टनेम, जिसके बाद वैकल्पिक रूप से `/slot` (उदा. `192.168.1.100/0`) या एक पूर्ण CIP routing path।
* **Modbus TCP:** IP या होस्टनेम, के साथ वैकल्पिक `:port` (उदा. `192.168.1.100:502`)। 32-bit values के लिए एक Unit ID (0-255) और Word Order (big या little) भी आवश्यक है।
* **Siemens S7:** IP या होस्टनेम, के साथ वैकल्पिक `:port` (उदा. `192.168.1.100:102`)। साथ ही Rack (0-7) और Slot (0-31) भी आवश्यक है।

### Simulation Mode

जब यह सक्षम होता है, तो PLC Relay वास्तविक PLC से कनेक्ट होने के बजाय in-memory simulator का उपयोग करता है। सभी API operations सामान्य रूप से काम करते हैं, लेकिन values memory में संग्रहीत होती हैं। यह hardware के बिना testing के लिए उपयोगी है।

## Tag Configuration

Tags वे PLC data points परिभाषित करते हैं जो API के माध्यम से accessible हैं। प्रत्येक tag का एक name, data type, writable flag, और वैकल्पिक description होता है।

### Data Types

| प्रकार | विवरण                 | Range                           |
| ------ | --------------------- | ------------------------------- |
| `BOOL` | Boolean               | `true` / `false`                |
| `INT`  | 16-bit signed integer | -32,768 से 32,767               |
| `DINT` | 32-bit signed integer | -2,147,483,648 से 2,147,483,647 |
| `REAL` | 32-bit floating point | IEEE 754                        |

### Tag Name Formats

{% tabs %}
{% tab title="Allen-Bradley" %}
Tag names PLC program से मेल खाते हैं और case-sensitive होते हैं।

| Style          | उदाहरण                        |
| -------------- | ----------------------------- |
| Simple         | `TagName`                     |
| Program-scoped | `Program:MainProgram.TagName` |
| Array element  | `TagName[0]`                  |
| UDT member     | `MyUDT.Member`                |
| {% endtab %}   |                               |

{% tab title="Modbus TCP" %}
Format: `{area}:{address}` जहाँ address एक non-negative integer है।

| Area         | Type(s)         | पहुंच            | उदाहरण        |
| ------------ | --------------- | ---------------- | ------------- |
| `coil`       | BOOL            | लिखने योग्य      | `coil:0`      |
| `discrete`   | BOOL            | केवल-पढ़ने योग्य | `discrete:5`  |
| `holding`    | INT, DINT, REAL | लिखने योग्य      | `holding:100` |
| `input`      | INT, DINT, REAL | केवल-पढ़ने योग्य | `input:200`   |
| {% endtab %} |                 |                  |               |

{% tab title="Siemens S7" %}
Data Block format: `DB{n}.DB[XWD]{byte}[.{bit}]`

Area format: `[MIQEA][WD]?{byte}[.{bit}]`

| पता             | प्रकार             | विवरण                            |
| --------------- | ------------------ | -------------------------------- |
| `DB1.DBX0.0`    | BOOL               | Data Block 1 में byte 0 का bit 0 |
| `DB1.DBW0`      | INT                | DB1 में 16-bit word              |
| `DB1.DBD0`      | DINT या REAL       | DB1 में 32-bit double-word       |
| `M0.0`          | BOOL               | Merker bit                       |
| `I0.0` / `Q0.0` | BOOL               | Process input/output bit         |
| `MW0` / `MD0`   | INT / DINT या REAL | Merker word / double-word        |

S7-1200/1500 के लिए: TIA Portal में PUT/GET सक्षम करें और accessed DBs पर optimized block access अक्षम करें।
{% endtab %}
{% endtabs %}

## Web Dashboard और REST API

PLC Relay में tag values को real time में monitor करने के लिए एक built-in web dashboard शामिल है। सेवा शुरू हो जाने पर, इसे यहाँ access करें `http://<device-ip>:8007`.

डैशबोर्ड यहाँ interactive Swagger documentation भी होस्ट करता है `/docs` और यहाँ एक visual config builder भी है `/static/config-builder.html`.

### API Endpoints

| Method | Path             | विवरण                                            |
| ------ | ---------------- | ------------------------------------------------ |
| GET    | `/healthz`       | कनेक्शन और validation status के साथ health check |
| GET    | `/all_tags`      | सभी tags के वर्तमान values पढ़ें                 |
| GET    | `/read?tag=name` | नाम से एक single tag पढ़ें                       |
| POST   | `/write`         | एक single tag लिखें                              |
| POST   | `/read_batch`    | एक साथ multiple tags पढ़ें                       |
| POST   | `/write_batch`   | एक साथ multiple tags लिखें                       |
| GET    | `/schema`        | सभी tag definitions प्राप्त करें                 |
| POST   | `/validate`      | PLC के विरुद्ध tag validation फिर से चलाएँ       |

## समस्या निवारण

| लक्षण                                      | समाधान                                                                                                                           |
| ------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------- |
| "PLC not connected" (Allen-Bradley)        | PLC address format (IP/Slot) सत्यापित करें, port 44818 की पहुँच जाँचें                                                           |
| "PLC not connected" (Modbus)               | IP/port (डिफ़ॉल्ट 502) जाँचें और verify करें कि Unit ID device से मेल खाता है                                                    |
| "PLC not connected" (Siemens S7)           | IP/port (डिफ़ॉल्ट 102), rack, और slot values जाँचें; S7-1200/1500 के लिए PUT/GET सक्षम करें और optimized block access अक्षम करें |
| "Function refused" (Siemens S7)            | TIA Portal में PUT/GET disabled है, या target DB पर optimized block access सक्षम है                                              |
| REAL value कचरे जैसा पढ़ा जाता है (Modbus) | विपरीत Word Order आज़माएँ (big बनाम little)                                                                                      |
| Validation में NOT\_FOUND दिखता है         | सटीक tag name के लिए PLC program जाँचें (case-sensitive)                                                                         |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.roboflow.com/roboflow/roboflow-hi/deploy/device-manager/plc-relay.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
