NPORT5230编程要点:
服务器控制:
一、 初始化:Declare  Function nsio_init “IPSerial.dll” () as  long
          NSIO_OK(0): OK;
NSIO_SOCK_INIT_FAIL(-201):    Socket initialize error.
          NSIO_THREAD_ERR-3):Create background thread fail.
二、 结束:Declare Function nsio_end "IPSerial.dll" () As Long
          NSIO_OK(0): OK;
          NSIO_SOCK_ERR(-202):Communication with NPort error
三、 复位:Declare Function nsio_resetserver "IPSerial.dll" (ByVal server_ip As String, ByVal        password As String) As Long
          NSIO_OK(0): OK;
          NSIO_TIMEOUT(-203):Communication with NPort timeout
          NSIO_NOT_ALIVE(-102):NPort is not alive. Maybe the NPort is power down or network cable is disconnected 
          NSIO_SOCK_ERR(-202):Communication with NPort error
四、 是否活动:Declare Function nsio_checkalive "IPSerial.dll" (ByVal server_ip As String, ByVal timeout As Long) As Long
          server_ip: NPort IP address, specified by null terminated string. Ex: "192.168.127.254".
timeout: The timeout value for connecting NPort in milliseconds. 
NSIO_OK(0): OK;
NSIO_SOCK_ERR(-202):Communication with NPort error
NSIO_TIMEOUT(-203):Communication with NPort timeout
NSIO_NOT_ALIVE(-102):NPort is not alive. Maybe the NPort is power down or network cable is disconnected
端口控制:
server error啥意思一、 打开端口:Declare Function nsio_open "IPSerial.dll" (ByVal server_ip As String, ByVal port_index As Long, ByVal timeouts As Long) As Long
      server_ip: NPort IP address, specified by null terminated string. Ex: "192.168.127.254".
port_index: The serial port number of the NPort. 1 for 1st port, 2 for 2nd port, and so on. 
Timeouts: The timeout value for communicate with NPort in milliseconds. 
Succeed:Port id.
NSIO_BADPARM(-2):Bad parameter
NSIO_MEMALLOCERR(-4):memory allocate error
NSIO_SOCK_INIT_FAIL(-201):    Socket initialize error.
NSIO_CONNECT_FAIL(-200):Connect to NPort fail. Maybe the NPortis power down or network cable is disconnected.
NSIO_SOCK_ERR(-202):Communication with NPort error
NSIO_TIMEOUT(-203):Communication with NPort timeout

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。