EasyManua.ls Logo

marposs Quick Digit - Script Microsoft Visual Basic

Default Icon
36 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
CHAPTER 5
25/10/17
Quick Digit
TM
Bluetooth
®
Driver
27
3.6
5.2.1 Script Microsoft
®
Visual Basic
®
‘Marposs VID (Vendor ID) USB Devices
Const VID_ToSearch = “VID_0C48”
‘Time (in milliseconds) to wait before the VMUX program is started
‘ If, testing, you see that, when MARPOSS_ONLINE is started, not all
‘ the Sylvac Devices are connected, increase this timeout.
Const Timeout_ToWait = 30000
‘Complete path of the VMUX program that must be started BEFORE the
‘MARPOSS_ONLINE please check the installation path
Const Program_ToStart = “C:\Program Files (x86)\Vmux\VirtualMux.exe”
‘Complete path of the Marposs program (in this example “Quick SPC”)
‘please check the installation path
Const MARPOSS_ONLINE = “C:\Program Files (x86)\QSPCW\Bin\Autorun.exe”
Dim fso, f, Index
Index = 0
Redim f(Index)
Set fso = CreateObject(“Scripting.FileSystemObject”)
Set portList = GetComPorts()
portnames = portList.Keys
for each pname in portnames
Set portinfo = portList.item(pname)
If InStr(1, portinfo.PNPDeviceID, VID_ToSearch, 1) <> 0 Then
‘wscript.echo pname & “ - “ & _
‘ portinfo.Manufacturer & “ - “ & _
‘ portinfo.PNPDeviceID & _
‘ “ “ & _
‘ portinfo.Name & vbNewLine & pname
Index = Index + 1
Redim Preserve f(Index)
If CInt(Mid(pname, 4)) > 9 then
Set f(Index) = fso.OpenTextFile(“\\.\” & pname)
Else
Set f(Index) = fso.OpenTextFile(pname)
End If
End If
Next