Jump to content

default values changing by event cases


Farid2010

Recommended Posts

I am not proffessional in labview but trying to make an educational program. I have leaarned a lot so far from you guys in this forum.

My new problem is that i have a Tab control which has differnet data in different numeric indicators. I have also 2 buttons. I want to set them as whenever i push any of these buttons, the default values in tab control changes. Could help me in that regard?

Link to comment

I am not proffessional in labview but trying to make an educational program. I have leaarned a lot so far from you guys in this forum.

My new problem is that i have a Tab control which has differnet data in different numeric indicators. I have also 2 buttons. I want to set them as whenever i push any of these buttons, the default values in tab control changes. Could help me in that regard?

Hi,

You can't use a property node to write the default value of a control if the VI in which that control is is running, you will always get the error 1073 coming from the property node (the description is : "This property is writable only when the VI is in edit mode, or this method is available only when the VI is in edit mode.").

That means that a VI can set the default value on controls of another VI only if the target VI in not running and in edit mode (not in exe).

To do what you are describing you should probably concider using a config file.

Hope this helps

Link to comment

If setting the default value is really the only way to do what you want to do, then Antoine is right, the best way is probably to write/read it from a configuration file.

But if you're not really sure, why don't you post your code that you've got already, and a description of what you want to happen when. Someone here might be able to find some other way to help you make it work.

Link to comment

If you just want to set those to a specific value when you press the button use an event case that fires from the button and then use locals or property>>> value nodes to set the value.

Exactly, which is why I sugested the poster send some code and description of what they wanted to happen, in case the solution is as simple as what you suggest.

Link to comment

[...]

(I tried to add this as a VI snipped and LabVIEW changed the local variable to a PN with a static reference wired to it! - Weird)

[...]

I don't believe that the Code Capture Tool has those problems. 

Edited by jcarmody
Link to comment

CCT's "auto-save in the temp directory and copy the path to the clipboard" feature is probably the best feature I've ever encountered that I didn't know I wanted.)

How about:

"auto-save in the temp directory, upload to a webservice and post the URL of the image to the clipboard" function?

Ton

Link to comment

Anyone know if this is fixed in 2010?

It's not, at least not in the RC, which is the latest version I currently have accessible, but it's safe to assume if it's not in the RC, it's not in the release either.

CCT >> snippets

Can't argue with that. I think the CCT is better even if you don't use its snippet feature.

CCT's "auto-save in the temp directory and copy the path to the clipboard" feature is probably the best feature I've ever encountered that I didn't know I wanted

I would love to take credit for that, because I agree it's the best feature of the CCT, but I'm pretty sure this existed even in CC's prehistoric version, which required you to drop one VI inside another, kill a goat and sprinkle some fairy dust in order to work. In fact, I believe this feature was the whole point of the initial version.

Link to comment

"auto-save in the temp directory, upload to a webservice and post the URL of the image to the clipboard" function?

That might be good. I never post images to websites that only accept links because it is such a hassle. I'm glad Lava allows direct uploads.

CCT is better even if you don't use its snippet feature.

CCT does snippets? I'll have to look for that.

which required you to drop one VI inside another, kill a goat and sprinkle some fairy dust in order to work.

Phew, I'm glad I never had to deal with that. It sounds manageable, except for the "drop one VI inside another" step. ;)

Link to comment

CCT does snippets? I'll have to look for that.

Sure does, although I definitely can't take credit for that, as I wasn't particularly interested in the feature. The CCT page has some videos demonstrating its use.

You can import the snippets in any version from 7.1 or 8.2 and up using a tools menu option or an RCF plugin (respectively), but I'll let Jim point out the location, as he's a lot better at it than I am. 2009 and later let you use the native snippet import.

Phew, I'm glad I never had to deal with that. It sounds manageable, except for the "drop one VI inside another" step. ;)

OK, to be fair to the original version, I looked and it didn't actually require most of the fairy dust. That came later as more options were added. You can see the process here.

Link to comment
  • 2 weeks later...

Thank you guys for your comments and sorry for the delay. As some of you suggested to post the code of my question i attached the file. Actually i have 2 problems:

1- I want to use one tab control for numbers 4 and 5 in the listbox so when the user click any of 4 or 5 , the default values of the tab control change.

2- I couldn't make the items in listbox active so when the user click in any of them ( surview,Body,MPR,...) the related tab control shows up and the button next to that item lights up( become yellow). In my example, it only could be done by clicking on the buttons next to the items not by clicking on the written items.

Thanks

listbox.vi

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
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
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.