I'm currently struggling to make libnodave work with my S7-1200 plc over ethernet. The testISO_TCP.exe makes a connection and gets some info out of it, but I cannot for the life of me reproduce this. Every setting I try I get a -1 from libnodave.daveConnectPLC(dc).
My code:
debugEnable=Truedefdebug(string):if(debugEnable):printstringimportctypesimportosdaveProtoPPI=10# PPI for S7 200 daveProtoAS511=20# S5 programming port protocol daveProtoS7online=50# use s7onlinx.dll for transport daveProtoISOTCP=122# ISO over TCP */daveProtoISOTCP243=123# ISO over TCP with CP243 */daveProtoISOTCPR=124# ISO over TCP with Routing */daveSpeed9k=0daveSpeed19k=1daveSpeed187k=2daveSpeed500k=3daveSpeed1500k=4daveSpeed45k=5daveSpeed93k=6daveBlockType_OB='8'daveBlockType_DB='A'daveBlockType_SDB='B'daveBlockType_FC='C'daveBlockType_SFC='D'daveBlockType_FB='E'daveBlockType_SFB='F'classdaveOSserialType(ctypes.Structure):_fields_=[("rfd",ctypes.c_int),("wfd",ctypes.c_int)]debug("Starter script")debug("Laster inn dll")libnodave=ctypes.windll.LoadLibrary("libnodave_jfkmod.dll")fds=daveOSserialType()debug("Prover a koble til")fds.rdf=libnodave.openSocket(102,'192.168.0.1')fds.wdf=fds.rdfif(fds.rfd>=0):di=libnodave.daveNewInterface(fds,'IF1',0,daveProtoISOTCP,daveSpeed187k)libnodave.daveSetTimeout(di,500000000)res=libnodave.daveInitAdapter(di)debug("InitAdapter: "+str(res))dc=libnodave.daveNewConnection(di,2,10,0)res=libnodave.daveConnectPLC(dc)debug("ConnectPLC: "+str(res))
I've been reading up on it for the last 8 hours and I still have no idea what causes the error.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I'm currently struggling to make libnodave work with my S7-1200 plc over ethernet. The testISO_TCP.exe makes a connection and gets some info out of it, but I cannot for the life of me reproduce this. Every setting I try I get a -1 from libnodave.daveConnectPLC(dc).
My code:
I've been reading up on it for the last 8 hours and I still have no idea what causes the error.