Skip to content
DataMiner DoJo

More results...

Generic selectors
Exact matches only
Search in title
Search in content
Post Type Selectors
Search in posts
Search in pages
Search in posts
Search in pages
Log in
Menu
  • Updates & Insights
  • Questions
  • Learning
    • E-learning Courses
    • Empower Replay: Limited Edition
    • Tutorials
    • Open Classroom Training
    • Certification
      • DataMiner Fundamentals
      • DataMiner Configurator
      • DataMiner Automation
      • Scripts & Connectors Developer: HTTP Basics
      • Scripts & Connectors Developer: SNMP Basics
      • Visual Overview – Level 1
      • Verify a certificate
    • Video Library
    • Books We Like
    • >> Go to DataMiner Docs
  • Expert Center
    • Solutions & Use Cases
      • Solutions
      • Use Case Library
    • Markets & Industries
      • Media production
      • Government & defense
      • Content distribution
      • Service providers
      • Partners
      • OSS/BSS
    • Agile
      • Agile Webspace
      • Everything Agile
        • The Agile Manifesto
        • Best Practices
        • Retro Recipes
      • Methodologies
        • The Scrum Framework
        • Kanban
        • Extreme Programming
      • Roles
        • The Product Owner
        • The Agile Coach
        • The Quality & UX Coach (QX)
    • DataMiner DevOps Professional Program
      • About the DevOps Program
      • DataMiner DevOps Support
  • Downloads
  • More
    • DataMiner Releases & Updates
    • Feature Suggestions
    • Climb the leaderboard!
    • Swag Shop
    • Contact
    • Global Feedback Survey
  • PARTNERS
    • All Partners
    • Technology Partners
    • Strategic Partner Program
    • Deal Registration
  • >> Go to dataminer.services

xml protocol driver to decode data received from the python socket server

Solved1.39K views16th August 2023decode serial socket
0
Pengf Hu23 17th November 2022 1 Comment

Hi

I have a python TCP server which waits and receives a data packet (e.g., "DEVICE1" string) from a socket (e.g. on port 3333) and then it writes back the "text1." string to the socket.

I developed a serial over TCP xml protocol driver in dataminer and seems the driver is working.

I can see the protocol driver can send "DEVICE1" string packet to my python TCP server and I can see the protocol driver can receive "text1." data from the python server (from the element Stream Viewer).

=============================================

<< 05:35:27 - getTCPdata
000000 4445564943 4531 DEVICE1
>> 05:35:29 - getTCPdata
000000 7465787431 2E text1.

==============================================

I have a parameter (parameter 7) in the xml protocol trying to show the content of the received data ("text1.").

But looks like the parameter could not decode the data ("text1.") sent from the python server. The parameter content in the element page is empty.

Therefore, how to decode the data ("text1.") in dataminer xml protocol side?

Following is my python code which sends string 'text1.' which is encoded to utf-8:

connection.sendall("text1.".encode('utf-8'))

Following is the parameter 7 xml tags:

<Param id="7" trending="false">
<Name>Returned Str</Name>
<Description>Returned Str</Description>
<Information>
<Includes>
<Include>range</Include>
<Include>units</Include>
<Include>steps</Include>
<Include>time</Include>
</Includes>
</Information>
<Type>read</Type>
<Interprete>
<RawType>other</RawType>
<LengthType>next param</LengthType>
<Type>string</Type>
</Interprete>
<Display>
<RTDisplay>true</RTDisplay>
<Positions>
<Position>
<Page>General</Page>
<Column>0</Column>
<Row>2</Row>
</Position>
</Positions>
</Display>
<Measurement>
<Type>string</Type>
</Measurement>
</Param>
</Params>

Thanks

Marieke Goethals [SLC] [DevOps Catalyst] Selected answer as best 16th August 2023
Marieke Goethals [SLC] [DevOps Catalyst] commented 11th July 2023

I see that this question has been inactive for some time. Have you found a solution for this yet? If yes, could you provide some information about this for reference for other users? If not, feel free to contact techsupport@skyline.be for assistance.

2 Answers

  • Active
  • Voted
  • Newest
  • Oldest
0
Pengf Hu23 Posted 21st November 2022 1 Comment

the response XML is simple, which just has one param 7 in it:

<Responses>
<Response id="1">
<Name>getDeviceStateRSP</Name>
<Description>Get Device State RsP</Description>
<Content>
<Param>7</Param>
</Content>
</Response>
</Responses>

I have a Pair (consisted by cmd1 and response1) in a group which is in a 10s timer. Response 1 has param 7 in it.

<Pairs>
<Pair id="1" ping="true">
<Name>getDeviceState</Name>
<Description>Get Device State</Description>
<Content>
<Command>1</Command>
<Response>1</Response>
</Content>
</Pair>
</Pairs>

Thanks

Tom Waterbley [SLC] [DevOps Catalyst] Posted new comment 21st November 2022
Tom Waterbley [SLC] [DevOps Catalyst] commented 21st November 2022

Hi, do you also have a “read response” action that is being triggered “before response” as described here? https://docs.dataminer.services/develop/devguide/Connector/ConnectionsSerialCreatingCommandsAndResponses.html#responses-with-variable-length-parameters

You are viewing 1 out of 2 answers, click here to view all answers.
Please login to be able to comment or post an answer.

My DevOps rank

DevOps Members get more insights on their profile page.

My user earnings

0 Dojo credits

Spend your credits in our swag shop.

0 Reputation points

Boost your reputation, climb the leaderboard.

Promo banner DataMiner DevOps Professiona Program
DataMiner Integration Studio (DIS)
Empower Katas
Privacy Policy • Terms & Conditions • Contact

© 2025 Skyline Communications. All rights reserved.

DOJO Q&A widget

Can't find what you need?

? Explore the Q&A DataMiner Docs

[ Placeholder content for popup link ] WordPress Download Manager - Best Download Management Plugin