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.

Get data from json format!!!
#7
This will write UserName to 1/1/0 and OperationID to 1/1/1:
Code:
if not server then
  require('socket')
  server = socket.udp()
  server:setsockname('*', 9999)
  server:settimeout(60)
end

data = server:receive()
if data then
  data = require('json').pdecode(data)

  for _, event in ipairs(data) do
    grp.write('1/1/0', event.UserName)
    grp.write('1/1/1', event.OperationID)
  end
end
Reply


Messages In This Thread
Get data from json format!!! - by phongvucba - 22.11.2022, 02:56
RE: Get data from json format!!! - by admin - 22.11.2022, 10:14
RE: Get data from json format!!! - by admin - 07.12.2022, 08:08
RE: Get data from json format!!! - by admin - 07.02.2023, 08:19

Forum Jump: