1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
|
Declare Function OpenAOBTrans Lib "AOBTrans.dll" (ByVal strParam As String, ByVal strDeviceNo As String, ByVal strAddress As String, ByVal iProtocol As Long, ByVal iCharset As Long, ByVal strTagFileName As String) As Long
Declare Function CloseAOBTrans Lib "AOBTrans.dll" () As Long
Declare Sub SetCRChar Lib "AOBTrans.dll" (ByVal strCRChar As String)
Declare Sub SetInputDir Lib "AOBTrans.dll" (ByVal strInputDir As String)
Declare Sub SetOutputDir Lib "AOBTrans.dll" (ByVal strOutputDir As String)
Declare Sub SetErrorDir Lib "AOBTrans.dll" (ByVal strOutputDir As String)
Declare Sub SetDisplayErrorMode Lib "AOBTrans.dll" (ByVal iDisplayError As Long)
Sub OpenCommunication_AOBTrans()
Dim strAddress As String
'Configure directories
SetInputDir("C:\\AOBTrans\\Input") '
SetOutputDir("C:\\AOBTrans\\Output")
SetErrorDir("C:\\AOBTrans\\Error")
'Display error messages
SetDisplayErrorMode(1)
'configure timeout for the connection to 4 s
SetConnectionTimeout(4000)
'Open comm
strAddress = "192.168.1.3" 'CB_DLLEthernet.Text
If (strAddress = "") Then
MsgBox("Please select an address !")
Exit Sub
End If
If (OpenAOBTrans("IPC", "1", strAddress, 0, 0, "table.csv") = -1) Then
MsgBox("Error when opening socket!")
CloseAOBTrans()
Exit Sub
End If
'Selects pipe as carriage return character
SetCRChar("|")
End Sub |
Partager