LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Serial Communication between Labview 2020 and Arduino ISSUE

In essence,

I'm simply trying to send a command to arduino, and readback any response there may be over the USB port via serial comms.
My code is practically working except for one thing. I need to have a read visa with atleast 1000millisecond timeout before trying to write in order for it to work. Which is annoying because I'm literally only sending an on or off command and it's having to wait one second everytime.

 

I'm happy to provide further details, would anyone be able to help me out who's a bit more experienced in serial comms.

Many thanks.

0 Kudos
Message 1 of 5
(664 Views)

Hi Tyler,

 

after all its just a TimeOut value, so what's wrong with 1000ms?

 

How fast does your Arduino actually answer to the command? You want to read an answer of 64 bytes…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 5
(647 Views)

Most serial communication issues can be solved by watching this video: VIWeek 2020/Proper way to communicate over serial

 

Also we don't know what is going on inside your Arduino. I am guessing you wrote the Arduino code? Granted this is not an Arduino board but posting your Arduino code might help.

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 3 of 5
(633 Views)

Can you confirm that what you want to happen is properly working in a serial terminal program communicating with the arduino over USB? This is without any LabVIEW.

 

Once that works with the timing you need then start using LabVIEW.

0 Kudos
Message 4 of 5
(621 Views)

So I solved the issue.
Basically when you configure the connection using the function in the Serial palette, it takes about 900ms to open the connection. Ofcourse, I was opening and closing the connection every time I wanted to send something. Instead I've opened the connection once have a while loop to handle user events, luckily this is sufficient for my project and I won't need to talk to the arduino from more than one device, but I can see how this would get annoying for other scenarios. Thank's for all the questions anyway. 🙂

0 Kudos
Message 5 of 5
(537 Views)