[−][src]Module morningstar::prostar_mppt
Interface with the Prostar MPPT (all models) as documented at http://support.morningstarcorp.com/wp-content/uploads/2015/12/PSMPPT_public-MODBUS-doc_v04.pdf
Examples
use morningstar::{error as mse, prostar_mppt as ps}; use std::{thread::sleep, time::{Instant, Duration}}; let con = ps::Connection::new("/dev/ttyUSB0", 1).expect("connection failed"); println!("{}", con.stats().expect("failed to get stats")); // It doesn't like getting commands too quickly sleep(Duration::from_millis(500)); // Stop charging the battery con.write_coil(ps::Coil::ChargeDisconnect, true).expect("failed to stop charging"); sleep(Duration::from_millis(500)); // Start Charging again con.write_coil(ps::Coil::ChargeDisconnect, false).expect("failed to start charging");
Structs
Alarms | |
ArrayFaults | |
Connection | Device connection. |
LoadFaults | |
Settings | Device configuration settings |
Stats | Charge controller statistics |
Enums
ChargeState | |
Coil | |
LoadState |