Visual HMIアラートフィルタリング:on_filter_warningマルチデバイスアラートの分散

freeFree Technical Resource

This content is free to read, suitable for basic learning and search traffic.

アラームフィルタリングコールバックon_filter_warning(warning_id)(カスタムファームウェア専用):決定警告が表示されるか表示されないか。。0表示なし、1表示を返します。典型的なシナリオ:HMIは2つのデバイスを管理し、デバイス1のアラーム(ID 1~100)は画面 0で表示され、デバイス2のアラーム(ID 101~200)は画面 2で表示されます。

1.フィルタリングの有効化

on_initの設定:

function on_init
  set_uint16 VT_LW、0x0115、1   アラームフィルタリングの有効化
End of Endシングル

function on_filter_warning warning_id
  local cur = get_uint16 VT_LW、0x0114   - 現在の画面/デバイス番号
  cur === 0の場合
    return warning_id = 1とwarning_id = 101とwarning_id = 200と1または0
  End of Endシングル
  Return 1より
End of Endシングル

2. warning_setとの組み合わせ

空港からのより多くのシナリオ:Modbusからアラームデータを読み取り、warning_setでバッチトリガーし、フィルタコールバックは現在のデバイス関連のみを解放します。

アラームを1回だけ起動します。
function on__resp slave vtype count ret wr
  ...
  j = 0,15 doの場合
    local bitv = j 0x01
    warning_set idx + slave * 100 bitv 1   - アラームIDにコード化されたデバイス番号
  End of Endシングル
End of Endシングル

フィルタリング:現在選択されているデバイスのアラートのみを表示
function on_filter_warning warning_id
  local dev = get_uint16 VT_LW、0x0114      - 現在の設備番号
  local wdev = math.floor warning_id/ 100--所有するデバイスに警告する
  return wdev == dev and 1 or 0
End of Endシングル

デバイスを切り替えた後、0 x 0 1 14に書き込み0 x 0 0 22アラートリストの更新をトリガーします(異なるバージョンの更新メカニズムはファームウェアマニュアルを参照してください)。

2つの穴on_filter_warningは0を非表示、1を表示します。反対を書かない。フィルタリングとアラーム制御は相互関係にあります。フィルタリングは表示にのみ影響し、アラートデータ自体はまだexistenceし、切り替え条件後にリストを積極的に更新して変更を確認します。

広州大彩科技Visual HMI開発ドキュメント(hmi-doc.gz-dc.com)LUAチュートリアル“アラームフィルタリング”、著作権は大彩科技が所有しています。

Put this resource to use in a real project?

Go to the Tool Center for message parsing, CRC verification and device debugging, or submit your requirements for selection and integration advice.

Engineer Membership

Turn this article into actionable debugging resources

After activation, you can use advanced message parsing, resource pack downloads, code examples, engineering cases and priority technical support, suitable for real project delivery.

Unlimited Advanced Tools
Resource & Code Packs
Complete Engineering Case Library
Priority Technical Support

Leave a Reply

Your email address will not be published. Required fields are marked *.