07-16-2014 02:20 PM
Vij@y wrote:
From the suggested solution, I have a new problems.
- There is a timeout event at the start up and it will keep on execute in a while loop. If I connect an array in shift register and It will produce a zero value at the finder event.
- Once I read the order of sequence in the Finder event, It should reset the all the sequence values inorder to store for next different sets of sequence.
Why are you using the timeout event? Why can't you pass the values out to the color box in each event case?
I don't see where you are saving the sequence. You are just saving the last value. You need to store the events in a shift register.
07-16-2014 09:18 PM
Hi crossrulz,
Initially I want color box to indicate green color. So I created the timeout event and I placed a case structure for different color to manage. Now I realised, that timeout event is useless here. So now I placed the case structure at later of event structure.
Shift register in the VI you saw to determine which event gets executing. Depends on the numeric value from the event, case structure will decide the color to display. In the VI, no where I tried to saving the sequence. The finder event will decide the output depends on the order of previously executed events. Still i am thinking how to append previously executed events. People suggested me to go with Build array funtion. But I dont quite get it since it has only one input, How can I keep on storing the event executed.
Consider the modified VI.
07-16-2014 09:36 PM
I'm really surprised you haven't already seen how to build an array somewhere on the forums before.
See attached. I cleaned up a bunch of unnecessary code.
07-17-2014 06:57 AM
That case structure really isn't needed. As I said before, make the event structure pass out the color that you want it to be. Put it into a shift register and then you can keep it from changing. And since you want it to be green before you even start, initialize that shift register to be the green color.
Also, there is a Color Box Constant in the Dialog & User Interface palette that makes life a lot easier when looking at colors.
And also as we have been saying, you need to build the array, not just replace it.
07-17-2014 10:29 AM
Hi Ravensfan and Crossrulz,
Both of your VI's were the exact solution I need. Its was so simplified and I learned a lot from it. But I have another problem now.
To whom I should give "Accept as solution" . Because both of you gave exact solutions back to back.
07-17-2014 10:41 AM
Vij@y wrote:
To whom I should give "Accept as solution"
. Because both of you gave exact solutions back to back.
Definately give Kudos to all posts that were useful.
As far as the solution, mine was a little more complete, so mark mine.
07-17-2014 10:51 AM - edited 07-17-2014 10:52 AM
@crossrulz wrote:
Vij@y wrote:
To whom I should give "Accept as solution"
. Because both of you gave exact solutions back to back.
Definately give Kudos to all posts that were useful.
As far as the solution, mine was a little more complete, so mark mine.
I could beg to differ on that one. But I won't. Crossrulz needs all the help he can get to get his post count and ranking up. After all, he is merely a proven zealot.