From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
01-16-2016 02:15 AM
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. 🙂
Solved! Go to Solution.
01-16-2016 03:18 AM - edited 01-16-2016 03:18 AM
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
01-16-2016 09:55 AM
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
01-16-2016 10:09 AM
Hi ni4me,
Please upload what you've done so far and where you are getting stuck, thank you,
Gregory
01-18-2016 10:40 PM
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
01-19-2016 09:28 AM
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.
01-19-2016 11:30 AM
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).
01-19-2016 12:01 PM
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.
01-19-2016 12:16 PM
@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
01-20-2016 06:46 AM
Thanx a ton 🙂