Hi, just trying to make a simple table with the first column being text and the next column being a tag. This is just to display information in my SCADA, like this:
I can get the tags into the table but I can’t figure out how to just enter text in the other column for a label.
Click the binding button on the data property of the table and then select Cell update.
Then you can tie each cell of the table to any value.
Just as an alternative, if you’re comfortable using code you could also generate the dataset for the table using system.dataset.toDataSet.
header = ['name', 'value']
values = []
windSpeed = system.tag.read('wind speed').value
rainfall = system.tag.read('rainfall').value
windDirection = system.tag.read('wind direction').value
values.append(['wind speed', windSpeed])
values.append(['rainfall', rainfall])
values.append(['wind direction', windDirection])
table = event.source.parent.getComponent('Power Table')
table.data = system.dataset.toDataSet(header, values)
If you need to make this refresh periodically you could use a timer.
Thanks, I got that figured out now. I just need to add text to the cells in column 1. Not sure how to do that?
Stuart
April 20, 2018, 7:20pm
5
Do the same thing. Set Column to 1 and then double click the Value and type in what you want.
Edit : It looks like you did that already at the last row. You don’t need the = sign however. Is it not working?
Hi, this is code looks like it would also do what I need. Where would I write this code? Thanks!
tried that too and it won’t show the text. ideas?
The first column has to have a type of ‘string’, not ‘integer’.
You could put this in the actionPerformed event handler of a timer object. Make sure to use the correct path for your table.
Or just click the table dataset button next to the binding button and add the text in there.
Thanks for the help, I got it figured out!