Hello Guru’s,
I’ve been wanting to simply log the system voltage on my RB953 but am having some difficulty.
I can get a “value” easily enough of 10.5 in a global variable called voltage. The difficulty comes due to the voltage reading being inaccurate, about 2 volts low and trying to adjust that.
:set $voltage [/system health get number=0 value ]
This command pumps out a string value not a number (integer). If I try to simply +2 the result, the ROS treats it as an IP address and mangles it. So somehow I need to convert it from a string to a number. In the documentation it makes some brief references to conversions using :tonum commands.
:global voltage1 [:tonum $voltage ]
So I followed what I think should have worked but it doesn’t, the voltage1 variable is blank.
I’ve seen in my google searching people getting the system health voltage returned as a 3 digit integer but I’m unable to replicate that, I suspect it was old ROS versions that did it.
I’m more than happy for any advice on either how to convert the string to a number or getting the system health voltage returned as a 3 digit number to begin with and I should be able to handle the rest from there.
For reference the script thus far is as follows. The system is running ROS 7.13
/system script
add dont-require-permissions=no name=Health owner=admin policy=\
ftp,reboot,read,write,policy,test,password,sniff,sensitive,romon source=":global voltage\r\
\n:global voltage1\r\
\n:set \$voltage value=0\r\
\n:set \$voltage1 value=0\r\
\n:set \$voltage [/system health get number=0 value ]\r\
\n:global voltage1 [:tonum \$voltage ]"