pub struct Client {
pub plc_type: &'static str,
pub comm_type: &'static str,
pub network: u8,
pub pc: u8,
pub dest_moduleio: u16,
pub dest_modulesta: u8,
pub timer: u8,
pub sock_timeout: u64,
/* private fields */
}Fields§
§plc_type: &'static str§comm_type: &'static str§network: u8§pc: u8§dest_moduleio: u16§dest_modulesta: u8§timer: u8§sock_timeout: u64Implementations§
Source§impl Client
impl Client
pub fn new( host: String, port: u16, plc_type: &'static str, use_e4: bool, ) -> Self
pub fn set_debug(&mut self, enable: bool)
pub fn connect(&mut self) -> Result<(), Box<dyn Error>>
pub fn set_subheader_serial( &mut self, subheader_serial: u16, ) -> Result<(), String>
pub fn close(&mut self) -> Result<(), Box<dyn Error>>
pub fn send(&self, send_data: &[u8]) -> Result<(), Box<dyn Error>>
pub fn recv(&self) -> Result<Vec<u8>, Box<dyn Error>>
pub fn set_comm_type(&mut self, comm_type: &str)
pub fn encode_value( &self, value: i64, mode: DataType, is_signal: bool, ) -> Result<Vec<u8>, Box<dyn Error>>
pub fn batch_read( &mut self, ref_device: &str, read_size: usize, data_type: DataType, decode: bool, ) -> Result<Vec<Tag>, Box<dyn Error>>
pub fn batch_write( &self, ref_device: &str, values: Vec<i64>, data_type: &DataType, ) -> Result<(), Box<dyn Error>>
pub fn read(&self, devices: Vec<QueryTag>) -> Result<Vec<Tag>, Box<dyn Error>>
pub fn write(&self, devices: Vec<Tag>) -> Result<(), Box<dyn Error>>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Client
impl !RefUnwindSafe for Client
impl !Send for Client
impl !Sync for Client
impl Unpin for Client
impl !UnwindSafe for Client
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