From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

grid using table

Solved!
Go to solution

Hi all,

 

I am having a 2-D array of 8 bit binary data.


I want to add the data to a table and change the colour of each cell depending on the data values in the following ways
if any bit of the 8bit data is '1' the cell should be coloured red else the cell will be green.

 

one more feature needed is

I want to show red or green only in main front panel. On clicking that particular grid, the 8 bit value should appear in new window.

Plz help.
M a newbie to Labview.

Thanks in advance. 🙂

0 Kudos
Message 1 of 10
(3,475 Views)

 

what you want is like to make a image because image is 2d array 

so for first solution you can use picture functions tools  to solve this 

0 Kudos
Message 2 of 10
(3,448 Views)

ni4me a écrit :

Hi all,

 

I am having a 2-D array of 8 bit binary data.


I want to add the data to a table and change the colour of each cell depending on the data values in the following ways
if any bit of the 8bit data is '1' the cell should be coloured red else the cell will be green.

 


Finally only number 0 will have a green background.

 

Nobody will do your work for you. People will be a lot more willing to help and guide you if you show us us what you have tried so far. If you are new to LabVIEW I suggest you take the free tutorials availables on the NI site. Also have a look at the exemple finder for exemples related to tables.

 

Ben64

0 Kudos
Message 3 of 10
(3,413 Views)

Hi ni4me,

 

Please upload what you've done so far and where you are getting stuck, thank you,

 

Gregory

0 Kudos
Message 4 of 10
(3,406 Views)

HI

 

I am able to show the results in the grid

But I am stuck at invoking the find.vi to get detail of one particular cell when the "Get detail" button is pressed.

 

Plz help

Download All
0 Kudos
Message 5 of 10
(3,331 Views)

Your "find.vi" is in a separate event structure with no outputs. What were you hoping to do? If you want to take the element it finds, you need to wire it up to an output terminal in find.vi. Then in your main.vi you need to get it somewhere useful. You could have a state in your state machine called "Idle/Wait" containing your event structure, and waiting for you to press the button. Or send it using a queue.

 

I don't know if this was by design, but your wire that goes to the Table indicator will never update the table. This is because the indicator waits for the while loop to finish executing, which never happens unless you abort the program.

0 Kudos
Message 6 of 10
(3,292 Views)

I want to look for red cells at first

and then on finding it, I want the find.vi to get the element at the error position when invoked by the user (by entering the indexes).

0 Kudos
Message 7 of 10
(3,277 Views)

Your find.vi is only setup to take in one pair of indices right now (if you connect them to the input terminals). If you want to see all of the failing values, perhaps you can do it in your "color" state. When you color something red, output that value into an array. You can even use the "conditional" terminal on the for loop output.

0 Kudos
Message 8 of 10
(3,262 Views)
Solution
Accepted by topic author ni4me

@ni4me wrote:

HI

 

I am able to show the results in the grid

But I am stuck at invoking the find.vi to get detail of one particular cell when the "Get detail" button is pressed.

 

Plz help


First you should implement an architecture that allow the vi to terminate without having to press the abort button.

Second, if you don't wrap the event structure in a while loop it will execute only once, probably not what you want.

To get the coordinates of the table cell that was press you need to use the Table mouse down event. Create a Table invoke node and select the Point To Row Column method. Wire the Coordinates output of the left event data node to the point input of the invoke node. If you unbundle the CellPosition output of the invoke node you will get the Row and Column values of the Table cell that was pressed. Feed these values to your Find vi.

The Find vi will only flash open if you leave it as it is. You need to modify it so it runs until the user perform some action.

 

Ben64

Message 9 of 10
(3,251 Views)

Thanx a ton 🙂 

0 Kudos
Message 10 of 10
(3,217 Views)