LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

What is the fastest way of communicating from PC to a Controller using LabVIEW?

Solved!
Go to solution

@crossrulz wrote:

@harshitshah wrote:
Currently, issue I face is usage of mirco-controller DIO to connect to PC. My PC does not have a built in LPT port. If UART can still be used with that time limits, I would prefer that as PC already has 1 Serial port on board.

Then go with the serial port.  But do be warned that many micro-controllers use TTL UART (UART waveforms using 5V logic) while PCs tend to be RS-232 (-12V to +12V for high and low).  You will damage your micro-controller if this is the case.  So you may need a converter module/chip.


Hi

 

Will, using a converter in between, affect my timing constraints by a huge factor? How can I verify that?

 

Regards

Harshit

0 Kudos
Message 11 of 15
(394 Views)

A very fast search on a converter showed me either 115kbit/sec or 930kbit/sec capability, so in the later case the delay must be less than one microsecond else it cannot keep up.

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 12 of 15
(389 Views)
Solution
Accepted by topic author harshitshah

Hi Harshit,

 

i get updated results every 250 msec … Is there any other timing constraint you are talking about?

So you got a message/sample each 250ms, which is just 4Hz - really slooow…

I was asking for constraints like "how fast do you need to transfer data to your controller?", "how much jitter do you allow?", how many data bytes do you need to transfer?" and similar…

 

Will, using a converter in between, affect my timing constraints by a huge factor? How can I verify that?

Again: define "huge"! Are you talking about 1ms or about 1000ms?

 

If UART can still be used with that time limits, I would prefer that as PC already has 1 Serial port on board.

At 9600baud you can transfer ~240bytes per 250ms or ~10bytes in 10ms. Is this fast enough for the amount of data you want to send?

At 115200baud you can transfer  ~115bytes in 10ms: is this enough/fast enough?

Again: what are your timing constraints?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 13 of 15
(382 Views)

@harshitshah wrote:

Will, using a converter in between, affect my timing constraints by a huge factor? How can I verify that?


No.  Those converters just go through a few transistors.  It will just add ns to your latency.  Not enough to worry about, especially since we are talking about messages every 250ms.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 14 of 15
(378 Views)

@GerdW wrote:

Hi Harshit,

 

i get updated results every 250 msec … Is there any other timing constraint you are talking about?

So you got a message/sample each 250ms, which is just 4Hz - really slooow…

I was asking for constraints like "how fast do you need to transfer data to your controller?", "how much jitter do you allow?", how many data bytes do you need to transfer?" and similar…

Like I mentioned, new data will be provided by PC every 250 msec. So I guess the transfer time and data processing time at the controller end should not exceed 250 msec. Also, I have 8 boolean data to send, meaning just 1 byte of data is required.

 

 

Will, using a converter in between, affect my timing constraints by a huge factor? How can I verify that?

Again: define "huge"! Are you talking about 1ms or about 1000ms? 

By huge, I meant the converter interfering and causing me to change the frequency of data updates which is currently at every 250 msec.

 

If UART can still be used with that time limits, I would prefer that as PC already has 1 Serial port on board.

At 9600baud you can transfer ~240bytes per 250ms or ~10bytes in 10ms. Is this fast enough for the amount of data you want to send?

At 115200baud you can transfer  ~115bytes in 10ms: is this enough/fast enough?

Again: what are your timing constraints?

Based on your explanation, I guess port with any baud rate above 9600 should be sufficient for getting my data through.

 

I hope I have provided the info you are looking for.


0 Kudos
Message 15 of 15
(361 Views)