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 7507279
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T22:27:22+00:00 2026-05-29T22:27:22+00:00

I have a sensor which uses RS422 to spit out messages over serial. (I

  • 0

I have a sensor which uses RS422 to spit out messages over serial. (I think thats the right terminology.) Anyways, I made my wiring harness, and hooked it up to my rs422 to usb convertor and tada, I got data in hyperterminal. Good stuff.

Now the sensor has an odd baud rate, 1500kbps. I am doing this in Windows, so it actually wasn’t that hard to set that baud rate. Initially, at power on, the sensor sends out a 69 byte message every 10hz. I see this message, the correct bytes are read, and the message is very accurate (it includes a timestamp, which wait for it, increases by 0.1 s every message!) MOST IMPORTANTLY, I get the message on its boundary, in other words, every read was a new message.

Anyways things are going good so far, so I took the next step, I sent a write command over the serial port, to activate a sensor data message. This message is 76 bytes large, and is sent out at 100hz. Success again, more data begins appearing in reads. However, I am not getting it at 100hz, I get blocks of 3968 bytes. If I lower my buffer, I get three very very very quick reads of 1024, then immediately a read of 896. (3968 bytes again). (Note that I am now receiving two messages, one at 10 hz with size 69, and one at 100hz with size 76, note that no combination of the two messages evenly divides 3968.)

My question is, somewhere something is buffering my 100hz messages, and I am not getting them as they’re being received. I would like to change that but I do not know what I’m looking for. I don’t need that 100hz message on its boundary, I just don’t want it at 2 Hz. I would be happy with 30hz or even 20hz.


Below I include my Serial Port Set up code:

Port Open

 serial_port_ = CreateFile(L"COM6", GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0);

CommState and Timeouts

 COMMTIMEOUTS comm_timeouts;
 ZeroMemory(&comm_timeouts, sizeof(COMMTIMEOUTS));
 //comm_timeouts.ReadIntervalTimeout = MAXDWORD; //Instant Read, still get 3968 chunks
 comm_timeouts.ReadIntervalTimeout = 1; //1ms timeout
 comm_timeouts.ReadTotalTimeoutConstant = 1000; //Derp?
 comm_timeouts.WriteTotalTimeoutConstant = 5000; //Derp.
 SetCommTimeouts(serial_port_, &comm_timeouts);

 DCB dcb_configuration;
 ZeroMemory(&dcb_configuration, sizeof(DCB));
 dcb_configuration.DCBlength = sizeof(dcb_configuration);
 dcb_configuration.BaudRate = 1500000;
 dcb_configuration.ByteSize = 8;
 dcb_configuration.StopBits = ONESTOPBIT;
 dcb_configuration.Parity = ODDPARITY;
 if(!SetCommState(serial_port_, &dcb_configuration))

My Read

 if(!ReadFile(serial_port_, read_buffer_, 1024, &bytes_read, NULL))
  • 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-05-29T22:27:26+00:00Added an answer on May 29, 2026 at 10:27 pm

    I would suspect your serial->usb convertor to do the buffering. Since the usb is packet based, it needs to do some buffering. In rate 10Hz, there are probably big enough delays, to flush buffer after every message. But at 100Hz the messages are coming so far, that it is flushing buffer by some other logic.

    Does that make sense?

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

Sidebar

Related Questions

I have a compass application which is using orientation sensor and every time the
I have a temperature sensor, which is connected using an USB-I2C adapter ( http://www.robot-electronics.co.uk/htm/usb_i2c_tech.htm
Say for instance, I have a temperature sensor in my refrigerator which is connected
I have a background service which is running all the times and collects sensor
Dear all, I have a data frame which comes directly from a sensor. The
I have a project which uses C++/CLI to implement a GUI and some background
I have a GUI app which connects to a sensor, gathers data and processes
I have a (soft) realtime system which queries some sensor data, does some processing
Do we have temperature sensor in windows phone 7 That notes the Outside Atmospheric
The Google Places API requests have a sensor parameter? How does this parameter affect

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.