12-29-2008 06:36 PM
I'm using a few different Thorlabs motors with LabWindows/CVI (controlled via ActiveX) and when the motor is not attached, an error window pops up to tell you. Ideally I would like that generated event to call a callback function so I can handle that error internally (i.e. if the motor isn't connected, my program should be smart enough to know and just disable everything having to do with that motor). I've tried to use the DMG17MotorEventsRegOnHWResponse, but it seems like this only responds to responses coming from the hardware...which of course isn't connected in my case. I haven't heard much from Thorlabs, and their documentation is pretty week overall (and in particular for LabWindows/CVI). The error code that pops up in the "Event Information Panel" is Code = 10109 - "Control HW Communications Disabled" with some obvious explanation about how the hardware might not be present or communicating properly. Incidentally, it turns out that this error doesn't pop up with the "StartCtrl" command as you might expect, but only with the next command. And while it can subsequently be trapped with the return value from the function call, you can't stop the "Event Information Panel" from popping up....or can you?
Thanks to all who might have advice (not expecting to hear from Thorlabs for a long time.....)
02-17-2009 05:29 AM
Hi,
No solution to your problem, but just concurring that in my experience also the Event Information window keeps popping up even after application has been closed (using LabVIEW by the way and a Thorlabs BDC101 controller). Have been searching around looking for a way of using this information to control/adjust startctrl/enableHWchannel/MoveHome etc, the obvious thing to do when information like this is generated.
What I have been able to do however, is using the low level method LLGetStatusBits have been able to determine the status of the controller before running my main program. For the BDC101, LLGetStatusBits returns a 32 bit integer (usually negative, would have expected an unsigned number....). Bits 1-4 determine the hardware and software limit switches status (statuses/stati??) 5&6 determine whether motor is running in CW or CWW directions (or not); 7&8 motor jogging CW or CCW, bit 9 motor connected, bit 10 motor homing, bit 11 motor homed, bits 12-29 skip, bit 30 unit active or not, bit 31 skip, bit 32 channel enabled.
Once I startctrl to begin communication with the motor and run LLGetStatusBits I can do a basic system configure. I know this does not deal programmatically with the Events Information you described but it prevents some of them occuring by addressing the setup initially.
Hope this helps,
Leeser
09-01-2010 05:58 AM
I am having the same issue. Can anyone suggest ways to trap the controller error message within LabView so that LabView can appropriately handle the error?
09-01-2010 06:17 AM
Hi,
you might get better response posting your question in the LabVIEW forum; this one here is dedicated to LabWindows/CVI.
09-01-2010 08:05 AM
Can't speak for LabView, but you can prevent the rather annoying error pop-up within CVI by calling the MotorEnableEventDlg() function with the third parameter set to FALSE. As this is one of the ActiveX functions for the motor control system I presume they are also accessible from LabView somehow.
JR
09-20-2010 05:17 AM
Thanks, EnableEventDlg method works fine.