Jump to content

Creating mathematical structures programatically


Sharon_

Recommended Posts

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

post-16569-125715246196_thumb.jpg

Link to comment

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

post-16569-125715246196_thumb.jpg

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

  • Like 1
Link to comment

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

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.