LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

clear 1d array with boolean?

in lv8.0
already searched forums no luck
attached is a picture

on left is front panel with only 1 data in array. that is what i want to be cleared. when a button is clicked...i don't want it to be initialized to 0 or anything (which is what i found when i searched) i need it to be empty clear so it shows a grey box not white

on right is actual code. the array is named run numbers and data comes in from a excel sheet and then it goes and does blah blah blah. i need it so basically when boolean is clicked the entire array is cleared so data inputted won't be appended when not wanted

thanks in advance
0 Kudos
Message 1 of 22
(4,623 Views)
Hai,
 
Just wire a uninitialised string array constant to the run numbers array when the boolean is clicked so that the string array would be initialised to grey box.
 
This should help
 
With best regards
JK
With regards,
JK
(Certified LabVIEW Developer)
Give Kudos for Good Answers, and Mark it a solution if your problem is solved.
Message 2 of 22
(4,614 Views)
does not work. if you look at my picture, i want it to initialize to the DARK grey not the light one. the light one counts as a blank data value, dark grey counts as nothing which is what i need
0 Kudos
Message 3 of 22
(4,606 Views)

FYI, the array you have is of type string and not numeric.

You could clear your array by writing in an array constant with 0 elements.  To create one on your block diagram, insert an 'array constant'.  Into this array constant, insert a 'string constant'.  Do not type anything into the string constant.  This way your array will be of type string, but will not have any elements.  Wire this constant in to your indicator.

You can also remove elements from an array by doing a right-click, and going to 'Data operations>>Delete Element'.

S G
Certified LabVIEW Architect, Certified TestStand Architect, Certified Professional Instructor
0 Kudos
Message 4 of 22
(4,606 Views)
You are using the build array function, so you're appending an empty string to your existing array.  Replace the "build array" with the constant mentioned by JK1 and me in the above posts.

Message Edited by Sudhir Gopinath on 06-25-2007 01:04 PM

S G
Certified LabVIEW Architect, Certified TestStand Architect, Certified Professional Instructor
0 Kudos
Message 5 of 22
(4,600 Views)
the array constant mentioned by both you again, does not delete the element. i need it so when button clicked all elements are deleted, not initialize to blank
0 Kudos
Message 6 of 22
(4,586 Views)

Also, I notice that your array is being built up by running through a for loop.  What exactly is the functionality of the for loop?

If you want to build an array with all the blank states missing, then you should just delete the 'build array' and wire the input to that case structure directly to the output.

S G
Certified LabVIEW Architect, Certified TestStand Architect, Certified Professional Instructor
0 Kudos
Message 7 of 22
(4,588 Views)

Where is the boolean button that you mention?

If possible, post your vi here.

Message Edited by Sudhir Gopinath on 06-25-2007 01:09 PM

Message Edited by Sudhir Gopinath on 06-25-2007 01:10 PM

S G
Certified LabVIEW Architect, Certified TestStand Architect, Certified Professional Instructor
0 Kudos
Message 8 of 22
(4,585 Views)
array is being built by extracting data from excel spreadsheet and putting in 1d array. i am not completely sure how it works and what the multiple loops do as i didn't write the code

//EDIT: button not showed in picture. boolean button i added outside of the 2 loops. should i add it inside all them

Message Edited by unknown00 on 06-25-2007 01:11 PM

0 Kudos
Message 9 of 22
(4,584 Views)
i got it. had to create another loop for the boolean button inside the loops instead of out and used the string constant and seems to work fine atm 🙂
0 Kudos
Message 10 of 22
(4,566 Views)