10-27-2008 05:18 AM
I would like to create a VI that would take a strings of A's and B's such as "AABBBAAA"
and would create two list (or arrays) of tracking when A occours and the other tracking when B occurs.
For this example, A should be {0,1,5,6,7} and B should be {2,3,4}.
I have created a vi so far that is not working as I wanted. Instead of having a 5 element array for Index A and 3 element array for Index B. I got an & element array for both. However, whenever there is no A in Index A the value is placed as zero so it would be {0,1,0,0,0,5,6,7} and Index B end up to be {0,0,2,3,4,0,0,0}. Can anyone help me out?
Solved! Go to Solution.
10-27-2008 05:30 AM
Did you need this?
graziano
10-27-2008 05:35 AM
have a look, if it is the function, you will have..
10-27-2008 06:16 PM
hi jhoormann,
I only have labview 8.2 so I couldn't run the vi that you send me. Is it possible you to send a picture of the vi or just tell me the name of the function that you have used in your vi? Thanks
10-27-2008 06:26 PM
Hi graziano,
I have a couple question regarding the vi. I hope you can explain to me if you have the time. What does the down arrow and up arrow mean on the side of the for loop frame? Also why is there an empty numeric array needed? Is it so that they would place it in the array intead of resorting to placing the default 0 like in my ealier vi?
10-28-2008 12:24 AM
10-28-2008 02:31 AM
ttk12acd wrote:
What does the down arrow and up arrow mean on the side of the for loop frame? Also why is there an empty numeric array needed? Is it so that they would place it in the array intead of resorting to placing the default 0 like in my ealier vi?
Hi!
I didn't look at you VI, sorry... mainly because in my working PC I have LV 7.1.
Let me be direct: those arrows are "Shift registers", and are a basic LabView concept. If you aren't familiar with this, maybe you should take little time to read at least LabView User Manual. They are used extensively in LV programs, and for some scopes are a really good programming technique (consider ActionEngines or simple dataflow in loops).
The empty array is not strictly needed, I put it only to readability of code.
When I'll be able to do it, I'll open your VI and comment a little on it. Thanks for your feedback, have a nice day!
graziano
10-28-2008 02:57 AM - edited 10-28-2008 02:58 AM
Hi!
I think you need to understand indexing of arrays in loops: look at those small sqares with bracket, they means that you're indexing output lines of for loop. At each loop iteration, you add an element to the output wires, to form an array which contains the same numbers of elements as the number of loop cycles. Check also for this on the manual, since it is an important feature.
have a nice day!
graziano
10-28-2008 03:00 AM
....I forgave: Why "Index A" and "Index B" indicators are set as DBL (double precision)? They should be something like U32, or U16, do you agree?
graziano