LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

particular column as control in table

 Dear All,

Is there any way to make a particular column in a table as control and rest indicators?

I am creating a table where in 1 column i display the speed which is calculated by the program and in the next column the user wants to add the distance.

So, in the table i want the column representing Speed should act as an indicator and the Distance Column should behave as a Control as the user manually has to enter the distance.

how is this possible?

 

Thanks,

Ritesh 

Message 1 of 14
(4,041 Views)

Ritesh,

 

I don't know of an easy way to do this, but I would think it's possible with a little tricky programming.  Is there a reason you need both in the same table instead of two columns side by side, one being a control and the other an indicator?  If it is just for the visual feature, then it would be possible to create a table indicator and then create a custom control made to look like an exact replica of one of the columns.  You could then place the custom control over the top of the table so that it would appear that the custom control is part of the table, only it would be a control and the rest would be indicators.  Or even easier, you could just place a control column and indicator column side by side and keep the data separate in the application.  If you need it all in one table for programming reasons, then it will be tricky.  You would probably need to do something like fire events and check for value updates based on mouse positions and all that.  Unless someone has a better idea.

 

Cheers,

Clint

0 Kudos
Message 2 of 14
(4,021 Views)

Hello ritesh024,

 

The attached vi is a small exemple of "Control column" and " Indicator column".

This Vi computes the hypothenuse of a triangle according to the big and small side lengths.

 

It is composed of a table where  first column is small side, second bigside, and the third is hypothenuse calculation.

 

When the table changes, the hypothenuse is computed according to big and small side lengths.

The hypothenuse column could be considered as "indicator" as you cannot change the value without triggering a new computation

 

 Hope this helps!

 

Download All
0 Kudos
Message 3 of 14
(4,016 Views)

The way I've done it (attached) is to use the table as a control, but disable it whenever you click on the column that you want to be an indicator.  The Event Structure does this; it also calculates the speeds whenever time or a distance is added/changed.

 

It would be cleaner to calculate speed only for the row that has changed, but that's for you.

 

jm 

Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

Message 4 of 14
(3,996 Views)

 

@AntonieP,

Thanks for your Help but i couldn't run your VI as it is made in LV 8.6 and i am using LV 8.5. I dont know abt the compatability issues, but it gave an error saying cannot run this VI as it is made in the higher version of LV.

Could you pls make it in LV 8.5 and repost it?

 

@jcarmody,

Thanks for your program. It works fine.:smileyhappy:

 


It would be cleaner to calculate speed only for the row that has changed, but that's for you.


In my case, time is an indicator. so, the value of speed will only change when the value of distance is changed. i.e only for the row(distance) that has changed. :smileyhappy:

0 Kudos
Message 5 of 14
(3,984 Views)

You can discard the Mouse Down Event on other Columns, so they will be not editable.

 

 

Message 6 of 14
(3,972 Views)

@ Eugen Graf,

Thanks for your solution. This one looks more elegant. :smileyhappy:

I tried the same thing in Mulicolumn Listbox, but it didn't work.

Do you have any idea about it?? 

 

And what is the difference between Table and Multicolumn Listbox?

 

Thanks,

Ritesh

0 Kudos
Message 7 of 14
(3,954 Views)

ritesh024 wrote:

 

And what is the difference between Table and Multicolumn Listbox?


Read the LV Help for more details on them. Smiley Wink

 

Table is a decorated 2D Str Arr. ML Box is of Numeric datatype, which you can choose to be a Scalar or an Array based no your requirement. Its Itemnames property will serve as the equivalent of a table [if only the ML Box datatype is an array], as far as the data is concerned.

- Partha ( CLD until Oct 2027 🙂 )
Message 8 of 14
(3,949 Views)

ritesh024 wrote:

 Is there any way to make a particular column in a table as control and rest indicators?


Just place a Flat Box from the Decorations palette over the particular columns of the Table Control, which you want to behave like indicators, ans make that Flat Box to be transparent & group it(them) along with the Table Control. Smiley Wink

 

Not a good soultion. No coding needed; but the presence of the Flat Box must be documented somewhere.

- Partha ( CLD until Oct 2027 🙂 )
Message 9 of 14
(3,944 Views)

@ Parthabe,

the solution suggested by Eugen Graf works Perfect.

Did you see that?

No need of putting decorative buttons on the table, as this becomes a tedious task if the column is really big.

 

He gave a very neat and clean solution with hardly any bit of coding.

Only thing is I want the same thing to haapen in MC Listbox as the headers of MCL look really cool. :smileyhappy:

Otherwise, its not a big deal. With a bit of colouring, even Table's Headers can look awesome.  :smileyhappy:

 

Thanks,

Ritesh

0 Kudos
Message 10 of 14
(3,913 Views)