Sharon_ Posted November 2, 2009 Report Share Posted November 2, 2009 Hi friends, I would like to whether we can group some mathematical elements like something shown in the picture. The local variables and the number of local variables are project dependent. So I want to create these things programatically in VI scripting. first I want to combine elements and place them repeatedly...is it possible or Should I use SubVis to implement this..? Thanks in advance..!!! Sharon Quote Link to comment
FrankB Posted November 2, 2009 Report Share Posted November 2, 2009 Hi friends, I would like to whether we can group some mathematical elements like something shown in the picture. The local variables and the number of local variables are project dependent. So I want to create these things programatically in VI scripting. first I want to combine elements and place them repeatedly...is it possible or Should I use SubVis to implement this..? Thanks in advance..!!! Sharon Hi Sharon, I think this should be possible with scripting, but if I take a closer look at your example problem, I would prefer a different solution. It seems that you need a variable number of timers (including reset and enable functions or so). My preferred first approach would be a functional global VI where you can handle all the settings of each timer within the uninitialized shift registers. You may then use this timer VI at different places on your block diagram for initializing the timers, resetting, en-/disabling, evaluating them. An improved solution could be made with LabVIEW classes. Regards, Frank 1 Quote Link to comment
PaulL Posted November 2, 2009 Report Share Posted November 2, 2009 Sharon, I think (as Frank said) there are more elegant solutions using native LabVIEW coding approaches than resorting to scripting. Consider sending your timer values in an array and performing the calculations on the array. If it gets more complex than that then I'd suggest you consider the Command pattern (an object-oriented solution), but I think for your current problem a solution using an array will be sufficient and much simpler. Paul 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.