pub struct ReadBitCommand { /* private fields */ }Expand description
Command for reading a single bit from PLC memory.
Implementations§
Source§impl ReadBitCommand
impl ReadBitCommand
Sourcepub fn new(
destination: NodeAddress,
source: NodeAddress,
sid: u8,
area: MemoryArea,
word_address: u16,
bit: u8,
) -> Result<Self>
pub fn new( destination: NodeAddress, source: NodeAddress, sid: u8, area: MemoryArea, word_address: u16, bit: u8, ) -> Result<Self>
Creates a new read bit command.
§Arguments
destination- Destination node addresssource- Source node addresssid- Service ID for request/response matchingarea- Memory area to read from (must support bit access)word_address- Word addressbit- Bit position (0-15)
§Errors
Returns an error if:
- The memory area doesn’t support bit access (DM)
- The bit position is > 15
§Example
use omron_fins::{ReadBitCommand, MemoryArea, NodeAddress};
let cmd = ReadBitCommand::new(
NodeAddress::new(0, 10, 0),
NodeAddress::new(0, 1, 0),
0x01,
MemoryArea::CIO,
100,
5,
).unwrap();Trait Implementations§
Source§impl Clone for ReadBitCommand
impl Clone for ReadBitCommand
Source§fn clone(&self) -> ReadBitCommand
fn clone(&self) -> ReadBitCommand
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 ReadBitCommand
impl RefUnwindSafe for ReadBitCommand
impl Send for ReadBitCommand
impl Sync for ReadBitCommand
impl Unpin for ReadBitCommand
impl UnsafeUnpin for ReadBitCommand
impl UnwindSafe for ReadBitCommand
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