3

I've written LabView code for a locking system.

The lock has a motion timer that relies on input from a numeric control. I've added a script file reader that needs to be able to change that timer value. Using a selector, I can switch between values, but I'd like it to update the value in the control, rather than override it, so that I can see it on the screen.

How can this be accomplished?

This is currently how I switch between the scripted version and the direct numeric input from the control:

Switch

So how can I get the script value to update the control box or is that not possible...?

SeanJ
  • 1,203
  • 2
  • 19
  • 39
Jedi Engineer
  • 493
  • 3
  • 11
  • 29

1 Answers1

4

Do you mean something like this? I created a little vi to demonstrate how the control is updated.

In most cases "property nodes" are the way to go. Every control has a lot of different options to chose from and usually if you look through the properties you will find what you're looking for :)

enter image description here


A little hint:

If you want to add "code" to your question so that other users can test it, you can create a .png file. To do this, you need to select the parts of the vi that you want to share, and click on "Edit > Create VI Snippet from Selection". Then you save that generated .png and upload it here as a picture. Then others can drag&drop it into their block diagram.

Important: Check the .png before uploading and make sure that you're not accidentally posting sensitive data of your company.

Salome
  • 221
  • 1
  • 7
  • thank you. I've never worked with property nodes. So if I understand this correctly, the property node updates 10 times per invocation of the FOR loop, which is governed by the main while loop. I think I got it. Thanks!! – Jedi Engineer Aug 13 '20 at 11:09
  • Will this code allow me to put a numeric value into the "To Update" control box? in other words, does the property node override manual entry? – Jedi Engineer Aug 13 '20 at 11:16
  • Property nodes are very useful and important in your daily life in LabVIEW ;) If you use the property node in this case, it "deletes" the old value and shows the new one. If you enter some value manually, the new one replaces it. I would recommend that you read up on the individual functions. NI has some interesting pages that explain a lot of them. There are also some NI tutorials that I can highly recommend to get you started. Here is a link to the help-page about property nodes: https://zone.ni.com/reference/en-XX/help/371361R-01/glang/property_node/ – Salome Aug 13 '20 at 11:31
  • If you want to need help to understand what a specific function does, you can use strg+h to open the context help. It shows some basic information. From there you can click on link to open a more detailed help page. – Salome Aug 13 '20 at 11:34