initial commit with all the stuff
This commit is contained in:
31
2B+Software/app/shm.lua
Normal file
31
2B+Software/app/shm.lua
Normal file
@@ -0,0 +1,31 @@
|
||||
PLC = require('vwago')
|
||||
|
||||
plc = PLC.VWago("wago")
|
||||
|
||||
function setup()
|
||||
if ( plc ) then
|
||||
print("OK")
|
||||
end
|
||||
end
|
||||
|
||||
function loop()
|
||||
if ( plc ) then
|
||||
i = plc:getDouble(1)
|
||||
plc:setDouble(0,i)
|
||||
i = i + 1234
|
||||
if i > 2147483647 then
|
||||
i = 0
|
||||
o = plc:getDouble(2)
|
||||
plc:setDouble(2,o+1)
|
||||
end
|
||||
plc:setDouble(1,i)
|
||||
plc:update()
|
||||
print(i)
|
||||
end
|
||||
end
|
||||
|
||||
setup()
|
||||
|
||||
while 1 do
|
||||
loop()
|
||||
end
|
||||
Reference in New Issue
Block a user