From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Western NY LabVIEW User Group

cancel
Showing results for 
Search instead for 
Did you mean: 

Error handling with multiple stepper motors

I have an application which has a multiple inputs including 2 or 3 stepper motors, communication over gpib to an instrument and usb connection to compact daq. I will admit that my error handling is not the best and therfore am looking for methods to better handle potential errors during all of the communication.

Thanks!

Brian Charles

0 Kudos
Message 1 of 4
(7,243 Views)

Brian,

Can  you give a few more details on the methods you are using in the DAQ to communicate through the GPIB interface?

Which DAQ are you using?

Does your stepper controller return errors that you need to interpret?

Thanks,

Drew

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

Drew,

The steppers are able to return some error commands. Part of my routine also watches the position and looks for the return signal that indicates that the commanded position was reached. I just have a number of possible error wires, which to me look to be able to be managed better.

The GPIB usees basic serial commands.  I am using the cDAQ 9174 with a 9211 and 9215.

Brian

0 Kudos
Message 3 of 4
(6,511 Views)

Hi Brian,

In the past, when I've had multiple parallel sections of code executing at once, I have utilized Queues to pass error information back to a master error handler running at the highest layer of my application. So, at the top of my application there is an error handler subVI or loop that just continually dequeues "error" elements and decides how to handle the specific errors from there. At any point in my code that I want an error to be handled I would add a subVI that, when an error occurs will obtain a reference to my named error handler queue, enqueue the error information as my data element, and finally release the queue. The beauty of named queues is that as long as the top level error handler has the queue open you can obtain/release references to that queue anywhere else in your code without having to pass wires all over the place. It keeps things neat. Here is an example of what the Enqueue Error SubVI would look like: EnqueueErrorToHandler_Ex.png

You might even redo this VI so that it only enqueues the unfiltered errors but as a quick example it shows how you can easily pass errors that need to be handled while not having to stop execution of the entire test.

Hope this helps!

-Tim Sileo



Tim Sileo
RF Applications Engineer
National Instruments



You don’t stop running because you get old. You get old because you stop running. -Jack Kirk, From "Born to Run" by Christopher McDougall.
0 Kudos
Message 4 of 4
(6,511 Views)