LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to send data in 2 msec over serial port

Solved!
Go to solution

i want to send some bytes over serial port in every two milisec. 

0 Kudos
Message 1 of 6
(941 Views)

Show us what you have.  We are here to HELP.  (Not "do".)

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 2 of 6
(914 Views)
Solution
Accepted by topic author yogesh1721
  • How many are "some bytes"?
  • What is the speed of the port?
  • How much jitter is allowed?
  • How long is a milisec (is that the same as milliseconds (ms)?)
  • Is this on windows or on a realtime system?
  • How are the bytes generated?
  • What is receiving these bytes?
  • What have you tried and how close did you get to the requirements?
  • Show us some code.
  • etc.
0 Kudos
Message 3 of 6
(891 Views)

i need to send one frame of data which of 20bytes.and i have to send those bytes in every 2msec over serial port with a board rate of 9600.

0 Kudos
Message 4 of 6
(820 Views)

Let's do some math!🤔

 

9600 baud is 9600 bits per second.  Depending on data bits and parity, it is roughly 10 bits to send a byte of data.

 

So 9600 baud really means approximately 960 bytes per second.  To simplify, we'll just round up to 1000 bytes per second.

 

To send 20 bytes, it will take 20 milliseconds.  (20 bytes divided by 1000 bytes per second.)

 

So how do you expect to send 20 bytes in only 2 milliseconds?  You'll only get 2 bytes through!

 

You need a baud rate that is at least 10 times faster, and more to have a chance.  No way with 9600 baud.  Try 115,200 baud.

 

 

0 Kudos
Message 5 of 6
(810 Views)

Did you do the math?

 

20 bytes every 2ms is 10000 bytes per second (or 80000 bits/s + overhead). How are you trying to squeeze that into a pipe with a capacity of 9600 bits per second???? (I assume you mean Baud rate, Not even sure what a "board rate" would be) You are trying to use a tricycle as a freight train. 😮

 

 

(EDIT: looks like Ravens wrote more and in shorter time. Same story though. I am getting too slow!)

Message 6 of 6
(809 Views)