Showing results for 
Search instead for 
Did you mean: 


Hi friends,

I require your help to solve the following problem.

I have a vi that randomly generates 4 zones (0 ... 3) the same ones that change 
every 2 seconds, I want to implement is that every time a zone turn on
the indicator light and need to stay on only 500ms, and each time when it generates a
new zone starts a timer (chronometer) which will stop when the sensor signal is
greater than or equal to 3 or if the value of the timer exceeds 1900ms.
these elapsed times ​​should be stored in an array.
The process must be repeated indefinitely. Thank you for your cooperation. Oswaldo G.
0 Kudos
Message 1 of 2
  • Please don't put regular text into code tags.
  • The array and associated code should be blue because you are dealing with integers.
  • Your edge values have only half the probability of the other values, you need to fix the rounding math.
  • You can compare the random number with an array of [1,2,3,4] to get the Zonas array.
  • To operate at 500ms and 1900ms, you need to run the loop faster (e.g. 100ms / iteration), switching states as needed. (HINT: state machine!)
  • You need to initialize the shift register.
  • Indexing for the "numeric" indicator is pointless. The scalar wire with the same value is right there.
  • You cannot repeat "indefinitely" when building an array, because you don't have infinite memory.
  • What time resolution do you need?
  • Use the therm "EVENTS" only for event structures, avoiding confusion.


0 Kudos
Message 2 of 2