Private Sub CommandButton1_Click()
Set MSK = CreateObject("MercuryCom.FPDrv1C2")
FK_Port = CLng(1)
FK_Port_Speed = CLng(9600)
FK_Password = CStr("0000")
FK_Section = CLng(1)
FK_Nalog = CBool(False)
FK_Model = CLng(11)
FK_Chek_N = CLng(0)
FK_Smena = CLng(0)
ReDim pArray(5)
pArray(0) = FK_Port
pArray(1) = FK_Port_Speed
pArray(2) = FK_Password
pArray(3) = FK_Section
pArray(4) = FK_Nalog
pArray(5) = FK_Model
Dim Err_message As String
Dim Id_device As String
MsgBox ("Версия ПО -" + MSK.GetVersion)
If Not MSK.DeviceTest(pArray, Err_message) Then
MsgBox Err_message
Exit Sub
End If
If Not MSK.Open(pArray, Id_device) Then
MsgBox ("Ошибка 1")
Exit Sub
End If
If Not MSK.CashInOutcome(Id_device, 12500) Then
MsgBox ("Ошибка 2")
Exit Sub
End If
End Sub