Urcap InstallationNode

I would need to understand how you can read and write (at least read) the values ​​of the installation variables and the float_register (profinet) in the InstallationNode. I have currently created my custom features and I need to shift and update them (update feature) by acquiring values. I tried useing datamodel.get(key,defaultvalue) but it always returns defaultvalue because it doesn’t read it, I tried useing rtde in localhost but it always gives me zero, I tried with primary interface it returns null or N/A… etc etc

Could someone give me an help?

It’s really dumb, but I don’t think you CAN read the values of the URScript variables from Java. Even the globally defined installation variables. I forget exactly where I read that on here. Maybe something has changed since then, but yeah I’m not sure you can

Actually, as mentioned in the API docs here, you can read and write variables from your installation/program node contribution with DataModel. But that is related only to global script variables that are defined and are of the same type, otherwise default values are returned. You don’t have access to other data, such as fieldbus data. And of course no access is available dynamically during the run of the robot program - but that strongly depends on your application and needs.

On the other hand, with RTDE you should have the access to the fieldbus values. There is a Python library that demonstrates this - you can find it on Github. In the folder examples you can find a working example. Selecting proper lines in config XML you can choose which data to receive or update.

Also, depending on your use case, you could use a deamon as a part of your URCap to handle any data while program is running, or create a service on the background. In both cases XML-RPC calls may be useful.

Hope this helps!