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
1
Tom Waterbley [SLC] [DevOps Catalyst]8.89K Posted 18th November 2022 2 Comments

I don't immediately see a mistake in parameter 7. Could you please also show how the response XML itself looks like?

Also don't forget to implement the "read response" action that is triggered "before response" as described here: https://docs.dataminer.services/develop/devguide/Connector/ConnectionsSerialCreatingCommandsAndResponses.html#responses-with-variable-length-parameters

Marieke Goethals [SLC] [DevOps Catalyst] Selected answer as best 16th August 2023
Pengf Hu commented 21st November 2022

please see the new answer i posted below. thanks

Pengf Hu commented 21st November 2022

please see the below new answer i posted. I could not paste xml tags in the comment. I don’t know why.

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