|
Re: Device Get References - Best Practice Question
I agree with Alan. The main idea is to use the Set Reference once (typically in Begin.vi). Then use the Get Reference where needed - typically once in other VIs like Autonomous and Teleop. You could use it multiple places in Teleop, but it might eventually make your code harder to read and maintain.
They main reason we introduced the Set Reference and Get Reference was to encourage the use of a single Open VI in Begin.vi. Otherwise we found it was common for teams to use one Open in Autonomous, and then the same Open in Teleop without using a Close first. This would cause errors - trying to open a resource that was already opened.
__________________
Doug Norman
National Instruments
|