RobotStudio event

Variable access with web services

I am trying to read a program user variable in Module 1
    PERS num count := 0;

The manual states that I should be able to
</code><code>curl --digest -u "Default User":robotics <a href="http://192.168.8.105/rw/rapid/symbol/data/RAPID/T_ROB1/user/reg1" target="_blank" rel="nofollow">http://192.168.8.105/rw/rapid/symbol/data/RAPID/T_ROB1/user/count</a>
But first of all I think it should be symbols and symbol is not known with resource not found.

So I have tried

/:[c:\temp]curl --digest -u "Default User":robotics "http://127.0.0.1/rw/rapid/s<br>ymbols?action=show" | xmllint-1.0.exe

Comments

  • It should be "symbol" and not "symbols". This is the Rapid Code:

    <div>MODULE Module1<br></div><div>&nbsp;&nbsp;<br></div><div>&nbsp; PERS num count := 13746;<br></div><div>&nbsp;&nbsp;<br></div><div>ENDMODULE</div>


    This is the command to read the value:

    curl --digest -u "Default User":robotics http://localhost/rw/rapid/symbol/data/RAPID/T_ROB1/Module1/count


    And this is the result:

    <?xml version="1.0" encoding="UTF-8"?><br><html xmlns="http://www.w3.org/1999/xhtml"><br>&nbsp; <head><br>&nbsp; &nbsp; <title>rapid</title><br>&nbsp; &nbsp; <base href="http://localhost:80/rw/rapid/"/><br>&nbsp; </head><br>&nbsp; <body> <br>&nbsp; &nbsp; <div class="state"><br>&nbsp; &nbsp; &nbsp; <a href="symbol/data/RAPID/T_ROB1/Module1/count" rel="self"></a><br>&nbsp; &nbsp; &nbsp; <a href="symbol/data/RAPID/T_ROB1/Module1/count?action=show" rel="action"></a><br>&nbsp; &nbsp; &nbsp; <ul><br>&nbsp; &nbsp; &nbsp; &nbsp; <li class="rap-data" title="RAPID/T_ROB1/Module1/count"> <br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="value">13746</span><br>&nbsp; &nbsp; &nbsp; &nbsp; </li><br>&nbsp; &nbsp; &nbsp; </ul><br>&nbsp; &nbsp; </div><br>&nbsp; </body><br></html>