What I want:
I have a sensor with a variable isWorking(boolean) on a real system. Now I want a viewer that shows me if the sensor is working or not. For example sensor node is green or red.
What I have:
I have a softSPS program on CoDeSys with the variable isWorking. With JEasyOPC I can read/overwrite this variable and print it into Eclipse console.
I also created a Sirius model for my system in an eclipse runtime as in all Sirius tutorials I found are shown. I saw that I can change the color of node with a Conditional Style.
So I have a node Sensor and a variable isWorking but I don't know how to connect them.
I found something about "external Java action" in Sirius documentation. There's also in Sirius Forum an example (https://www.eclipse.org/forums/index.php/t/764175/) but I don´t know if it´s work for my problem and how I can use JEasyOPC with them.
Another way I found is JFace Data Binding, but I only found a tutorial that works with an EMF Model and not with a Sirius Diagram (http://www.vogella.com/tutorials/EclipseDataBindingEMF/article.html). I don't want to change my meta model.
I know Eclipse and Sirius. If I understand you correctly you have a variable available with which you want display a node with different color according to variable value. To do that you must busy waiting [1] which is not the best practise, a best practise would be to be notified with a listener of variable value change.
Then following your chosen strategy, busy waiting (with a Thread which read in loop your variable) or listener, you need to update your EMF model to have Sirius reacts to you EMF model change and have it change the node's color.
Best Regards.
[1] http://en.wikipedia.org/wiki/Busy_waiting