Logic Machine Forum
Integration object from ETS - Printable Version

+- Logic Machine Forum (https://forum.logicmachine.net)
+-- Forum: LogicMachine eco-system (https://forum.logicmachine.net/forumdisplay.php?fid=1)
+--- Forum: Gateway (https://forum.logicmachine.net/forumdisplay.php?fid=10)
+--- Thread: Integration object from ETS (/showthread.php?tid=1762)



Integration object from ETS - Tokatubs - 01.12.2018

I am integrating some GDB181 Vavs from SIEMENS. To write the Vmin and Vmax the value is written in % and the object is 08.010 percentage difference.
Lets say for example value is 15% in Vmin of the Vnom. 

But when the value comes to the Lm5 its a 2 byte signed integer and the value is 1500. Whats the correct way to get this  corrected?


RE: Integration object from ETS - admin - 03.12.2018

You can make the conversion via a script. Create a virtual object via 4 byte floating point data type. Use this object for control/display.

In this example source 2 byte object is 1/1/1 and virtual object is 32/1/1. Change as needed.

Attach an event script to virtual object (32/1/1):
Code:
-- do nothing if triggered by another event script
if event.sender ~= 'se' then
  value = event.getvalue()
  grp.write('1/1/1', value * 100)
end

Then attach another event script to source object (1/1/1):
Code:
-- do nothing if triggered by another event script
if event.sender ~= 'se' then
  value = event.getvalue()
  grp.write('32/1/1', value / 100)
end