ok here we go:
simatic.cfg (It’s a S7-300)
simatic:refresh=2000
simatic:plc=192.168.0.200:0.2
log:
2016-12-21 17:34:33.820 [DEBUG] [org.openhab.binding.simatic ] - ServiceEvent REGISTERED - {org.osgi.service.event.EventHandler}={event.topics=openhab/command/*, service.pid=org.openhab.simatic, refresh=2000, component.name=org.openhab.binding.simatic.binding, component.id=13, plc=192.168.0.200:0.2, service.id=262, service.bundleid=10, service.scope=bundle} - org.openhab.binding.simatic
2016-12-21 17:34:33.825 [DEBUG] [ding.simatic.internal.SimaticBinding] - allBindingsChanged(org.openhab.binding.simatic.internal.SimaticGenericBindingProvider@1593ec9) is called!
2016-12-21 17:34:33.826 [DEBUG] [ding.simatic.internal.SimaticBinding] - activate() method is called!
2016-12-21 17:34:33.826 [DEBUG] [ding.simatic.internal.SimaticBinding] - org.openhab.binding.simatic_1.9.0.201609230554 [10]
2016-12-21 17:34:33.832 [DEBUG] [imatic.internal.SimaticGenericDevice] - isoTCP:192.168.0.200 - readAreas:
2016-12-21 17:34:33.832 [DEBUG] [.binding.simatic.internal.SimaticTCP] - isoTCP:192.168.0.200 - open() - connecting
2016-12-21 17:34:34.415 [INFO ] [.binding.simatic.internal.SimaticTCP] - isoTCP:192.168.0.200 - connected
2016-12-21 17:34:34.416 [DEBUG] [ding.simatic.internal.SimaticBinding] - setProperlyConfigured
2016-12-21 17:34:34.454 [INFO ] [b.core.service.AbstractActiveService] - Simatic communication service has been started
items:
// Diagnose Items
Number PortState "PLC state [%s]" { simatic="plc:info:state" }
Number PortPreviouState "PLC previous state [%s]" { simatic="plc:info:previous_state" }
DateTime PortStateChangeTime "PLC changed [%1$tA, %1$td.%1$tm.%1$tY %1$tT]" { simatic="plc:info:state_change_time" }
// Test Items
Switch TestSimatic "Taster Gang" { simatic="plc:DB300.DBX4.6:byte:IO" }
Contact TestSimatic1 "Licht Gang" { simatic="plc:DB300.DBX4.7:byte:IO" }
the 3 diagnosis items never get a value and stay NULL
2016-12-21 17:34:34.454 [DEBUG] [ding.simatic.internal.SimaticBinding] - execute() method is called!
2016-12-21 17:34:34.454 [DEBUG] [.binding.simatic.internal.SimaticTCP] - isoTCP:192.168.0.200 - checkNewData() is called
2016-12-21 17:34:34.480 [DEBUG] [ternal.SimaticGenericBindingProvider] - processBindingConfiguration() method is called!
2016-12-21 17:34:34.481 [DEBUG] [ternal.SimaticGenericBindingProvider] - Item:PortState (Type=NumberItem, State=Uninitialized)/Config:plc:info:state
2016-12-21 17:34:34.482 [DEBUG] [ternal.SimaticGenericBindingProvider] - PortState (Device=plc InfoType=STATE)
2016-12-21 17:34:34.482 [DEBUG] [ding.simatic.internal.SimaticBinding] - bindingChanged(org.openhab.binding.simatic.internal.SimaticGenericBindingProvider@1593ec9,PortState) is called!
2016-12-21 17:34:34.483 [DEBUG] [ding.simatic.internal.SimaticBinding] - ItemsConfig: {}:0
2016-12-21 17:34:34.483 [DEBUG] [ternal.SimaticGenericBindingProvider] - processBindingConfiguration() method is called!
2016-12-21 17:34:34.483 [DEBUG] [ternal.SimaticGenericBindingProvider] - Item:PortPreviouState (Type=NumberItem, State=Uninitialized)/Config:plc:info:previous_state
2016-12-21 17:34:34.484 [DEBUG] [ternal.SimaticGenericBindingProvider] - PortPreviouState (Device=plc InfoType=PREVIOUS_STATE)
2016-12-21 17:34:34.484 [DEBUG] [ding.simatic.internal.SimaticBinding] - bindingChanged(org.openhab.binding.simatic.internal.SimaticGenericBindingProvider@1593ec9,PortPreviouState) is called!
2016-12-21 17:34:34.484 [DEBUG] [ding.simatic.internal.SimaticBinding] - ItemsConfig: {}:0
2016-12-21 17:34:34.485 [DEBUG] [ternal.SimaticGenericBindingProvider] - processBindingConfiguration() method is called!
2016-12-21 17:34:34.485 [DEBUG] [ternal.SimaticGenericBindingProvider] - Item:PortStateChangeTime (Type=DateTimeItem, State=Uninitialized)/Config:plc:info:state_change_time
2016-12-21 17:34:34.485 [DEBUG] [ternal.SimaticGenericBindingProvider] - PortStateChangeTime (Device=plc InfoType=STATE_CHANGE_TIME)
2016-12-21 17:34:34.486 [DEBUG] [ding.simatic.internal.SimaticBinding] - bindingChanged(org.openhab.binding.simatic.internal.SimaticGenericBindingProvider@1593ec9,PortStateChangeTime) is called!
2016-12-21 17:34:34.486 [DEBUG] [ding.simatic.internal.SimaticBinding] - ItemsConfig: {}:0
2016-12-21 17:34:34.486 [DEBUG] [ternal.SimaticGenericBindingProvider] - processBindingConfiguration() method is called!
the switch and the contact item when intially loaded:
2016-12-21 17:34:34.486 [DEBUG] [ternal.SimaticGenericBindingProvider] - Item:TestSimatic (Type=SwitchItem, State=Uninitialized)/Config:plc:DB300.DBX4.6:byte:IO
2016-12-21 17:34:34.489 [DEBUG] [ternal.SimaticGenericBindingProvider] - TestSimatic (Device=plc MemAddress=DB300.DBX4.6/DB300.DBX4.6 DataType=BYTE Direction=0)
2016-12-21 17:34:34.490 [DEBUG] [ding.simatic.internal.SimaticBinding] - bindingChanged(org.openhab.binding.simatic.internal.SimaticGenericBindingProvider@1593ec9,TestSimatic) is called!
2016-12-21 17:34:34.490 [DEBUG] [ding.simatic.internal.SimaticBinding] - ItemsConfig: {TestSimatic=TestSimatic (Device=plc MemAddress=DB300.DBX4.6/DB300.DBX4.6 DataType=BYTE Direction=0)}:1
2016-12-21 17:34:34.490 [DEBUG] [ternal.SimaticGenericBindingProvider] - processBindingConfiguration() method is called!
2016-12-21 17:34:34.491 [DEBUG] [ternal.SimaticGenericBindingProvider] - Item:TestSimatic1 (Type=ContactItem, State=Uninitialized)/Config:plc:DB300.DBX4.7:byte:IO
2016-12-21 17:34:34.491 [DEBUG] [ternal.SimaticGenericBindingProvider] - TestSimatic1 (Device=plc MemAddress=DB300.DBX4.7/DB300.DBX4.7 DataType=BYTE Direction=0)
2016-12-21 17:34:34.491 [DEBUG] [ding.simatic.internal.SimaticBinding] - bindingChanged(org.openhab.binding.simatic.internal.SimaticGenericBindingProvider@1593ec9,TestSimatic1) is called!
2016-12-21 17:34:34.492 [DEBUG] [ding.simatic.internal.SimaticBinding] - ItemsConfig: {TestSimatic=TestSimatic (Device=plc MemAddress=DB300.DBX4.6/DB300.DBX4.6 DataType=BYTE Direction=0), TestSimatic1=TestSimatic1 (Device=plc MemAddress=DB300.DBX4.7/DB300.DBX4.7 DataType=BYTE Direction=0)}:2
the switch works(in S7 config it is the button) the contact does not work (which is the output and reflects the status of the light. so if the switch is turning the light on the contact should get updated to 1 and if the light is turned of the contact item should show 0 … its a full star topology)
the log shows I push the switch button … and this also works! I would expect that the binding actually reads the contact item from the S7 and changes the state of this aswell
2016-12-21 17:39:34.473 [DEBUG] [.binding.simatic.internal.SimaticTCP] - isoTCP:192.168.0.200 - checkNewData() is called
2016-12-21 17:39:46.249 [DEBUG] [ding.simatic.internal.SimaticBinding] - internalReceiveCommand(TestSimatic,ON) is called!
2016-12-21 17:39:46.249 [DEBUG] [imatic.internal.SimaticWriteDataArea] - create(): item:TestSimatic|datatype:BYTE
2016-12-21 17:39:46.249 [DEBUG] [imatic.internal.SimaticGenericDevice] - isoTCP:192.168.0.200: Adding command into queue
2016-12-21 17:39:46.249 [DEBUG] [imatic.internal.SimaticGenericDevice] - isoTCP:192.168.0.200 - Processing commandQueue - length 1. Thread=242
2016-12-21 17:39:46.249 [DEBUG] [.binding.simatic.internal.SimaticTCP] - isoTCP:192.168.0.200 - Sending data to device
2016-12-21 17:39:46.249 [DEBUG] [.binding.simatic.internal.SimaticTCP] - isoTCP:192.168.0.200 - writeBits(area=132,db=300,adr=38,len=1, data=1)
2016-12-21 17:39:46.250 [DEBUG] [.binding.simatic.internal.SimaticTCP] - 1,
2016-12-21 17:39:49.783 [DEBUG] [ding.simatic.internal.SimaticBinding] - internalReceiveCommand(TestSimatic,OFF) is called!
2016-12-21 17:39:49.783 [DEBUG] [imatic.internal.SimaticWriteDataArea] - create(): item:TestSimatic|datatype:BYTE
2016-12-21 17:39:49.783 [DEBUG] [imatic.internal.SimaticGenericDevice] - isoTCP:192.168.0.200: Adding command into queue
2016-12-21 17:39:49.783 [DEBUG] [imatic.internal.SimaticGenericDevice] - isoTCP:192.168.0.200 - Processing commandQueue - length 1. Thread=242
2016-12-21 17:39:49.784 [DEBUG] [.binding.simatic.internal.SimaticTCP] - isoTCP:192.168.0.200 - Sending data to device
2016-12-21 17:39:49.784 [DEBUG] [.binding.simatic.internal.SimaticTCP] - isoTCP:192.168.0.200 - writeBits(area=132,db=300,adr=38,len=1, data=1)
2016-12-21 17:39:49.784 [DEBUG] [.binding.simatic.internal.SimaticTCP] - 0,
2016-12-21 17:39:54.473 [DEBUG] [ding.simatic.internal.SimaticBinding] - execute() method is called!
2016-12-21 17:39:54.473 [DEBUG] [.binding.simatic.internal.SimaticTCP] - isoTCP:192.168.0.200 - checkNewData() is called
2016-12-21 17:40:14.473 [DEBUG] [ding.simatic.internal.SimaticBinding] - execute() method is called!
2016-12-21 17:40:14.473 [DEBUG] [.binding.simatic.internal.SimaticTCP] - isoTCP:192.168.0.200 - checkNewData() is called
2016-12-21 17:40:34.474 [DEBUG] [ding.simatic.internal.SimaticBinding] - execute() method is called!
2016-12-21 17:40:34.474 [DEBUG] [.binding.simatic.internal.SimaticTCP] - isoTCP:192.168.0.200 - checkNewData() is called
2016-12-21 17:40:44.743 [DEBUG] [ding.simatic.internal.SimaticBinding] - internalReceiveCommand(TestSimatic,ON) is called!
2016-12-21 17:40:44.744 [DEBUG] [imatic.internal.SimaticWriteDataArea] - create(): item:TestSimatic|datatype:BYTE
2016-12-21 17:40:44.744 [DEBUG] [imatic.internal.SimaticGenericDevice] - isoTCP:192.168.0.200: Adding command into queue
2016-12-21 17:40:44.745 [DEBUG] [imatic.internal.SimaticGenericDevice] - isoTCP:192.168.0.200 - Processing commandQueue - length 1. Thread=242
2016-12-21 17:40:44.745 [DEBUG] [.binding.simatic.internal.SimaticTCP] - isoTCP:192.168.0.200 - Sending data to device
2016-12-21 17:40:44.745 [DEBUG] [.binding.simatic.internal.SimaticTCP] - isoTCP:192.168.0.200 - writeBits(area=132,db=300,adr=38,len=1, data=1)
2016-12-21 17:40:44.745 [DEBUG] [.binding.simatic.internal.SimaticTCP] - 1,
2016-12-21 17:40:54.474 [DEBUG] [ding.simatic.internal.SimaticBinding] - execute() method is called!
2016-12-21 17:40:54.474 [DEBUG] [.binding.simatic.internal.SimaticTCP] - isoTCP:192.168.0.200 - checkNewData() is called
2016-12-21 17:41:14.474 [DEBUG] [ding.simatic.internal.SimaticBinding] - execute() method is called!
2016-12-21 17:41:14.474 [DEBUG] [.binding.simatic.internal.SimaticTCP] - isoTCP:192.168.0.200 - checkNewData() is called
2016-12-21 17:41:32.476 [DEBUG] [ding.simatic.internal.SimaticBinding] - internalReceiveCommand(TestSimatic,OFF) is called!
2016-12-21 17:41:32.476 [DEBUG] [imatic.internal.SimaticWriteDataArea] - create(): item:TestSimatic|datatype:BYTE
2016-12-21 17:41:32.476 [DEBUG] [imatic.internal.SimaticGenericDevice] - isoTCP:192.168.0.200: Adding command into queue
2016-12-21 17:41:32.477 [DEBUG] [imatic.internal.SimaticGenericDevice] - isoTCP:192.168.0.200 - Processing commandQueue - length 1. Thread=243
2016-12-21 17:41:32.477 [DEBUG] [.binding.simatic.internal.SimaticTCP] - isoTCP:192.168.0.200 - Sending data to device
2016-12-21 17:41:32.477 [DEBUG] [.binding.simatic.internal.SimaticTCP] - isoTCP:192.168.0.200 - writeBits(area=132,db=300,adr=38,len=1, data=1)
2016-12-21 17:41:32.477 [DEBUG] [.binding.simatic.internal.SimaticTCP] - 0,