From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

VISA serial read / write to microcontroller issues.

Solved!
Go to solution

I am running Windows 10 Home 64 bit and LabVIEW 32.  I am using VISA serial  to send parameters to a microcontroller (AdaFruit Itsy Bitsy M4 Express). I have worked with  serial instruments but this is the first time I have tried to write  instrument control and I am stuck. 

I do not understand why characters I write to the port come back in the read and the device response remains in the port.  I do not understand how to send ASCII "CONTROL-D" to soft reset the hardware. I tried 0x04 with no success. The communication is ASCII based and is flawless in a terminal emulator ( PuTTY).  I want my LabVIEW re-entrant VI to work that well. A screenshot of a PuTTY session is attached.

I have read and implemented several useful posts in the forum to get as far as I am.  The zip file includes details for packet and requests during sessions with my VI and PuTTY.

 

 

Download All
0 Kudos
Message 1 of 3
(847 Views)
Solution
Accepted by topic author kierzie123

1. A Ctrl+D (End Of Transmission) is a character value of 4 (0x4).

2. Initialize your port with the VISA Configure Serial Port.  It will then default you to having the termination character turned on, which I think you want here.

3. You should not have loops inside of loops like this.  Just a single loop should handle all of this.

4. I recommend you go watch this: VIWeek 2020/Proper way to communicate over serial.  There is a link there to code that I use on a regular basis that I think will really help you out here.


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
0 Kudos
Message 2 of 3
(829 Views)

Wow! I watched the video. The techniques for ASCII will help me make the robust GUI I know is possible.

Thank you!

 

0 Kudos
Message 3 of 3
(807 Views)