This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

transmit value via ETH
#5
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.

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
Reply


Messages In This Thread
transmit value via ETH - by Frank68 - Today, 06:18
RE: transmit value via ETH - by admin - Today, 07:05
RE: transmit value via ETH - by admin - Today, 08:42

Forum Jump: