pub struct S7Client<T: AsyncRead + AsyncWrite + Unpin + Send> { /* private fields */ }Implementations§
Source§impl<T: AsyncRead + AsyncWrite + Unpin + Send> S7Client<T>
impl<T: AsyncRead + AsyncWrite + Unpin + Send> S7Client<T>
pub async fn from_transport(transport: T, params: ConnectParams) -> Result<Self>
pub async fn db_read(&self, db: u16, start: u32, length: u16) -> Result<Bytes>
Sourcepub async fn read_multi_vars(
&self,
items: &[MultiReadItem],
) -> Result<Vec<Bytes>>
pub async fn read_multi_vars( &self, items: &[MultiReadItem], ) -> Result<Vec<Bytes>>
Read multiple PLC regions in one or more S7 PDU exchanges.
Automatically batches items when the item count would exceed the Siemens hard
limit of 20 per PDU, or when the encoded request or response would exceed the
negotiated PDU size. Returns one Bytes per item in input order.
Unlike db_read, this accepts any Area and TransportSize.
Sourcepub async fn write_multi_vars(&self, items: &[MultiWriteItem]) -> Result<()>
pub async fn write_multi_vars(&self, items: &[MultiWriteItem]) -> Result<()>
Write multiple PLC regions in one or more S7 PDU exchanges.
Automatically batches items when the count or encoded size would exceed the
negotiated PDU size or the Siemens hard limit of 20 items per PDU.
Returns Ok(()) only when all items are acknowledged with return code 0xFF.
pub async fn db_write(&self, db: u16, start: u32, data: &[u8]) -> Result<()>
pub async fn read_szl(&self, szl_id: u16, szl_index: u16) -> Result<SzlResponse>
pub async fn read_clock(&self) -> Result<PlcDateTime>
Source§impl S7Client<TcpTransport>
impl S7Client<TcpTransport>
pub async fn connect(addr: SocketAddr, params: ConnectParams) -> Result<Self>
Auto Trait Implementations§
impl<T> !Freeze for S7Client<T>
impl<T> !RefUnwindSafe for S7Client<T>
impl<T> Send for S7Client<T>
impl<T> Sync for S7Client<T>
impl<T> Unpin for S7Client<T>
impl<T> UnsafeUnpin for S7Client<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for S7Client<T>where
T: UnwindSafe,
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