Crates.io | ljm |
lib.rs | ljm |
version | 0.3.0 |
source | src |
created_at | 2024-02-08 18:54:50.181435 |
updated_at | 2024-04-15 22:47:01.15505 |
description | An idiomatic Rust wrapper for the LabJack LJM library. |
homepage | https://github.com/harrisonmg/ljm |
repository | https://github.com/harrisonmg/ljm |
max_upload_size | |
id | 1132499 |
size | 27,895 |
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.
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()
}