⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mapi232.bas

📁 艾诺97030变频电源远程通讯程序
💻 BAS
字号:
Attribute VB_Name = "mAPI232"
Option Explicit

Public Const B50 = &H0
Public Const B75 = &H1
Public Const B110 = &H2
Public Const B134 = &H3
Public Const B150 = &H4
Public Const B300 = &H5
Public Const B600 = &H6
Public Const B1200 = &H7
Public Const B1800 = &H8
Public Const B2400 = &H9
Public Const B4800 = &HA
Public Const B7200 = &HB
Public Const B9600 = &HC
Public Const B19200 = &HD
Public Const B38400 = &HE
Public Const B57600 = &HF
Public Const B115200 = &H10
Public Const B230400 = &H11
Public Const B460800 = &H12
Public Const B921600 = &H13

Public Const BIT_5 = &H0
Public Const BIT_6 = &H1
Public Const BIT_7 = &H2
Public Const BIT_8 = &H3

Public Const STOP_1 = &H0
Public Const STOP_2 = &H4

Public Const P_EVEN = &H18
Public Const P_ODD = &H8
Public Const P_SPC = &H38
Public Const P_MRK = &H28
Public Const P_NONE = &H0

'MODEM CONTROL setting
Public Const C_DTR = &H1
Public Const C_RTS = &H2

'MODEM LINE STATUS
Public Const S_CTS = &H1
Public Const S_DSR = &H2
Public Const S_RI = &H4
Public Const S_CD = &H8

'error code
Public Const SIO_OK = 0
Public Const SIO_BADPORT = -1    ' no such port or port not opened
Public Const SIO_OUTCONTROL = -2 ' can't control AdvanTech board
Public Const SIO_NODATA = -4     ' no data to read or no buffer to write
Public Const SIO_BADPARM = -7    ' bad parameter
Public Const SIO_WIN32FAIL = -8  ' win32 function call fails, please call

Public Declare Function sio_ioctl Lib "api232.dll" (ByVal port As Long, ByVal baud As Long, ByVal mode As Long) As Long
Public Declare Function sio_getch Lib "api232.dll" (ByVal port As Long) As Long
Public Declare Function sio_read Lib "api232.dll" (ByVal port As Long, ByVal buf As String, ByVal length As Long) As Long
Public Declare Function sio_putch Lib "api232.dll" (ByVal port As Long, ByVal Term As Long) As Long
Public Declare Function sio_write Lib "api232.dll" (ByVal port As Long, ByVal buf As String, ByVal length As Long) As Long
Public Declare Function sio_flush Lib "api232.dll" (ByVal port As Long, ByVal func As Long) As Long
Public Declare Function sio_iqueue Lib "api232.dll" (ByVal port As Long) As Long
Public Declare Function sio_oqueue Lib "api232.dll" (ByVal port As Long) As Long
Public Declare Function sio_lstatus Lib "api232.dll" (ByVal port As Long) As Long
Public Declare Function sio_lctrl Lib "api232.dll" (ByVal port As Long, ByVal mode As Long) As Long
Public Declare Function sio_break Lib "api232.dll" (ByVal port As Long, ByVal time As Long) As Long
Public Declare Function sio_flowctrl Lib "api232.dll" (ByVal port As Long, ByVal mode As Long) As Long
Public Declare Function sio_Tx_hold Lib "api232.dll" (ByVal port As Long) As Long
Public Declare Function sio_close Lib "api232.dll" (ByVal port As Long) As Long
Public Declare Function sio_open Lib "api232.dll" (ByVal port As Long) As Long
Public Declare Function sio_getbaud Lib "api232.dll" (ByVal port As Long) As Long
Public Declare Function sio_getmode Lib "api232.dll" (ByVal port As Long) As Long
Public Declare Function sio_getflow Lib "api232.dll" (ByVal port As Long) As Long
Public Declare Function sio_DTR Lib "api232.dll" (ByVal port As Long, ByVal mode As Long) As Long
Public Declare Function sio_RTS Lib "api232.dll" (ByVal port As Long, ByVal mode As Long) As Long
Public Declare Function sio_baud Lib "api232.dll" (ByVal port As Long, ByVal speed As Long) As Long
Public Declare Function sio_data_status Lib "api232.dll" (ByVal port As Long) As Long
Public Declare Function sio_putb Lib "api232.dll" Alias "sio_write" (ByVal port As Long, ByVal buf As String, ByVal length As Long) As Long
Public Declare Function sio_linput Lib "api232.dll" (ByVal port As Long, ByVal buf As String, ByVal length As Long, ByVal Term As Long) As Long
Public Declare Function sio_putb_x Lib "api232.dll" (ByVal port As Long, ByVal buf As String, ByVal length As Long, ByVal Tick As Long) As Long
Public Declare Function sio_view Lib "api232.dll" (ByVal port As Long, ByVal buf As String, ByVal length As Long) As Long

Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -