GithubHelp home page GithubHelp logo

kzyred / mmapper Goto Github PK

View Code? Open in Web Editor NEW

This project forked from yudaikitamura/mmapper

0.0 0.0 0.0 9 KB

三菱製ライブラリMX Componentを手軽に利用する為のラッパークラス

License: MIT License

C# 100.00%

mmapper's Introduction

MMapper

三菱製ライブラリMX Componentを手軽に利用する為のラッパークラス

概要

PLCのデバイスと変数をマッピングしデバイスへのアクセスを手軽にします。
UnitTestとの相性も良くC#でPLCプログラムのテストコードを簡単に記述しテスト自動化にも利用可能です。

PLC論理番号設定

MX Componentで設定した論理番号を指定します。

PLC.Dev.LogicalNo = 1;

デバイス数設定

デバイスタイプ毎のデバイス数を設定します。

// 内部デバイスMのデバイス数を9999に変更
PLC.Dev.Length.M = 9999;

ビットデバイスの読み込み

// XE0
var ret = PLC.Dev.X["E0"].Value;

ビットデバイスの書き込み

// XE0をON
PLC.Dev.X["E0"].Value = true;

ワードデバイスの読み込み

// シングルワード(short)
var ret = PLC.Dev.D["0"].SingleValue;

// ダブルワード(int)
var ret = PLC.Dev.D["0"].DoubleValue;

// 単精度浮動小数(float)
var ret = PLC.Dev.D["0"].FloatValue;

ワードデバイスの書き込み

// シングルワード(short)
PLC.Dev.D["0"].SingleValue = 1234;

// ダブルワード(int)
PLC.Dev.D["0"].DoubleValue = 1234;

// 単精度浮動小数(float)
PLC.Dev.D["0"].FloatValue = 123.4;

mmapper's People

Contributors

kitamurayudai avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.