pub struct WriteBitCommand { /* private fields */ }Expand description
Command for writing a single bit to PLC memory.
Implementations§
Source§impl WriteBitCommand
impl WriteBitCommand
Sourcepub fn new(
destination: NodeAddress,
source: NodeAddress,
sid: u8,
area: MemoryArea,
word_address: u16,
bit: u8,
value: bool,
) -> Result<Self>
pub fn new( destination: NodeAddress, source: NodeAddress, sid: u8, area: MemoryArea, word_address: u16, bit: u8, value: bool, ) -> Result<Self>
Creates a new write bit command.
§Arguments
destination- Destination node addresssource- Source node addresssid- Service ID for request/response matchingarea- Memory area to write to (must support bit access)word_address- Word addressbit- Bit position (0-15)value- Bit value to write
§Errors
Returns an error if:
- The memory area doesn’t support bit access (DM)
- The bit position is > 15
§Example
use omron_fins::{WriteBitCommand, MemoryArea, NodeAddress};
let cmd = WriteBitCommand::new(
NodeAddress::new(0, 10, 0),
NodeAddress::new(0, 1, 0),
0x01,
MemoryArea::CIO,
100,
5,
true,
).unwrap();Trait Implementations§
Source§impl Clone for WriteBitCommand
impl Clone for WriteBitCommand
Source§fn clone(&self) -> WriteBitCommand
fn clone(&self) -> WriteBitCommand
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for WriteBitCommand
impl RefUnwindSafe for WriteBitCommand
impl Send for WriteBitCommand
impl Sync for WriteBitCommand
impl Unpin for WriteBitCommand
impl UnsafeUnpin for WriteBitCommand
impl UnwindSafe for WriteBitCommand
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more