Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   NI LabVIEW (http://www.chiefdelphi.com/forums/forumdisplay.php?f=182)
-   -   Device Get References - Best Practice Question (http://www.chiefdelphi.com/forums/showthread.php?t=93432)

sheleski 10-03-2011 12:19

Device Get References - Best Practice Question
 
Since this is my first year as Mentor and using Labview I have a best practice question concern device get references.

Should a device get reference be use once or multiple times with the same vi?

Steven

Alan Anderson 10-03-2011 12:43

Re: Device Get References - Best Practice Question
 
I can't say it's the best practice, but I try not to duplicate things when I can just wire the existing value to multiple places.

Doug Norman 11-03-2011 06:49

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.


All times are GMT -5. The time now is 09:30.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi