From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
06-07-2012 09:29 AM
Hi,
Attached is a simplified version of my program, but here is the problem. I have labview update a string, so in the program string1 gets copied to string2. When string 2 gets changed, I want the event structure to turn a light on for 1 second.
This only works when I manually update string2, not when labview copies a value to string2. For example, change string1 and having labview update string2 does not trigger the string2 changed event, but if I manually type directly into string2, the light works as it should.
Any ideas on how to change the event or properties so that the event structure picks up the value change when labview updates the string2 and not just I type directly into string2?
Thanks.
Solved! Go to Solution.
06-07-2012 09:40 AM
Use a property node with value signaling.
A better approach would be to use user events. It is more flexible and easier to have lower level subVIs signal the UI of a change.
06-07-2012 09:51 AM
The string1 to string2 gets updated as before, with use of property node this time.
But, my data changed light stays on at all times. I think this is becuase the while loop keeps updating string1, which updates string2 even thought the value isnt changing?
What did I miss?
Thanks.
06-07-2012 09:54 AM
I cannot look at your VI. but make sure when you update the string that you use the Value signaling property node and not just a local variable or something like that. The value signaling property node will cause the event structure to fire an event.
06-07-2012 10:03 AM
Sorry, I attached a picture of my code. I think my new problem of the LED getting stuck on is due to the signaling property becuase every time the program executes the while loop, the value gets "changed/updated". I only want the event structure to go through once when the string truely changes, not keep running through.
Thanks.
06-07-2012 10:13 AM - edited 06-07-2012 10:13 AM
hi gemini,
when you fire an event in each iteration of your loop you will always have the LED switched on...
- Create a "string" valuechange-event that fire the string2...
- You don't need a Wait function when you use the timeout of the event structure...
- You should create a STOP button event too...
06-07-2012 10:17 AM
What do you have in your timeout case for the event structure? This loop will run every second and write something to the value signaling property which causes the event to fire. and then repeat this until you stop the loop.
06-07-2012 11:33 AM
Thanks GerdW that helped a lot.
I see I need to keep the value with signal property node going throughout my program. I'll have to clean my code up elsewhere, because for string1 instead of a user inputting text, its being filled by a RS232 port every second. So I'll have to change when my RS232 reads. Actually I'll have to make my RS232 read once only. Hopefully that'll work. Thanks again.