> 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/workflows/ja/chtoriaru/integrate-with-ignition/embed-the-device-hmi.md).

# Device HMI を埋め込む

ライブ映像と最新の検出結果を表示する Roboflow Device HMI を、Ignition Perspective または Vision の画面に配置します。

Deployment Manager で管理されている各エッジデバイスでは、ライブカメラ映像、合格率、最近の検出結果を表示するオペレーター画面である Device HMI が動作します。Ignition に埋め込むのが、オペレーターの画面に Roboflow を表示する最も手早い方法です。コンポーネントを1つ配置するだけで、スクリプトは不要です。

<figure><img src="https://4077895066-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoO0Ceoy9R0lHDZATcPyh%2Fuploads%2Fgit-blob-52102ca0b3bc7f010f5f77ca8c62f0e14b161241%2Fignition-device-hmi-embed.png?alt=media" alt="An Ignition Perspective view named Bottle Line 1 with the Roboflow Device HMI embedded in an Inline Frame, showing a live annotated feed, a 78.7 percent pass rate, and recent pass and fail detections"><figcaption><p>Perspective の Inline Frame に表示された Device HMI。</p></figcaption></figure>

HMI は Ignition のビュー内に表示される Roboflow の画面です。Ignition から HMI の値を読み取ったり、タグの値を HMI に送信したりすることはできません。Roboflow の結果を Ignition 独自のタグ、アラーム、画面で使う方法については、以下をご覧ください。 [ライブデータ](https://docs.roboflow.com/workflows/ja/chtoriaru/integrate-with-ignition/live-data.md), [ライブ動画](https://docs.roboflow.com/workflows/ja/chtoriaru/integrate-with-ignition/live-video.md)、および [履歴データ](https://docs.roboflow.com/workflows/ja/chtoriaru/integrate-with-ignition/historical-data.md).

{% hint style="info" %}
以下の手順とスクリーンショットは、Ignition 8.1（Designer 8.1.55）のものです。メニュー名、ダイアログ、プロパティ名は、8.3 を含む他のバージョンでは異なる場合があります。
{% endhint %}

## 前提条件

* 少なくとも1つのストリームを実行している、 [Deployment Manager](https://docs.roboflow.com/deployment/self-hosted/enterprise/deployment-manager)で管理されているエッジデバイス。
* ビューを表示する各コンピューターから、ポート `3000`を介してデバイスにアクセスできる必要があります。HMI は Ignition ゲートウェイではなく、オペレーターのブラウザーで読み込まれます。動画とイベントはデバイス上の別のサービスから直接読み込むため、クライアントでほかのポートを開く必要はありません。

## HMI のアドレスを確認する

HMI は次のアドレスで動作します。 `http://<device-ip>:3000`Deployment Manager のデバイスカードからリンクを開けます。埋め込む内容を選びます。

<table data-search="false"><thead><tr><th>アドレス</th><th>表示内容</th></tr></thead><tbody><tr><td><code>http://&#x3C;device-ip>:3000/</code></td><td>HMI 全体：ライブ映像、合格率、最近の検出結果</td></tr><tr><td><code>http://&#x3C;device-ip>:3000/stream/&#x3C;stream></code></td><td>1つのストリームの動画を全画面表示。周囲にほかの要素は表示されません</td></tr></tbody></table>

`<stream>` はストリーム名です。HMI でストリームのタブにある「新しいタブで開く」アイコンをクリックすると、そのアドレスが開きます。

Ignition に追加する前に、オペレーターのコンピューターのブラウザーでアドレスを開いて確認してください。Ignition にはアドレスが保存されるため、デバイスには固定 IP アドレスまたは DNS 名を設定してください。

## Perspective

1. Designer で Perspective ビューを開き、「Inline Frame」コンポーネントをビューにドラッグします。
2. 次の値を設定します。 `props.src` HMI のアドレスに設定します。
3. コンポーネントのサイズを調整します。1つのストリームを表示する場合は、カメラ映像に近い縦横比（例：16:9）にします。

<figure><img src="https://4077895066-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoO0Ceoy9R0lHDZATcPyh%2Fuploads%2Fgit-blob-45436383c06d632d963e3e0074804b6d195682d3%2Fignition-designer-hmi-inline-frame.png?alt=media" alt="Ignition Designer with a Perspective view showing the Roboflow Device HMI in an Inline Frame, and the Property Editor with src set to http://192.168.10.57:3000/"><figcaption><p>Inline Frame に表示された Device HMI。Designer 上でも読み込まれます。</p></figcaption></figure>

すべてのラインで同じビューを使うには、 `deviceHost` ビューのパラメーターを追加し、 `props.src` を次の式にバインドします。

```
"http://" + {view.params.deviceHost} + ":3000/"
```

### HTTPS での Perspective の利用

HMI は HTTP で配信されます。ブラウザーは、 `http://` のページを、 `https://`で読み込まれたページ内に表示することをブロックするため、Perspective セッションで HTTPS を使っている場合、フレームは空白のままになります。HMI の前段に HTTPS リバースプロキシを配置してその `https://` アドレスを使うか、工場ネットワーク上で HTTP によるセッションを開いてください。

## Vision

1. Designer で Vision ウィンドウを開き、「Web Browser」コンポーネントをウィンドウにドラッグします。このコンポーネントは、Component Palette の「Web Browser」グループにあります。
2. Vision Property Editor の「Data」で、「Mode」を「URL」のままにし、「Starting URL」に HMI のアドレスを設定します。
3. ブラウザーのアドレスバーを非表示にするには、「Behavior」の「Show Navigation Buttons」をオフにします。

<figure><img src="https://4077895066-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FoO0Ceoy9R0lHDZATcPyh%2Fuploads%2Fgit-blob-13d2380d602dab774927f20a105303210d277156%2Fignition-vision-hmi-web-browser.png?alt=media" alt="Ignition Designer with a Vision window showing the Roboflow Device HMI in a Web Browser component, and the Vision Property Editor with Mode set to URL and Starting URL set to http://192.168.10.57:3000/"><figcaption><p>Vision の Web Browser コンポーネントに表示された Device HMI。</p></figcaption></figure>

Ignition 8.1では、Web BrowserコンポーネントはWeb Browserモジュールから提供されます。このモジュールは個別にインストールし、ライセンスを取得します。8.3ではVisionの一部です。このコンポーネントはHMIを独立したページとして表示するため、上記のHTTPS制限はVisionには適用されません。詳しくは、 [Web Browserコンポーネント](https://docs.inductiveautomation.com/docs/8.3/appendix/components/vision-components/misc/web-browser).

## トラブルシューティング

<table data-search="false"><thead><tr><th>問題</th><th>対処方法</th></tr></thead><tbody><tr><td>HTTPS経由のセッションでフレームが空白になる</td><td>ブラウザーが混在コンテンツをブロックしています。「HTTPS経由のPerspective」を参照してください。</td></tr><tr><td>フレームに「このサイトにアクセスできません」と表示される</td><td>同じコンピューターのブラウザーでHMIアドレスを開きます。そこで開けない場合、そのコンピューターはポート <code>3000</code>.</td></tr><tr><td>HMIは読み込まれるが、映像エリアが空白になる</td><td>アドレス内のストリーム名が、実行中のストリームと一致していません。Deployment Managerでストリームを確認してください。</td></tr><tr><td>Ignition内で「デバイス設定」のロックを解除できない</td><td>デバイス設定を変更するには、HMIアドレスをブラウザーの独立したタブで開いてください。</td></tr></tbody></table>

## セキュリティ

HMIのライブ映像にはサインインがありません。ポート `3000` 経由でデバイスにアクセスできる人は誰でも映像を視聴できます。デバイスを信頼できるネットワークに接続し、既定の「デバイス設定」パスワードを変更してください。
