Today, 08:42
Here's a complete example for Remote services.
1. Enable Remote services on 192.168.0.225
- Go to System config > Services > Remote services.
- Create a password, but make sure that it doesn't have @ symbol or the script will fail
- For extra security enable "Allow only exported objects" option
2. Enable Export property for 16/6/27 on 192.168.0.225
3. Create an event script on 192.168.0.213 that is mapped to 1/4/15. Put the correct password into the password variable value.
4. Test the script. If the value does not update on 192.168.0.225 then check the Logs tab on 192.168.0.213. An error message will be provided there.
1. Enable Remote services on 192.168.0.225
- Go to System config > Services > Remote services.
- Create a password, but make sure that it doesn't have @ symbol or the script will fail
- For extra security enable "Allow only exported objects" option
2. Enable Export property for 16/6/27 on 192.168.0.225
3. Create an event script on 192.168.0.213 that is mapped to 1/4/15. Put the correct password into the password variable value.
4. Test the script. If the value does not update on 192.168.0.225 then check the Logs tab on 192.168.0.213. An error message will be provided there.
Code:
password = 'put_password_here'
ip = '192.168.0.225'
addr = '16/6/27'
http = require('socket.http')
value = event.getvalue()
qs = 'm=json&r=grp&fn=write&alias=' .. addr .. '&value=' .. tostring(value)
url = 'https://remote:' .. password .. '@' .. ip .. '/scada-remote?' ..qs
res, err = http.request(url)
if not res then
log('request failed', err)
end