I’m trying to get Phidgets working using MBS plugins. In all cases when I use the examples, I always get a ‘Could not load DLL’ error. Here is the load line:
dim b as boolean = LoadPhidgetWindowsDLLMBS("C:\Program files\Phidgets\Phidget22\phidget22.dll")
p=new MyPhidget
DLL file exists and all is working using Phidgets installed software. I cannot see any obvious MBS plugin dependency that I’m missing. Tried both the Phidget manager and Phidget RFID Test examples. I’m using MBS Plugins 21.1. Due to release of Phidget22, assume the MBS plugin is coded against this dll version.
Any ideas welcome. Got a feeling it’ll be something simple that I’m overlooking…
#If TargetWindows
Const path = "Phidget22.dll"
#ElseIf TargetMacOS Then
Const path = "/Library/Frameworks/Phidget22.framework"
#EndIf
If not PhidgetManagerMBS.LoadLibrary(path) Then
MsgBox "Phidgets load error:." + EndofLine+PhidgetManagerMBS.LibraryLoadError
Return
End If
PhidgetManager = New MyPhidgetManager
PhidgetManager.Open
In the Attached event of MyPhidgetManager:
If LightController = Nil Then
LightController = new PhidgetDigitalOutputMBS
LightController.IsHubPortDevice = True
LightController.Channel = 0
LightController.HubPort = 0
LightController.open
End
This particular app is super-simple and only expects one Phidget. Attachment handling needs to be more complex if you’re doing more I/O.
To control the lights I have a method SetLight(Value as Boolean)
If PhidgetManager <> Nil Then
If LightController <> nil then
If LightController.Attached Then
LightController.State = Value
End
End
End