Expand description
§ljm
An idiomatic Rust wrapper for the LabJack LJM library.
This library is far from complete and functionality is added as needed. Please feel free to submit PRs expanding support for the LJM library.
§Usage Requirements
- At least the minimal version of LJM is installed
§Example
use std::ffi::CString;
fn main() -> Result<(), ljm::Error> {
let handle = ljm::Handle::open(
ljm::DeviceType::Any,
ljm::ConnectionType::Any,
ljm::Identifier::DemoMode
)?;
let name = CString::new("TEST_FLOAT32").unwrap();
handle.write_name(&name, 3.14)?;
let value = handle.read_name(&name)?;
handle.close()
}
§Alternative Crates
Structs§
- Handle
- A LabJack device handle.
- LjmString
- A CString that may be no longer than ljm_sys::LJM_STRING_MAX_SIZE, not including null-termination.
- Register
- A Modbus register specified by address and data type.
Enums§
- Connection
Type - A LabJack device connection type.
- Data
Type - An LJM data type.
- Device
Type - A LabJack device type.
- Error
- An LJM error.
- Identifier
- Some ID that may identify a LabJack device to be connected.
- LjmString
Error - An error indicating a failure to construct an LjmString
Functions§
- name_
to_ reg - Takes a Modbus register name as input and produces the corresponding Modbus register.