I’m new to URCap and experiencing difficulty using a variable that has already been created in PolyScope with the AssignmentNode operator. When I start the robot program, it prompts me to set a number for the variable. I want to retrieve this variable once it’s created and incorporate it into my URCap program for further use. Does anyone have a solution for this?
As I understand it, you can retrieve the variable value using URScript instructions inside the “generateScript()” method, but you should use the ScriptWriter to append lines so it can execute them once the program running in Polyscope reaches your URCap. Otherwise, you will not get the current value from the variable since the code written inside your URCap that is not part of URScript will run separately from Polyscope.
If you manage to read the value from the variable by connecting to the Primary/Secondary Interface or Dashboard or another method, then you must likely get an empty value if the variable did not exist before running your program or you will get a previous value which is not useful.