Commit 8cd89de1 authored by yogesh.m's avatar yogesh.m

update

parent 44e739dd
......@@ -4,7 +4,12 @@
<option name="autoReloadType" value="SELECTIVE" />
</component>
<component name="ChangeListManager">
<list default="true" id="e733891a-c063-4f94-92d6-4559e921107b" name="Default Changelist" comment="" />
<list default="true" id="e733891a-c063-4f94-92d6-4559e921107b" name="Default Changelist" comment="">
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/hash_sender.py" beforeDir="false" afterPath="$PROJECT_DIR$/hash_sender.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/main.py" beforeDir="false" afterPath="$PROJECT_DIR$/main.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/opcua_transmitter.py" beforeDir="false" afterPath="$PROJECT_DIR$/opcua_transmitter.py" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
......@@ -71,7 +76,7 @@
<option name="INPUT_FILE" value="" />
<method v="2" />
</configuration>
<configuration name="asyncua_server" type="PythonConfigurationType" factoryName="Python" temporary="true" nameIsGenerated="true">
<configuration name="hash_sender" type="PythonConfigurationType" factoryName="Python" temporary="true" nameIsGenerated="true">
<module name="opcua-cloning" />
<option name="INTERPRETER_OPTIONS" value="" />
<option name="PARENT_ENVS" value="true" />
......@@ -83,7 +88,7 @@
<option name="IS_MODULE_SDK" value="true" />
<option name="ADD_CONTENT_ROOTS" value="true" />
<option name="ADD_SOURCE_ROOTS" value="true" />
<option name="SCRIPT_NAME" value="D:\opcua-cloning\asyncua_server.py" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/hash_sender.py" />
<option name="PARAMETERS" value="" />
<option name="SHOW_COMMAND_LINE" value="false" />
<option name="EMULATE_TERMINAL" value="false" />
......@@ -92,7 +97,7 @@
<option name="INPUT_FILE" value="" />
<method v="2" />
</configuration>
<configuration name="hash_sender" type="PythonConfigurationType" factoryName="Python" temporary="true" nameIsGenerated="true">
<configuration name="main" type="PythonConfigurationType" factoryName="Python" nameIsGenerated="true">
<module name="opcua-cloning" />
<option name="INTERPRETER_OPTIONS" value="" />
<option name="PARENT_ENVS" value="true" />
......@@ -104,7 +109,7 @@
<option name="IS_MODULE_SDK" value="true" />
<option name="ADD_CONTENT_ROOTS" value="true" />
<option name="ADD_SOURCE_ROOTS" value="true" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/hash_sender.py" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/main.py" />
<option name="PARAMETERS" value="" />
<option name="SHOW_COMMAND_LINE" value="false" />
<option name="EMULATE_TERMINAL" value="false" />
......@@ -113,7 +118,7 @@
<option name="INPUT_FILE" value="" />
<method v="2" />
</configuration>
<configuration name="main" type="PythonConfigurationType" factoryName="Python" nameIsGenerated="true">
<configuration name="opcua-transmitter (1)" type="PythonConfigurationType" factoryName="Python" temporary="true" nameIsGenerated="true">
<module name="opcua-cloning" />
<option name="INTERPRETER_OPTIONS" value="" />
<option name="PARENT_ENVS" value="true" />
......@@ -125,7 +130,7 @@
<option name="IS_MODULE_SDK" value="true" />
<option name="ADD_CONTENT_ROOTS" value="true" />
<option name="ADD_SOURCE_ROOTS" value="true" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/main.py" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/opcua-transmitter.py" />
<option name="PARAMETERS" value="" />
<option name="SHOW_COMMAND_LINE" value="false" />
<option name="EMULATE_TERMINAL" value="false" />
......@@ -134,7 +139,7 @@
<option name="INPUT_FILE" value="" />
<method v="2" />
</configuration>
<configuration name="opcua-transmitter (1)" type="PythonConfigurationType" factoryName="Python" temporary="true" nameIsGenerated="true">
<configuration name="opcua_receiver" type="PythonConfigurationType" factoryName="Python" temporary="true" nameIsGenerated="true">
<module name="opcua-cloning" />
<option name="INTERPRETER_OPTIONS" value="" />
<option name="PARENT_ENVS" value="true" />
......@@ -146,7 +151,7 @@
<option name="IS_MODULE_SDK" value="true" />
<option name="ADD_CONTENT_ROOTS" value="true" />
<option name="ADD_SOURCE_ROOTS" value="true" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/opcua-transmitter.py" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/opcua_receiver.py" />
<option name="PARAMETERS" value="" />
<option name="SHOW_COMMAND_LINE" value="false" />
<option name="EMULATE_TERMINAL" value="false" />
......@@ -155,7 +160,7 @@
<option name="INPUT_FILE" value="" />
<method v="2" />
</configuration>
<configuration name="opcua_receiver" type="PythonConfigurationType" factoryName="Python" temporary="true" nameIsGenerated="true">
<configuration name="opcua_transmitter" type="PythonConfigurationType" factoryName="Python" temporary="true" nameIsGenerated="true">
<module name="opcua-cloning" />
<option name="INTERPRETER_OPTIONS" value="" />
<option name="PARENT_ENVS" value="true" />
......@@ -167,7 +172,7 @@
<option name="IS_MODULE_SDK" value="true" />
<option name="ADD_CONTENT_ROOTS" value="true" />
<option name="ADD_SOURCE_ROOTS" value="true" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/opcua_receiver.py" />
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/opcua_transmitter.py" />
<option name="PARAMETERS" value="" />
<option name="SHOW_COMMAND_LINE" value="false" />
<option name="EMULATE_TERMINAL" value="false" />
......@@ -178,11 +183,15 @@
</configuration>
<recent_temporary>
<list>
<<<<<<< Updated upstream
=======
<item itemvalue="Python.opcua_transmitter" />
<item itemvalue="Python.opcua-transmitter (1)" />
>>>>>>> Stashed changes
<item itemvalue="Python.opcua_receiver" />
<item itemvalue="Python.opcua-transmitter (1)" />
<item itemvalue="Python.hash_sender" />
<item itemvalue="Python.asyncua_server (1)" />
<item itemvalue="Python.asyncua_server" />
</list>
</recent_temporary>
</component>
......
......@@ -51,11 +51,9 @@ async def get_send_hash(ENDPOINT,NAMESPACE,server_hash_udp_ip,server_hash_udp_po
node_hierarchy["namespace_idx"]=nm_no
json_hierarchy = json.dumps(node_hierarchy)
hierarchy=json.dumps(json_hierarchy)
utf8_encoded_string = hierarchy.encode('utf-8')
string_length = len(utf8_encoded_string)
length_bytes = struct.pack("!I", string_length)
binary_data = length_bytes + utf8_encoded_string
UDPClientSocket.sendto(binary_data, serverAddressPort)
binary_data = hierarchy.encode()
print(binary_data)
#UDPClientSocket.sendto(binary_data, serverAddressPort)
def send_hash(Endpoint,Namespace,server_hash_udp_ip,server_hash_udp_port):
asyncio.run(get_send_hash(Endpoint,Namespace,server_hash_udp_ip,server_hash_udp_port))
\ No newline at end of file
......@@ -33,6 +33,7 @@ class MyHandler(SubHandler):
while True:
[node, value, data] = self._queue.get_nowait()
datatype = type(value)
print(value)
packet = str(datatype) + "&" + str(value) + "&" + str(node.nodeid.NamespaceIndex) + "&" + str(node.nodeid.Identifier)
UDPClientSocket.sendto(str.encode(packet), serverAddressPort)
......
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