11-22-2014 04:35 PM - edited 11-22-2014 04:36 PM
No, this is not correct. You don't need to use an event at all, in order to change the value of a cell in a list box. The double click was just an example.
Altenbach suggested 'value change' of a control. You can write the data to the list box, when the value of the 'data' control changes, or, as shown in the attached example, when a boolean control value changes.
When you run your data aquisition code you can also generate a user event (see LabVIEW help) and use it as trigger to write data to the list box.
11-23-2014 04:52 AM
Thank you for the very fine example chembo.
You are talking about user events.
Will I be able to create at user event, that triggers, when I enter a cell by using arrow down/up?
The event has to return the row number?
11-23-2014 05:48 PM
You don't need user event when you enter a cell using arrow up/down. The value of the list box changes in this case, so you can use the value change event of the listbox.
I am still not sure what you are trying to accomplish. If the sample numbers are imported from Excel and the data is generated via measurement you can just display the results in a table, or even in array of clusters (sample# / data pairs). You could still use user event in order to scroll the table so that the latest measurements become visible.
Anyway, below is a simple example how you could edit the listbox moving up/down with arrow keys.
I attached also one user event example. I am sure that the user event examples in LabVIEW are better, but I cannot access them right now, because my LabVIEW installation here is very basic, so I cannot send you a link.
11-24-2014 10:25 AM
Hallo Clembo
Thank you very much for your examples and your patience.
Now I understand a whole lot more (not all, but more ).
Before I didn’t understand that the value of the listbox changed if you entered a cell in the listbox.
I thought that you had to enter a value in the box in order to change the value of the box.
I can use this example I my code. That was what I wanted to accomplish.
The user event is a bid difficult for me to understand, but I got an idea. I think, I should read about the background.
I'll properly return soon with now questions. Now I know good explanations can be retrieved
11-24-2014 10:34 AM
@mkoppelgaard wrote:
Before I didn’t understand that the value of the listbox changed if you entered a cell in the listbox.
I thought that you had to enter a value in the box in order to change the value of the box.
The "value" of a listbox is the highlighted row. It is a simple numeric.
The strings in the cells are just a cosmetic property.
11-24-2014 12:48 PM
I just found it confusing that in the "dobbelt click event" the row is called row.
In value "change event" the row is called newVal...... as I understand it....
11-24-2014 01:35 PM
@mkoppelgaard wrote:
I just found it confusing that in the "dobbelt click event" the row is called row.
In value "change event" the row is called newVal...... as I understand it....
Well they are different contexts so I can see why they would use different names. The value of a listbox doesn't need to be scalar. It can be an array, like you selected multiple rows. In this case the "Value" of the listbox will be a 1D array of numerics, which are the rows that are selected. Alternatively if you double click a row, even if there are multiple rows selected, you can only double click on one row so the value must be a scalar.
So you could have a Row of 5 and a value of [1,2,3,4,5], which is why there aren't always the same thing.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
16 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
11-24-2014 02:05 PM
ah - okay - I see