11-14-2011 11:56 AM
In this vi if 2 consecutive numbers are equal the boolean remains true while it should turn off then on.
If there a way without using local variables to do that?
Solved! Go to Solution.
11-14-2011 12:10 PM
You use shift registers to avoid using local variables.
Since you are dealing with integers, all of your wires should be blue rather than orange. You can run into problems trying to compare whether floating point numbers (orange) are equal to each other.
You can also use the Quotion remainder function instead of division and rounding down. That will guarantee you have an integer and is also fewer operations.
11-14-2011 01:31 PM - edited 11-14-2011 01:33 PM
After writing each boolean, you need to clear it before going to the next iteration. This is most easily done with an inner FOR loop containing two iterations.
Here's a quick draft. See if it works for you.
(I also simplified the rest of your code, wich was exceedingly convoluted. I am sure it could be simplified further. Note that I used a transparent cluster for the LEDs, eliminating all these comparisons)
11-14-2011 04:08 PM
altenbach! very nice idea !Ill do my own vi and posted later.
11-15-2011 01:38 PM
I have tried do it but I am getting an error :connected a cluster of 9 contents and a cluster Cluster of 10 elements.
11-15-2011 02:33 PM
@A.A.A. wrote:
I have tried do it but I am getting an error :connected a cluster of 9 contents and a cluster Cluster of 10 elements.
Did you try a search? This question has been asked before many times. Did you try the LabVIEW Help? Be honest here. The LabVIEW Help would have told you that the Array to Cluster function defaults to 9. You have to right-click on it and set to the number of elements you want.
11-15-2011 02:44 PM
I have tried to put a dent in this problem.
11-15-2011 02:56 PM
I used the help but not on the Array to cluster function but on the Cluster 😕
I'm fixing the vi now.
thanks
11-15-2011 03:08 PM
The first element of the constant array missed a zero.
This is the final VI.
11-15-2011 03:10 PM - edited 11-15-2011 03:12 PM
In addition to Saverio's advice, here are a few more comments: