
Publication # 68-00155 (Rev: B 26-JULY-95) Page 5
PortType as Integer ‘0-None, 1-ISA, 2-Com Port
PortNum as Integer ‘0-7 ISA, 1-4 Com
Baud as Integer ‘Baud Rate for Com port 300, 600, 1200, 2400, 4800, 9600, 12800, 38400
Parity as Integer ‘Parity 0 = None(N), 1=Even(E), 2=Odd(O)
Data_Bits as Integer ‘The number of data bits for the com port 7 or 8
Stop_Bits as Integer ‘The number of stop bits for the com port 1 or 2
Handshake as Integer ‘Handshaking for the com port 0=None(N), 1=Software(S) (RTS/CTS),
2=Hardware(H) (Xon/Xoff)
Protocol as Integer ‘0=None(N), 1=YModem(Y)
End Type
Open Port
Declare Function port_open Lib “hia.dll” (ByVal PortSpec as String, Comm_Data as COMM_DATA_TYPE) as Integer
This routine is designed to open communication between the personal computer and the ISA generator. The string
parameter ‘portspec’ is used to describe the type of communication link. The format of the portspec string should
follow this protocol:
MODE COM1-4 <baud> [<parity> [<data> [<stop> [<handshake> [<protocol>]]]]]
ISA0-7 300 N = None 7 1 N = None N = None
600 E = Even 8 2 S = Soft Y = YModem
1200 O = Odd H = Hard
2400
4800
9600
19200
38400
Here are a couple of examples:
portspec = “MODE ISA0”
portspec = “MODE COM1 2400 N 8 1 N N”
Included with the software disk is a sample program example.mak showing how the DLL can be accessed using a
Visual Basic program. In the file Example.frm the subroutine ‘Sub cmdOpenPort_Click’ demonstrates how the
open_port external function is used. The function will return a value of 0 if the command was downloaded
successfully otherwise an integer value describing an error message will be returned.
Sub cmdOpenPort_Click ()
Dim Answer as Integer ‘Value returned from DLL
‘Initialize the data in comm_data_type needed for ISA port communication
comm_data.portType = ISA_Connection ‘ISA_Connection = 1 defined globally
comm_data.PortNum = 0
‘Create string to send to the DLL describing the port
PortSpec = “ISA” & comm_data.PortNum
Kommentare zu diesen Handbüchern