Accessing datamodel from SwingToolbarService

Good evening,

I’m new to Universal Robots.

I want to use the model from the SwingToolbarService but the constructor doesn’t inject the model (in the SwingProgramNodeService constructor I have the DataModel model as parameter).

How can I interact with the model from the SwingToolbarService?

What I want to do is executing script commands, I don’t know if this is the best way to do it (with model.set so I need the DataModel from the SwingToolbarService ) or is better that I will open e socket to the robot Ip and port and send to it the commands (for example starting setting a first set of scripts, then when I press some button sending others and so on)