Randall Thurman Posted September 20, 2005 Report Share Posted September 20, 2005 I have often broken the rules about using property nodes for writing values. Typically I will break this rule if there is a need to dynamically change control states of controls in various front panels usually to update a control state that was changed programmatically or in another vi. These are situations where changes may happen every few minutes as opposed to every second. Other situations are for setups where I edit a spreadsheet or INI file. In these cases I rationalized the methods are acceptable because speed is not a major concern with these interfaces and I will typically have a reference number for these controls available from the event structure. Here is a setup file where I use a standard table control to edit tag names and report status for channels. In this case I wrote to a local variable in the master loop where I would normally have used a property node with reference wired to it. Question: Is there a great advantage of using the local variable here over the property reference method? I respect the opinions that many of the users share in this forum. I expect to hear some criticism and see better way's of accomplishing this. Also if there is anything in the vi that you may be able to use feel free to take advantage of it. For this example these basic rules are utilized. Col 2-4 can accept only YES or NO Col 0 cannot be changed. Col 1 name can be changed but must be unique within that col. I have used a standard spreadsheet file format. The first row is used as column headers for the table. Your comments are desired. Thanks, Randall Download File:post-274-1127250963.zip Quote Link to comment
Khalid Posted September 21, 2005 Report Share Posted September 21, 2005 Thank you for sharing the VI. Here's some good info' on Property Nodes versus Local Variables: http://zone.ni.com/public.nsf/websearch/74...47?OpenDocument Regards, -Khalid Quote Link to comment
Randall Thurman Posted September 21, 2005 Author Report Share Posted September 21, 2005 Thank you for sharing the VI. Here's some good info' on Property Nodes versus Local Variables: http://zone.ni.com/public.nsf/websearch/74...47?OpenDocument Regards, -Khalid Thanks for the information. I often wonder why we are given programming tools then warned not to use them. If I understand this article correctly, we can expect better performance with the terminals, then locals as opposed to property nodes by reference. Yet in some cases where performance is not as critical I see the property nodes as the most practical way of accomplishing a task. Thanks, Randall Quote Link to comment
Neville D Posted September 22, 2005 Report Share Posted September 22, 2005 Thanks for the information. I often wonder why we are given programming tools then warned not to use them. Thanks, Randall I think it helps to know the limitations of the tools you have at hand. The idea of the references etc. is to clean up your top-level diagram, and bury property manipulations in a sub-VI.. a VERY useful function, but it has its cost. Neville. Quote Link to comment
progor Posted September 22, 2005 Report Share Posted September 22, 2005 I think it helps to know the limitations of the tools you have at hand. The idea of the references etc. is to clean up your top-level diagram, and bury property manipulations in a sub-VI.. a VERY useful function, but it has its cost.Neville. I'm going to use references in my next project... could you be more clear about the "cost"? I know that if you change anything during building your aplication you have to change it in every VI (the same situation with clusters). What about time? Are they (references, clusters) causing the program works much slower? Quote Link to comment
Anu Kalidas Posted September 22, 2005 Report Share Posted September 22, 2005 If you use property nodes either directly or through reference in a vi , the front panel will also be loaded while your application runs. This means it will require some extra memory... Quote Link to comment
Mark Balla Posted September 23, 2005 Report Share Posted September 23, 2005 Great post and great question. I started Refactoring your program to see if I could come to a decent answer. When I was finished I had eliminated the value properties by sending the data through the Queue. The final program was a little more flexible and easier to change the User interface. Download File:post-584-1127453851.llb Quote Link to comment
Randall Thurman Posted September 23, 2005 Author Report Share Posted September 23, 2005 Great post and great question.I started Refactoring your program to see if I could come to a decent answer. When I was finished I had eliminated the value properties by sending the data through the Queue. The final program was a little more flexible and easier to change the User interface. Download File:post-584-1127453851.llb Thanks! :thumbup: I really liked the idea of moving the table modifications to the lower loop. You nailed me on the error trapping. I often build quick examples without the error trapping. Later I end up modifying the example for use in an application. I loose as much time editing these programs as would be lost error trapping the examples. Thanks for the prompting here. At NI week once, I thought it was taught that without the shift registers the program would need to generate a new copy of the data with each iteration. Also in some earlier versions I had some applications that appeared to loose the value inside a loop after executing several times. These may be figments of my imagination. I checked the buffer allocation and it doesn Quote Link to comment
Mark Balla Posted September 23, 2005 Report Share Posted September 23, 2005 Thanks! :thumbup: I really liked the idea of moving the table modifications to the lower loop. You nailed me on the error trapping. I often build quick examples without the error trapping. Later I end up modifying the example for use in an application. I loose as much time editing these programs as would be lost error trapping the examples. Thanks for the prompting here. The file IO was the only one that concerned me. When I see file IO I think errors. At NI week once, I thought it was taught that without the shift registers the program would need to generate a new copy of the data with each iteration. Also in some earlier versions I had some applications that appeared to loose the value inside a loop after executing several times. These may be figments of my imagination. I checked the buffer allocation and it doesn Quote Link to comment
Randall Thurman Posted September 23, 2005 Author Report Share Posted September 23, 2005 So if it does timeout I can at least check if the loop should be stopped.Can you post the revised working code so I can see what I missed My Pleasure, I look forward to sharing Ideas and code with you in the future. Thanks again. RandallDownload File:post-274-1127511704.llb Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.