07-24-2021 02:08 AM - edited 07-24-2021 02:33 AM
I have attached VI below. I want to change my code such that at "VAL": value change event I can do specific operation. I can not trigger event when "VAL" indicator changes.
I used "value signaling" property but it causes event to occur continuously.
07-24-2021 10:18 AM - edited 07-24-2021 10:43 AM
@doc_d wrote:
I have attached VI below. I want to change my code such that at "VAL": value change event I can do specific operation. I can not trigger event when "VAL" indicator changes.
@doc_d wrote:
I used "value signaling" property but it causes event to occur continuously.
No, don't do that!!!
Please go back and study my code again, then get rid of all these local variables. Learn about dataflow and state machines, there are plenty of example.
07-24-2021 11:57 AM
My operation:
OPEN: Opens file and read elements.(For ease I have taken 2 arrays.)
1. TIMEOUT array: For time delay
2. VALES array: For sending values
AUTO START: starts cycle. (Takes value one by one from the array.)
Example: If "TIMEOUT" array's first element is 10000, first element from "VALUES" array will go in "VAL" variable and will not change until 10seconds.
Cycle will repeat until array is completed to its last value.
STOP AUTO: Stops cycle and "VAL" variable will have last value it won't reset to 0.
SET VAL: To set value of "VAL" variable manually, I will disable and grey it when cycle is running.
After cycle is completed i.e. Last time delay from the array completed, "VAL" will hold its value.
07-24-2021 04:04 PM
07-26-2021 03:29 PM
This vi is working fine but the I have other events going on during the timing, if I add those events and trigger them the timer just restarts. For example if my delay is 5 seconds and if I trigger event at 3 sec then total 8 sec delay is taken.
07-26-2021 04:09 PM
If you want relatively regular timeouts, you can shorten the timeout accordingly whenever another event occurs (example). If certain things really need to occur at regular intervals, place them in an independent parallel loop.
(You are still using value property nodes instead of local variables. No reason for that!)
07-27-2021 01:53 AM
I was trying to implement exact logic😁. That worked!! I have 2 more auto operations like this(Reading values from file: 1. time 2. Value1 3. Value2 4. Value 3 ) will be going on but I'll figure it out.
Thank you.