gsdtool

Crates.iogsdtool
lib.rsgsdtool
version0.3.0
sourcesrc
created_at2023-12-28 15:46:56.938581
updated_at2024-10-31 20:47:06.812934
descriptionCLI utility for PROFIBUS GSD files (Generic Station Descripions)
homepagehttps://github.com/rahix/profirust/tree/main/gsdtool
repositoryhttps://github.com/rahix/profirust
max_upload_size
id1082489
size38,958
Rahix (Rahix)

documentation

README

gsdtool - CLI tool for PROFIBUS GSD files crates.io page

gsdtool provides utilities for working with GSD files, expecially in the context of the profirust PROFIBUS communication stack.

Installation

cargo install gsdtool

Generating Peripheral Configuration

The config-wizard subcommand interactively generates peripheral configuration data using selected modules and setting values:

 gsdtool config-wizard FRAB4711.gsd
Welcome to the station configuration wizard!
Station: "FRABA Encoder" from "FRABA"
Ident:   0x4711

Selecting modules (maximum 1):
Select module 1/1 (ESC to stop): Class 2 Multiturn
Code sequence: Increasing clockwise (0)
Class 2 functionality: Enable
Scaling function control: Enable
Measuring units per revolution (0 - 8192): 4096
Total measuring range (high) (0 - 512): 256
Total measuring range (low) (0 - 65535): 0

Peripheral Configuration:

    // Options generated by `gsdtool` using "FRAB4711.gsd"
    let options = profirust::dp::PeripheralOptions {
        // ........
    };
    let mut buffer_inputs = [0u8; 4];
    let mut buffer_outputs = [0u8; 4];
    let mut buffer_diagnostics = [0u8; 57];

Parsing Device-based Diagnostics

The diagnostics subcommand parses diagnostics reported by a peripheral using the information from the GSD file:

 gsdtool diagnostics si0380a7.gsd
Diagnostics Data (as fmt::Debug slice): [160, 0, 0, 32, 72, 100, 255, 255, 255, 255, 255, 255, 0, 41, 0, 128, 0, 0]

Bit 29: ====== Segment DP2 ======
Bit 127: A/B shorted, too much resist.
Area 40-47: 100 = Reflection error rate: 100%

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Commit count: 479

cargo fmt