10-24-2014 09:42 AM
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
10-24-2014 03:38 PM
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
10-27-2014 09:31 AM
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
11-10-2014 09:21 AM
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:
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