07-18-2009 05:28 PM
All,
I've just started playing around with XControls. My first creation worked perfectly, so I'm a little dejected that #2 is not so simple. Basically, I'm trying to create an X-Control with a number of different boolean buttons (currently, 9, but I plan to add more). I simply want the Xcontrol to keep track of an array of boolean values (in other words, buttons #2 and #7 have been clicked, while all others are false).
I realize that a 1-D array of booleans would be easier, but this current code will eventually be used for a more complicated setup. Eventually, I plan to use the "Display State" information to update the boolean text on each control, so I can dynamically generate a number of "Comment" buttons. I know that not everything is wired right now, but I'm just getting a little confused on the whole process.
See the "Test.vi" file for an extremely-simplified example of what I'm trying to accomplish. Can someone take a look at these example files, and try to point to what I'm missing?
Thanks so much for your help!
Mark
07-18-2009 06:31 PM - edited 07-18-2009 06:33 PM
Your Xcontrol starts out as a boolean array of lenght zero, so replacing an element won't do much. You have several possiblities:
initialize the xcontrol with a boolean array of size=9. (... and add a delay!)
Ensure that the array is always the right size inside the x-control, e.g. with a reshape operation based on the number of buttons.
06-12-2013 05:44 AM
HI guys,
Im extracting data from excel and i want to configure a control to be able to select data from one collum i specify. im able to isolate the collum in an array of strings. how can i bind that data to a control and update that control automaticaly if i change the excel file.
06-13-2013 05:41 PM
Do you have a particular event in mind for triggering the update of the table?
You may also want to consider creating a new forum rather than reopening an old one. It would help make your issue more visible and could get you some more responses.
06-14-2013 04:02 AM
hi,
my program has to be albe to calibrate multiple models of anemometers, so i must have an excel file with the several kinds of equipment and some stardard values associated with every model. i want a control that is able to choose from the model options i have and everytime i update the excel he must recognize new options. when i choose the model i want it shall assume all the values associated to it, but that i can code later my problem is to link a control to do that task.
PS: cant post new topics, got a error when i try to post new.
regards
06-14-2013 06:31 PM
Hi Asnaev,
Overall, this is going to be a very inefficient approach, to be modifying values in an excel file and dynamically polling the file for changes.
It is possible we could do this by continually reading from the file and comparing data to see if it has changed, but this will be very slow and will bog the computer down significantly while the program is running.
Toward this end you have described, Jeff has posted a start at an application that would trigger a user event based on data from an excel spreadsheet:
http://forums.ni.com/t5/LabVIEW/making-an-event-structure-based-on-excel-files/m-p/2440536
Instead, I would use the Report Generation Tookit or the an ActiveX container to call Excel within LabVIEW, so that the data being monitored and changed can be within the LabVIEW application space.
Instead of trying to base the data we need in Excel, editing excel, and then having our program respond to it, why don't we read from excel in the first place, open an editable version of the spreadsheet in our VI (using Office Web Components and putting them in an ActiveX container), and then write changes to the spreadsheet using LabVIEW's spreadsheet functions?