Script Console - Value from Client

Hi all,

Very new to Ignition and scripting,…and everything else…:).

I have a dropdown and a label on a Vision window. The label is bound to the dropdown selectedStringValue.

Int he client, when I make a selection from the dropdown, the label changes to match the selection…no poblem.

HOWEVER, in designer, neither the dropdown nor the label changes to match the client. So I am questioning what the value actually is? I put a script in the Script Console to print the value and it only prints the value that is in the designer.

So now I need to understand how any “action” i take with the selected value will actually get the correct value?

What am I missing with this relationship?

Thanks, Steven

Multiple designers or clients can each have a running instance(copy) of the window. With the binding you have described changes on one instance will not effect the value of components on another instance.

To elaborate a bit on @lrose’s answer: Component properties are purely local to the client or designer (or Perspective session/page/view). To share values among multiple users, you must bind to a shareable location. In Ignition, that would be a gateway tag. A memory tag if purely internal, or an OPC tag if connected to a PLC (or whatever). You will often want a bidirectional binding.

1 Like

@lrose that makes since and appears to be what I am seeing.

@pturmel So that brings me to another question. I can bind my label to a memory tag, make it bidirectional and it works fine. However, doing so breaks the binding to the dropdown.

I guess my question is actually 2 questions…

  1. can you bind a component value to a tag without using bidirectional…i.e. component value changes, tag changes?

  2. Can you create more than one biding to a component value? i.e. component value changes, binding 1 changes and binding 2 changes?

I did create a memory tag and bound it to the dropdown and I can see it change as I change the selection in a client.

Thanks so much for the explanations.

Steven

Yes. Non-Bidirectional bindings are read only. So if you need the user to be able to write a value back to a tag, then the binding needs to be bidirectional.

If by this you mean could you have two labels driven off of a single dropdown, then yes that is possible.

@lrose thanks! Looks like I am going to have to learn scripting a lot better!:slight_smile:

Thanks for the help,

Steven

In this case, you’d want to bind both to the tag. The label binding would be unidirectional, presumably. Note that bindings are attached to a target property of a component. Each component property can only have one binding. But the other end, the sources (tags, other properties, queries, etc), can be used many times all over the place.

@pturmel thanks for the explanation.

Steven