[][src]Crate ethercat_esi

EtherCAT Slave Information (ESI).

The EtherCAT Slave Information (ESI) file is an XML file that is used by some EtherCAT master stacks to configure the slaves and generate network description files. However, it's main purpose is to describe how data is shared with the slave, including what sync managers it uses, and what PDOs are in each sync manager.

The official XML schema can be found in the EtherCAT Slave Information (ESI) Schema (see EtherCATInfo.xsd).

Example

use ethercat_esi::EtherCatInfo;
use std::{
    env,
    fs::File,
    io::{self, prelude::*},
};

fn main() -> io::Result<()> {
    match env::args().nth(1) {
        None => {
            eprintln!("Missing filename");
        }
        Some(file_name) => {
            let mut xml_file = File::open(file_name)?;
            let mut xml_string = String::new();
            xml_file.read_to_string(&mut xml_string)?;
            let info = EtherCatInfo::from_xml_str(&xml_string)?;
            println!("{:#?}", info);
        }
    }
    Ok(())
}

Structs

Description

Further slave descriptions.

Device
EtherCatInfo

EtherCAT Slave Information (ESI).

Group
HexBinary

HexBinary represents arbitrary hex-encoded binary data.

Mailbox
Module
Pdo

Process Data Object (PDO).

PdoEntry

PDO Entry.

PdoEntryIdx

PDO Entry Index

PdoIdx

PDO Index

Profile
Sdo

Service Data Object (SDO).

Sm

Sync Manager (SM).

SmIdx

Sync Master Index

SubIdx

Object Directory Sub-index

Vendor

Vendor information.

Enums

Image

Image data (BMP file format).