BienEntendu Posted October 13, 2004 Report Share Posted October 13, 2004 i need to send a valuesignaling event to a control which is in a tab in another VI. but cannot figure out how to catch the reference of this control as the list of controls just send me the reference of the tab control. does somebody know how to get it ? Quote Link to comment
didierj Posted October 14, 2004 Report Share Posted October 14, 2004 If you get the reference from vi-server then use it this way (don't forget to close the references of the elements not needed anymore, or you loose memory) The order of the control references in "Pnl" and "Page" is the creation order of the controls, independent of the order designated by the user (via rmb: "reorder controls on page"). Didier Quote Link to comment
BienEntendu Posted October 14, 2004 Author Report Share Posted October 14, 2004 great - thank you a lot it works perfectly. but i don't know why it has to be so complicate. why don't they just use a reference id to communicate with a control, like hypercard did : send (this message) to (control id x) ??? i think this aspect could really be improved but it works ! Quote Link to comment
BChandler Posted September 3, 2005 Report Share Posted September 3, 2005 great - thank you a lotit works perfectly. but i don't know why it has to be so complicate. why don't they just use a reference id to communicate with a control, like hypercard did : send (this message) to (control id x) ??? i think this aspect could really be improved but it works ! 2315[/snapback] The above method is for dymanic references. If you only need a reference to a few, static items just right click on the item and create a reference. This reference can be saved in a global varaible and acesses by any vi. Much simpler but requires manual creation of each reference Use the general menthod if you want to create references to all the items. And look at the Lable text to tell which is which. I use both methods. Quote Link to comment
Michael Aivaliotis Posted September 4, 2005 Report Share Posted September 4, 2005 If you only need a reference to a few, static items just right click on the item and create a reference. This reference can be saved in a global varaible and acesses by any vi. 5980[/snapback] Oh no. Please don't use global variables of ctrl references. If you absolutely must store the reference somewhere, use a functional global (while loop with shift register). Also, I'm NOT a proponent of writing directly to front panel controls from one VI to another because it makes code unnecessarily obfuscated. When debugging problems, it's hard to know what is coming from where. Quote Link to comment
BChandler Posted September 6, 2005 Report Share Posted September 6, 2005 Oh no. Please don't use global variables of ctrl references. If you absolutely must store the reference somewhere, use a functional global (while loop with shift register). Also, I'm NOT a proponent of writing directly to front panel controls from one VI to another because it makes code unnecessarily obfuscated. When debugging problems, it's hard to know what is coming from where. 5984[/snapback] I understand where you're coming from. It's not a technique for beginners. But it has some powerful applications too. There is more discipline to it that I've mentioned. I make several Tag and Reference cluster arrays at init time and store these in a global. Then one, reentrant, program provides subsets of these references to other programs, in a library of core functions, based on Tag types. These then perform common functions for these tags without any additional code in the application. (yes invisibly, therefore somewhat obfuscated, but the presence of the Tag text gives something to track when debuging since each reentrant call holds the list of tags used at each location) This allows common tasks to be carried out seamlessly, elsewhere. Like Data logging, Alarm limits checking and Scaling before and after I/O. Leaving the customer-specific main diagram virtually empty, except for the code unique to that customer. This makes a core library that can be quickly copied from one job to the next. Growing more intelligent as it goes. The key is to devise logical naming conventions for the tags, so they communicate their function just by the name. And syntax checking code can be added were needed to be sure all the needed tags are present, tag sets match, and find orphan tags, not handled anywhere. The Menu functions are also processed in the core. And the screen backgrounds are a collection of png files, created from a power-point file, made by the design engineer. As is the I/O list, from Excel. It's been a very successful concept. I call it programming by reference, and use it in Altamira's BenchCAT 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.