autocore-std 3.3.30

Standard library for AutoCore control programs - shared memory, IPC, and logging utilities
Documentation
//! # Function Blocks
//!
//! Reusable function blocks for control program development, inspired by the
//! IEC 61131-3 standard. Each block is a stateful struct that you call
//! cyclically (once per scan) from your [`ControlProgram::process_tick`](crate::ControlProgram::process_tick)
//! implementation.
//!
//! ## Available Blocks
//!
//! | Block | Description |
//! |-------|-------------|
//! | [`RTrig`](crate::fb::RTrig) | Rising edge detector (false → true) |
//! | [`FTrig`](crate::fb::FTrig) | Falling edge detector (true → false) |
//! | [`Ton`](crate::fb::Ton) | Timer On Delay — output activates after a duration |
//! | [`SimpleTimer`](crate::fb::SimpleTimer) | One-shot timer for imperative start/check patterns |
//! | [`StateMachine`](crate::fb::StateMachine) | State machine helper with automatic timer management |
//! | [`BitResetOnDelay`](crate::fb::BitResetOnDelay) | Resets a boolean after it has been true for a duration |
//! | [`RunningAverage`](crate::fb::RunningAverage) | Accumulates values and computes their arithmetic mean |
//! | [`Beeper`](crate::fb::Beeper) | Audible beeper controller with configurable beep sequences |
//! | [`Heartbeat`](crate::fb::Heartbeat) | Monitors a remote heartbeat counter for connection loss |
//! | [`Shutdown`](crate::fb::Shutdown) | Non-blocking system shutdown initiation and cancellation via IPC |
//! | [`ni::DaqCapture`](crate::fb::ni::DaqCapture) | NI DAQ triggered capture: arm, wait, read data via IPC |
//!
//! ## Usage Pattern
//!
//! All function blocks follow the same pattern:
//!
//! 1. **Create** the block once (typically in your program struct)
//! 2. **Call** it every scan cycle with the current inputs
//! 3. **Read** its outputs to drive your logic
//!
//! ```ignore
//! use autocore_std::fb::{RTrig, Ton};
//! use std::time::Duration;
//!
//! struct MyProgram {
//!     start_trigger: RTrig,
//!     start_delay: Ton,
//! }
//!
//! impl MyProgram {
//!     fn new() -> Self {
//!         Self {
//!             start_trigger: RTrig::new(),
//!             start_delay: Ton::new(),
//!         }
//!     }
//! }
//! ```
//!
//! ## IEC 61131-3 Naming
//!
//! | IEC 61131-3 Name | Rust Name |
//! |------------------|-----------|
//! | `R_TRIG` | [`RTrig`](crate::fb::RTrig) |
//! | `F_TRIG` | [`FTrig`](crate::fb::FTrig) |
//! | `TON` | [`Ton`](crate::fb::Ton) |
//! | `FB_StateMachine` | [`StateMachine`](crate::fb::StateMachine) |
//! | `FB_BitResetOnDelay` | [`BitResetOnDelay`](crate::fb::BitResetOnDelay) |
//! | `FB_RunningAverage` | [`RunningAverage`](crate::fb::RunningAverage) |
//! | `FB_Beeper` | [`Beeper`](crate::fb::Beeper) |
//! | `FB_Heartbeat` | [`Heartbeat`](crate::fb::Heartbeat) |
//! | `FB_Shutdown` | [`Shutdown`](crate::fb::Shutdown) |

mod r_trig;
mod f_trig;
mod ton;
mod simple_timer;
mod state_machine;
mod bit_reset_on_delay;
mod running_average;
mod beeper;
mod heartbeat;
mod shutdown;
pub mod ni;
pub use r_trig::RTrig;
pub use f_trig::FTrig;
pub use ton::Ton;
pub use simple_timer::SimpleTimer;
pub use state_machine::StateMachine;
pub use bit_reset_on_delay::BitResetOnDelay;
pub use running_average::{RunningAverage, Averageable};
pub use beeper::Beeper;
pub use heartbeat::Heartbeat;
pub use shutdown::Shutdown;