Giter VIP home page Giter VIP logo

lib_azd_from_kv's Introduction

azd_from_kv

azd のモータドライバを KV7500 から Ethernet/IP で稼働させる

KV7500 にたいしては TCP/IP の上位リンクで指示を出す

usage

.env ファイルに KV のアドレスを記載。ポートは上位リンク専用のポート番号

AzdFromKvConfig_address=192.168.0.10:8501
use dotenv::dotenv;
use azd_from_kv::{AzdFromKvConfig, AzdKvDirectClient};

#[tokio::main]
async fn main() -> anyhow::Result<()> {
    let config = AzdFromKvConfig::from_env().unwrap();
    info!("設定取得完了");
    let mut azd = AzdKvDirectClient::create(config).await?;
    info!("クライアント作成完了");

    // 動作
    azd.throw_command_direct_move(9000, 500).await?;
    info!("動作指令完了");
    azd.wait_start_move().await?;
    azd.throw_command_direct_move_trigger_off(9000, 500).await?;
    info!("トリガーオフ");
    azd.check_finish_move().await?;
    info!("動作完了");

    azd.throw_command_direct_move(0, 4000).await?;
    info!("基準位置復帰動作指令完了");
    azd.wait_start_move().await?;
    azd.throw_command_direct_move_trigger_off(0, 2000).await?;
    info!("トリガーオフ");
    azd.check_finish_move().await?;
    info!("動作完了");

    Ok(())
}

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.