Jump to content

Use an indicator as a control


Recommended Posts

QUOTE(mcguirpa @ Mar 10 2008, 11:11 PM)

Hi all.

I have a slider on my VI with an indicator next to it, which displays the position of the slider. How do I make it so I can overwrite the value displayed in the indicator and have the slider move to the new value?

You can do it using either a local variable or a property node.

Link to comment

QUOTE(mcguirpa @ Mar 10 2008, 04:11 PM)

Hi all.

I have a slider on my VI with an indicator next to it, which displays the position of the slider. How do I make it so I can overwrite the value displayed in the indicator and have the slider move to the new value?

Controls are data sources and indicators are data sinks. YOU DO NOT WANT TO MIX THEM UP.

If you right click on the control, select Visible Items, and check Digital Display, you will see there is now an digital control that is synched to the slider.

If that isn't what you want then you should investigate making you own custom controls.

Mike

Link to comment

QUOTE(mross @ Mar 10 2008, 09:42 PM)

Controls are data sources and indicators are data sinks. YOU DO NOT WANT TO MIX THEM UP.

If you right click on the control, select Visible Items, and check Digital Display, you will see there is now an digital control that is synched to the slider.

If that isn't what you want then you should investigate making you own custom controls.

Mike

That's exactly what I was looking for. Cheers.

Link to comment

QUOTE(mross @ Mar 10 2008, 11:42 PM)

Controls are data sources and indicators are data sinks. YOU DO NOT WANT TO MIX THEM UP.

If you right click on the control, select Visible Items, and check Digital Display, you will see there is now an digital control that is synched to the slider.

If that isn't what you want then you should investigate making you own custom controls.

Mike

Yes, I really agree to your words. Don`t mix controls and indicators! There are very very rare cases, where you realy should mix them. I do it if I use a table, but attention:

if you update your element from two sources (user entering and software update). You have to know what is the priority of each source.

Link to comment

QUOTE(Eugen Graf @ Mar 10 2008, 05:09 PM)

Yes, I really agree to your words. Don`t mix controls and indicators! There are very very rare cases, where you realy should mix them. I do it if I use a table, but attention:

if you update your element from two sources (user entering and software update). You have to know what is the priority of each source.

OK Eugen, I'll bite.

For what reason is a table control (getting data from a local variable or a property node) better to use as an indicator than a table indicator. The difference isn't obvious to me.

Mike

Link to comment

If you use a table control you can manually edit some values directly in the table. Like in MS Excel. Of course you can double click on the table (or klick on the edit button) and pop up a new window and enter new values from there.

So I use sometimes a table control as an indicator(using a local variable) to import a spreadsheet file and then to edit and save them to a file.

Or import a file, than select some columns and show them in a plot ...

Eugen

Link to comment

QUOTE (Eugen Graf @ Mar 11 2008, 04:21 AM)

If you use a table control you can manually edit some values directly in the table. Like in MS Excel. Of course you can double click on the table (or klick on the edit button) and pop up a new window and enter new values from there.

So I use sometimes a table control as an indicator(using a local variable) to import a spreadsheet file and then to edit and save them to a file.

Or import a file, than select some columns and show them in a plot ...

Eugen

Eugen,

I can also edit directly the values in a table indicator. Add it can be changed at will between indicator and control function. Actually it looks like all the same options are available for table controls and table indicators. I can't tell the difference other than the data sink, data source function which pertains to how it can be wired up in the context of a VI and its runtime function. It seems like you are not talking about a run time use.

I can't detect any particular advantage to a control other than that it is a data source (for saving). And no particular advantage to a table indicator other than to receive data without having to resort to a local variable or property node write the values

You said, "Of course you can double click on the table (or klick on the edit button) and pop up a new window and enter new values from there."

I am using 8.5 - I don't seem to get this action you describe. When I double click I just move between the front panel and block diagram. And I couldn't find an edit button at all. I obviously am missing something that you are trying to explain.

Mike

Link to comment

QUOTE (mross @ Mar 10 2008, 04:42 PM)

Controls are data sources and indicators are data sinks. YOU DO NOT WANT TO MIX THEM UP.

I might be about to hijack this thread, but I'm curious about opinions on this. At a previous job, I built a large application that needed some controls to act as indicators under certain circumstances. For example, there is an indicator for temperature, a control for temperature setpoint, a control for air flow rate, and a boolean to turn on a PID loop. When the PID loop runs the air flow rate control is disabled and acts as an indicator so that the user can see that the PID loop is functioning. I built a complex system based on references and checking for changes to the air flow value by both the user and by the control loop - each only updated the other when a change occurred. How do the rest of you handle this sort of situation?

Link to comment

QUOTE (ned @ Mar 11 2008, 08:15 AM)

...How do the rest of you handle this sort of situation?

Just my 2 cents,

It depends on how complicated the app is and how lazy i am that day. Data that can be manipulated from different sources have to be protected. If the app is simple (and I am in lazy mode) I can disable the control when in auto-mode. In that case, the "master" version of the data is stored in the FP opbject.

If things are more complicated, then the "master" version of the data will be stored in a critial section (like an Action Engine) and all entities that are concerned with that value invoke methods to make the change. In those cases, all indicators/controls are just copies of what is in the AE.

Ben

Link to comment

QUOTE (mross @ Mar 11 2008, 11:56 AM)

I can also edit directly the values in a table indicator.

...

You said, "Of course you can double click on the table (or klick on the edit button) and pop up a new window and enter new values from there."

...

I am using 8.5 - I don't seem to get this action you describe. When I double click I just move between the front panel and block diagram. And I couldn't find an edit button at all. I obviously am missing something that you are trying to explain.

I think on a running VI or Application, so not in edit mode.

You can use an event structure to catch the (double) click event on the table.

Eugen

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.