Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8317481
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T21:37:07+00:00 2026-06-08T21:37:07+00:00

I am using python’s pySerial library to communicate to a machine (lunar photometer if

  • 0

I am using python’s pySerial library to communicate to a machine (lunar photometer if you must know). The machine has built in scenarios that I can call by sending specific hex values corresponding to those scenarios via a com/serial port. For example, the following code works fine for the “Park secnario” in the machine.

s.write('\x11') #s is my serial object, '\x11' is the command for the park senario
s.write('\x12') #'\x12' is the command for the TrackSun scenario

The above code works as intended and the machine responds to these commands. However, there is a bult in Goto scenario which is activated by the command ‘\x02’. My problem is that the goto command takes horizontal and vertical angles as parameters as well in this format GoTo where xxxx and yyyy are the two angles. How do i pass in those parameters in my s.write() command. I have tried:
s.write(‘\x02 xxxx yyyy’)
which does not seem to work. Am i doing something wrong with passing the parameters? The command works fine when i use hyperterminal (in hex mode) with the following code:

8/1/2012 11:37:36.048 [TX] - 02 30 34 3B 30 3F 3A 3D 3B 03 
8/1/2012 11:37:51.166 [RX] - 01 

EDIT:
Here is an example of the ‘Park Scenario’ command sent using hyperterminal, just in case.

8/1/2012 12:14:56.649 [TX] - 11 
8/1/2012 12:15:07.962 [RX] - 01 
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T21:37:08+00:00Added an answer on June 8, 2026 at 9:37 pm

    The following call to s.write() would be the same as what you’re sending on Hyperterminal:

    s.write('\x02\x30\x34\x3b\x30\x3f\x3a\x3d\x3b\x03')
    

    The general solution will depend on how your angles are encoded. I can’t determine the encoding from your example.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using python 2.4 and the built-in ZipFile library, I cannot read very large zip
(Using Python 3.1) I know this question has been asked many times for the
Using Python, I want to know whether Java is installed.
Using Python's Networkx library, I created an undirected graph to represent a relationship network
Using Python I want to create a symbolic link pointing to a path that
Using python I'm parsing several strings. Sometimes the string has appended several semicolons to
Im using Python's built in XML parser to load a 1.5 gig XML file
When using Python is it possible that a dict can have a value that
hi so im using python and i'm trying to create a function that lets
Using Python v2.x, I have 3 variables that I want to ask the user

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.