Commit 6ef27edc authored by yogesh.m's avatar yogesh.m

update

parent df6a7ede
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.9" project-jdk-type="Python SDK" />
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.9 (pythonProject)" project-jdk-type="Python SDK" />
</project>
\ No newline at end of file
......@@ -2,7 +2,7 @@
<module type="PYTHON_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$" />
<orderEntry type="inheritedJdk" />
<orderEntry type="jdk" jdkName="Python 3.9 (pythonProject)" jdkType="Python SDK" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
\ No newline at end of file
......@@ -17,6 +17,9 @@
<component name="Git.Settings">
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
</component>
<component name="MarkdownSettingsMigration">
<option name="stateVersion" value="1" />
</component>
<component name="ProjectId" id="2MBBW17AOFLvAzWG4Yg12wAh3jz" />
<component name="ProjectViewState">
<option name="hideEmptyMiddlePackages" value="true" />
......
......@@ -21,18 +21,19 @@ UDPServerSocket = socket.socket(family=socket.AF_INET, type=socket.SOCK_DGRAM)
# Bind to address and ip
#UDPServerSocket.bind((localIP, localPort))
UDPServerSocket.bind((localIP, localPort))
print("UDP server up and listening")
opua=opcua_pack()
sock = opua.connect("opc.tcp://2.2.2.7:53530/OPCUA/SimulationServer")
sock = opua.connect("opc.tcp://2.2.2.5:53530/OPCUA/SimulationServer")
opua.write_opcua_value(sock,3, 1002, 11)
while (True):
bytesAddressPair = UDPServerSocket.recvfrom(bufferSize)
message = bytesAddressPair[0]
datatype,value,nodeid = message.decode().split("&")
datatype,value,ns,nodeid = message.decode().split("&")
print(nodeid)
if(datatype=="<class 'float'>"):
opua.write_opcua_value(sock,3, 1002, 11)
opua.write_opcua_value(sock,int(ns), int(nodeid), 11)
if(datatype=="<class 'int'>"):
opua.write_opcua_value(sock,3, 1002, 6)
\ No newline at end of file
opua.write_opcua_value(sock,int(ns), int(nodeid), 6)
\ No newline at end of file
......@@ -418,7 +418,7 @@ class opcua_pack():
return session
def connect(self,address):
server_address = ('2.2.2.7', 53530)
server_address = ('2.2.2.5', 53530)
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.connect(server_address)
message = self.helf(address)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment