Jump to content

XControl - How to default to indicator?


Doon

Recommended Posts

Hi everybody!

I have an XControl that only has indicator functionality. However, when I place it on the front panel of a VI, it defaults to control.

So far, the only thing I have tried is to set the default state (RMB>>Data Operations>>Make Current Values Default) of the Container State cluster in the "Init" VI. This did not work.

Any thoughts, suggestings, solutions, or flames are welcome. :worship:

-H

Link to comment
Hi everybody!

I have an XControl that only has indicator functionality. However, when I place it on the front panel of a VI, it defaults to control.

So far, the only thing I have tried is to set the default state (RMB>>Data Operations>>Make Current Values Default) of the Container State cluster in the "Init" VI. This did not work.

Any thoughts, suggestings, solutions, or flames are welcome. :worship:

-H

I have been thinking about this as well,

what you could do if the format of the control is a 'control' display a message in the xcontrol that it is intended to be used as an indicator. It would be wonderfull if we could limit the state of the xcontrol into control or indicator

Ton

Link to comment
I have an XControl that only has indicator functionality. However, when I place it on the front panel of a VI, it defaults to control.

The container state terminal of Init ability VI in the xcontrol contains a container ref which allows modifying the initial XControl container. Setting a value of property node "Ctl.Indicator" to true makes an xcontrol dropped on front panel to default to indicator. However be careful as init is called also when there is a need to update the XControl to a newer version or when the xcontrol is copied.

Tomi

post-4014-1170357546.png?width=400

Link to comment

Thank you for your responses

what you could do if the format of the control is a 'control' display a message in the xcontrol that it is intended to be used as an indicator.

That's a wonderful idea; I shall be implementing this as a standard for my one-sided xcontrols.

Setting a value of property node "Ctl.Indicator" to true makes an xcontrol dropped on front panel to default to indicator.

Strangely enough, this causes LabVIEW to become unstable (Windows throws an exception and kills the LabVIEW). Perhaps it's a problem with 8.0.1. I was able to reproduce the effect in different XControl initialization senarios (dropping from palette, copying, etc.).

I am interested to see if anyone else gets the Windows panic. FYI, the xcontrol is a simple numerical indicator that changes color depending on value. In its current configuration, Windows throws an exception when I copy the xcontrol.

have a nice day, :)

--H

Download File:post-3343-1170373251.zip

Link to comment
Here's the link to an XControl I wrote that defaults to indicator, among other interesting properties.

http://community.ni.com/examples/scrolling-led-xcontrol

AQ,

Thanks for the example. This just happened to come in useful, as I was working on a custom graph XControl. I simplified your mechanism so that mine is always an Indicator. (This is due to my incredible powers of foresight, allowing me to see all potential use cases and be sure that no one will ever need to use my graph as a control.) (OK, so it's really just due to laziness.) In any case, I thought I'd mention a couple of minor point.

I'm just a beginner with XControls, so it may not be surprising that it took me a while to figure out what you had done. One thing that threw me, though, was that you mentioned that your Indicator trick was in the Init.vi. I took this to mean in the XCTL Init VI, e.g. LED-Init.vi. But it was actually in a subvi used in the Direction Change case of the Facade, which runs when the XCTL is initialized (dropped). So perhaps this was all for the best, as it forced me to work for the answer. But you might consider updating the description a bit.

The other thing is the observation (perhaps obvious?) that the Direction Change case of the Facade fires when the XCTL is dropped, even if there is no inherent Direction Change. Perhaps this case might better have been named something like "Set Direction".

Anyway, thanks for the example. Nicely done!

Regards,

Dave

Link to comment
  • 6 months later...

A version of 0.0.0.0 indicates that the XControl was just dropped. In other cases (load, copy) where the Init.vi is called it will be the last saved version (load) or the current version (copy). A version of 0.0.0.0 also indicates that there was no previous state saved with the xcontrol, so you have to provide a default state for the newly dropped control.

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.