10-07-2010 02:25 PM
Hi everyone,
I have managed to use build array to store and save stage coordinate and recall them to control the stage. However, I need to Edit/Delete/Add stage coordinates during runtime.I also need to allow user to directly modify the stage coordinate from the array table. Wondering does anyone know what is the best way to do it? Or is it better to use Matrix or Cluster? Thanks in advance.
Best regards,
Han Yen
Solved! Go to Solution.
10-08-2010 02:26 AM
I need to Edit/Delete/Add stage coordinates during runtime.I also need to allow user to directly modify the stage coordinate from the array table
Populate the array values in the Multi Column List Box . Take the user selection, display the values in three controls and provide the options to manipulate the values (edit/del... etc.,)
Hope this helps. Post back if any queries.
10-08-2010 03:47 PM
Dear JK,
Thanks for the suggestion. It seems that the multicolumn listbox only allows string. Wondering you know if there is an array to string function in labview?
Kind regards,
Han Yen
10-08-2010 11:33 PM
@Han Yen wrote:
Dear JK,
Thanks for the suggestion. It seems that the multicolumn listbox only allows string. Wondering you know if there is an array to string function in labview?
Kind regards,
Han Yen
No. What gave you that idea?
A multicolumn list box will take a 2-D array of strings in the property node "Item Names".
10-09-2010 01:56 AM
OK, simplify first! Use an event structure! Use simple array operations! (A single "Index array" replaces your "array subset" and four "index array nodes)! Connect the terminals, not local variables of them (this is not text based code!)! UI loops need a small wait (or even better, use an event structure). 😉
To display in a listbox, simply format the array. Since a listbox takes strings, you need to verify the input if you allow the user to edit the cells, because it would be easy to enter illegal (e.g. non-numeric) values. Maybe the listbox is not such a good idea.
Here is a quick draft for your code that also displays in a listbox. If you want to allow editing of the 2D array, I would make the 2D array a control and add another event case. Modify as needed.
10-09-2010 10:04 AM
10-12-2010 11:40 AM
Thank you very much altenbach for all the advice. I have tried making 2D array a control. I've been playing around using array as control. However, I still can't figure out how can I detect that I have change the 2D array data with the latest number during run-time? How can I then update my current array with the latest data?
Best regards,
Han Yen
10-12-2010 01:26 PM
@Han Yen wrote:
Thank you very much altenbach for all the advice. I have tried making 2D array a control. I've been playing around using array as control. However, I still can't figure out how can I detect that I have change the 2D array data with the latest number during run-time? How can I then update my current array with the latest data?
Well, the 2D array is updated immediately and you don't have any other arrays.
Do you mean you want to update XAbs, etc in case the just modified row is already selected?
Anyway, here's a simple draft, maybe it will give you some ideas. I would recommend that you use arrays also for XYZPos, etc. inputs and the XYZabs. This simplifies the code because you reduce the number of terminals and array operations.
Let me know if anything is not clear to you.
10-12-2010 02:58 PM
Thank you all very much for all the help and information. Exactly what I needed.
Kind regards,
HanYen