LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Edit/Delete/Add stage coordinates in array during runtime

Solved!
Go to solution

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

0 Kudos
Message 1 of 9
(4,163 Views)

 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.

With regards,
JK
(Certified LabVIEW Developer)
Give Kudos for Good Answers, and Mark it a solution if your problem is solved.
Message 2 of 9
(4,145 Views)

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

0 Kudos
Message 3 of 9
(4,128 Views)

@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".

 

 

0 Kudos
Message 4 of 9
(4,120 Views)

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.

0 Kudos
Message 5 of 9
(4,113 Views)
0 Kudos
Message 6 of 9
(4,097 Views)

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

0 Kudos
Message 7 of 9
(4,063 Views)
Solution
Accepted by topic author Han Yen

 


@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.

Message 8 of 9
(4,054 Views)

Thank you all very much for all the help and information. Exactly what I needed.

 

Kind regards,

HanYen

0 Kudos
Message 9 of 9
(4,039 Views)