through the API you can only read the Standard Digital I/O so actually there is no proper solution for that yet. If you don’t need real time response you can do the following:
- create a global variable
- send a program to the robot through secondary client which modifies your variable with a line e.g. var1 = read_input_boolean_register(0) with URCap Sample: Send Script with button push URCap
also note that you need to modify it to send multiple lines of urscript code: Secondary Client Issue - read your variable through the API