05-17-2009 02:41 AM
Hi,
Here i have written VI that will make an array of meaningfull data, for example: data pattern 23 16 16 24
So whenever two consecutive 16 occurs, VI will delete one 16 from data pattern. But in my case wht problem i am facing is:
Whenever it deletes 16 from data pattern, it will show 0 in place of 16 but i need that cell fully disabled unless this 0 will count into mu data pattern.
So i am trying to use disable property node for greying that particular cell or can any tell me why 0 is coming into array when it deletes 16 from it.
Puneet
Solved! Go to Solution.
05-17-2009 02:52 AM
Hi Puneet,
I can't load your vi as I only have LV7.1 available at the moment.
But:
From your description it seems you don't "delete" the element but you replace it with zero... Please make sure you really use "delete from array" here.
You can't disable a single element of an array - all elements share the same properties. The only difference between elements of an array is their value.
05-17-2009 03:23 AM
Hi,
Thanks for your reply.
Please find attached screenshot.
Puneet
05-17-2009 03:59 AM - edited 05-17-2009 04:05 AM
Hi Puneet,
from what I see in your screenshot the described behaviour is resulting from an unhealthy combination of using (hell a lot of) locals in combination with "use default if unwired" case structure output tunnels
Remove locals (you already have a shift register, so use a wire instead!), use more descriptive names than "array", wire all output tunnels to avoid unwanted behaviour of your vi...
Why do you compare with an array (in your for loop) when you only need the result for the first element? Compare with scalar instead...
Why is "DLE Check" of type DBL? You only seem to use it as integer...
Why do you write to terminal "Array" and a local "Array" after the FOR loop? (Here is probably the root of the problem!) Only one of the write operations will be effective and you don't know which one...(possible explanation: the local array gets an array formed by autoindexing. So this array contains data for each iteration including an zero [because use of "default if unwired"] when you initially wanted to delete that very element!)
Aditional note:
Next time you attach a screenshot please use a picture format like PNG (as long as you don't use BMP)!
05-17-2009 04:17 AM
You really should start out with a few simple tutorial to familiarize yourself with basic array operations and FOR loops.
Your code makes no sense!
Do you want to reduce consecutive "16" to a single 16, or do you want to eliminate all consecutive duplicates?
Here's a quick draft that would delete consecutive 16s, keeping only one per group. Maybe it can give you some ideas. (LabVIEW 8.2.1)