begin if b_HAL_socket //MODBUS via connecteur J205 avec les sockets sioLink(siSocketTCP, siSocketTCP) clearBuffer(siSocketTCP) if(sioCtrl(siSocketTCP, "target",x_sIPServerModbus)!=0) call logMsgBlock("probleme: sioCtrl(siSocketTCP, target, "+x_sIPServerModbus+")",true) else call logMsgBlock("ok: sioCtrl(siSocketTCP, target, "+x_sIPServerModbus+")",true) endIf //"endOfString" num (Pour ligne série, client et serveur TCP) Code ASCII pour le caractère de fin de chaîne à utiliser avec les opérateurs '=' (dans la plage [0, 255]) if(sioCtrl(siSocketTCP, "endOfString", 13)!=0) call logMsgBlock("probleme sioCtrl(siSocketTCP, endOfString, 13)",true) endIf if(sioCtrl(siSocketTCP, "port", 502)!=0) call logMsgBlock("probleme sioCtrl(siSocketTCP, port, 502)",true) endIf //0 pour configurer les lectures sur socket bloquantes, //une autre valeur en seconde sinon if(sioCtrl(siSocketTCP, "timeout",1)!=0 ) call logMsgBlock("probleme sioCtrl(siSocketTCP, timeout,1)",true) endIf // initialisation du compteur de transactions nTID=0 else //accès via connecteur dédié J207 endIf end