> 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 जोड़ते या संपादित करते समय, आप तीन protocol में से एक चुनते हैं। प्रत्येक 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" %}
प्रोटोकॉल बदलने से सभी कॉन्फ़िगर किए गए tags साफ़ हो जाते हैं क्योंकि tag address formats प्रोटोकॉल के बीच interchangeable नहीं होते। UI परिवर्तन लागू करने से पहले पुष्टि के लिए prompt करेगा।
{% endhint %}

## Connection Settings

### PLC पता

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

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

### सिमुलेशन मोड

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

## टैग कॉन्फ़िगरेशन

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

### डेटा प्रकार

| प्रकार | विवरण                 | सीमा                            |
| ------ | --------------------- | ------------------------------- |
| `BOOL` | बूलियन                | `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                        |

### टैग नाम प्रारूप

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

| शैली           | उदाहरण                        |
| -------------- | ----------------------------- |
| साधारण         | `TagName`                     |
| Program-scoped | `Program:MainProgram.TagName` |
| Array element  | `TagName[0]`                  |
| UDT सदस्य      | `MyUDT.Member`                |
| {% endtab %}   |                               |

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

| क्षेत्र      | प्रकार(s)       | Access           | उदाहरण        |
| ------------ | --------------- | ---------------- | ------------- |
| `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 प्रारूप: `DB{n}.DB[XWD]{byte}[.{bit}]`

Area प्रारूप: `[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               | प्रक्रिया 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 में real time में tag values की निगरानी के लिए एक built-in web dashboard शामिल है। सेवा चलने के बाद, इसे यहाँ एक्सेस करें `http://<device-ip>:8007`.

Dashboard पर इंटरैक्टिव Swagger documentation भी उपलब्ध है `/docs` और एक visual config builder यहाँ है `/static/config-builder.html`.

### API Endpoints

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

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

| लक्षण                                         | समाधान                                                                                                                                |
| --------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- |
| "PLC कनेक्ट नहीं है" (Allen-Bradley)          | PLC address format (IP/Slot) सत्यापित करें, port 44818 के reachable होने की जांच करें                                                 |
| "PLC कनेक्ट नहीं है" (Modbus)                 | IP/port (डिफ़ॉल्ट 502) की जांच करें और सत्यापित करें कि Unit ID device से मेल खाता है                                                 |
| "PLC कनेक्ट नहीं है" (Siemens S7)             | IP/port (डिफ़ॉल्ट 102), rack, और slot मानों की जांच करें; S7-1200/1500 के लिए PUT/GET सक्षम करें और optimized block access अक्षम करें |
| "Function refused" (Siemens S7)               | TIA Portal में PUT/GET अक्षम है, या target DB पर optimized block access सक्षम है                                                      |
| REAL value garbage जैसा पढ़ा जाता है (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.
