LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

A switch to capture a numeric

Hey guys,

This question could be kind of stupid. Assume there is a random number generating 0 to 1 every second and outputing to indicator#1. I would like to have a switch, when I turn on it, it can record the number and the only number generated at that time, and output to indicator#2. The random number keeps running though. I hope both of them to be drawn on a plot and of course the number of indicator#2 is constant.


My proposal work is like this: Assume there is a array which shows up one by one from 7.0, 7.1, 7,2, 7,3.....9.9 to 10 every second. When the number is at 7.5, I will capture this number. Then I can compare the running number and the captured number, and do some actions. Can anyone give me an example? I have been trying hard to think of any ways doing this. Thank you so much.


Regards,
Scottit
0 Kudos
Message 1 of 3
(2,619 Views)
Scottie,

I think the key is to use a shift register in while loop as well as a case structure. Everything will be inside a while loop (with the appropriate delay to slow it down). Your random number generator will be wired to ind#1 and to the case structure. When the case is false the wire goes through to ind#2; when it's false, the shift register on the while loop goes through the case. Be sure the mechanical action on the button wired to the case is in latch when pressed mode. I'll try to attach the example. good luck.

Stuart
0 Kudos
Message 2 of 3
(2,605 Views)
Stuart,

Thanks a lot. I think the key problem is that I don't quite understand the difference among those mechanical actions. You really saved me a whole night to do this.

PS: If possible, please take a look on my next question.


Regards,
Scottie
0 Kudos
Message 3 of 3
(2,597 Views)