From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Improper error handling by activeX control of MG17 motor

Solved!
Go to solution

Hi

 

  I have a VI that communicates with MG17 motors using activeX controls. All the nodes are wired to error clusters. We sometimes have communication issues with the motors, but instead of generating an error in the Error Out cluster, LabVIEW itself throws an error. This is frustrating as after I close the window, LabVIEW keeps running the program with "no error" in the output wire, which necessarily makes it run into more errors in the same way. This makes it impossible to handle the error in the VI itself, and when incorporated into larger VI's, the only way to recover it to shutdown LabVIEW from the task manager and restart. Any ideas? I attach the code we use. Initializemotors calls TLMotorStartCtrl and TL error. 

 

Thanks!

Download All
0 Kudos
Message 1 of 6
(2,723 Views)
Solution
Accepted by topic author ronenGabizon

It's been a while since I used this code but I think if you run the function "EnableEventDlg" and set it to False for every motor it'll stop the popups.

 

I think we also set it up where we either registered for error events and then checked for that occurring regularly, or we set up the MG17Logger object and checked it for Error entries in the log.

Message 2 of 6
(2,719 Views)

Worked! Thanks!

0 Kudos
Message 3 of 6
(2,707 Views)

Greetings Kyle and Ronen!

Would you please elaborate how you were able to access the EnableEventDlg method? I need to disable it so that the eventlog doesn't pop up but I can't seem to find this method in the MG17Logger or MG17System ActiveX?

0 Kudos
Message 4 of 6
(2,368 Views)

The version of the ActiveX control I used is not the most recent version, so this may be different now, but it's on a "per motor" basis, not the system in general:

 

1. Add the ActiveX control to the front panel (use this guide, page 18 if needed)

2. Using the terminal on the block diagram that corresponds to the control, create a property node to write the serial number to ("HWSerialNum")

3. Create an invoke node for the StartCtrl function

4. Create an invoke node for the EnableEventDlg function and wire a False constant to the input

5. Repeat for each motor you have

6. Do everything else in your program

 

 

0 Kudos
Message 5 of 6
(2,363 Views)

Thanks for your prompt reply. I am not seeing the EnableEventDlg method for either MG17Logger or MG17System controls. According to the APT Server help file, this method should be a part of MG17System control.

 

I was able to find the method as part of MG17Motor control so can do your steps 2-4 if the program finds a connected motor. Wanted to disable the EventDialog even if there was no motor found at startup. But for now, this will work. Thanks again.

0 Kudos
Message 6 of 6
(2,361 Views)