03-12-2010 11:54 AM - edited 03-12-2010 11:54 AM
Now you are getting into the realm of Event structures. In this example, changing the selection fires an event. In the event case I generate the array which goes from the old selection to the new selection (up or down). That array of integers is fed into the usual 2^N and Number to Boolean Array to give you the effect you are looking for. The LEDs are numbered 0 to N-1, you can change if you like.
03-12-2010 12:06 PM
niteflame123 wrote:Thank for your replied.
I was thinking that the first circuit that you showed, how can i used the reversed array for the 2nd circuit you used? Because i was thinking of when the LED stop at No 4 LED, can it reverse back to LED 2 if I re-indicate the selection?
Pssssttt! They are not "circuits". They are block diagrams. Circuits are the things with printed circuit boards, wires, traces, and have real electrons flowing through them.
03-14-2010 08:33 AM
Darin.K wrote:Now you are getting into the realm of Event structures. In this example, changing the selection fires an event. In the event case I generate the array which goes from the old selection to the new selection (up or down). That array of integers is fed into the usual 2^N and Number to Boolean Array to give you the effect you are looking for. The LEDs are numbered 0 to N-1, you can change if you like.
Message Edited by Darin.K on 03-12-2010 09:54 AM
Hi Darin, how could i add in a graph form to measure the relationship of the time and the different LED travelled?
03-14-2010 07:59 PM
Numerous options, here is a simple way that resets the graph each time you run and logs the timestamp of each value change.
03-17-2010 10:35 AM
Darin.K wrote:Numerous options, here is a simple way that resets the graph each time you run and logs the timestamp of each value change.
Hi Darin,
Thank for your advise. I tried out your method for the graphing. it really work.. thank you so much.
I would like to check how can i connect a Clear function in my block diagram. Could you kindly advise me?
03-17-2010 11:29 AM
03-17-2010 12:25 PM
Darin.K wrote:
In your VI, which is a bit different than I would do it, just add a Clear Button wired to a Select function. For the False case, wire the output of the Build Array you use for the graph. For the True case, Right-click and select 'Create Constant' this will generate an empty constant for you. Wire the output of the Select Function to the Shift Register in place of the Build Array Output.
Hi Darin,
when you said Select function, which function are you refering to?
03-17-2010 12:35 PM
In the comparison palette.
03-17-2010 01:00 PM
Hi Darin,
me again... sorry to bother you. what should I wired to the True case? if I didn't read wrongly your msg, I should wire "Create Constant" to the True Case and wire the output of the Select Function to the Shift Register in place of the Build Array Output.
But there's error when i wired. Please kindly guide me. Thank you
03-17-2010 01:05 PM
The order is important.
1) Put the Select Function on the block diagram
2) Wire the Output of the Index Array to the False terminal of the select function.
3) Right-click on the True terminal and select Create constant. This automatically generates an empty array of the correct type.
4) disconnect the wire from the shift register and replace it with the output of the Select function.
When you press Clear, an empty array is written to the shift register, emptying your graph.
If you would like it to clear when the program starts, you need to initialize the shift register. Again you can right-click on it and select Create Constant.