1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

FANUCのPMCラダーでバイナリデータをビットにデコードする方法

Last updated at Posted at 2024-01-23

概要

FANUCのPMCラダーで、バイナリ入力をビットに変換する手法を2つ紹介する。

バイナリ→ビット変換の方法

  • EQBでひたすら比較する
  • DECBでまとめてビットにデコードする

EQBでひたすら比較する

機能命令200 EQB(バイナリ比較)を使用して、入力データと定数を比較し一致をビットに出力させる。

image.png

入力データの範囲が小さい場合や、特定の値だけを取得したいときは、こちらの方で十分。
使用するアドレスが少なくて済むため、メモリ容量が小さくなる。

DECBでまとめてビットにデコードする

機能命令25 DECB(バイナリデコード処理)を使用して、まとめてビットデータに出力する。

image.png

入力データが大きい場合や、複数の値をインタロック等の条件に使用したいときはこちらを使う。
バイト単位でしかアドレス範囲を指定できないので、メモリ容量が大きくなりがちです。

まとめ

基本的にはDECBでデコードしてあげるのが簡単です。
わざわざEQBで一つひとつビットに起こすのはナンセンスだと思います。

参考

電装制御屋の備忘録

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?