LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Serial not working in LabView 2019 but works in NI Max

Solved!
Go to solution

I have used the LabView serial (VISA) many times over the years and recently setup a new system and now the serial communication to my assembly is not working in my code, but does work in TeraTerm and NI Max Query just as expected.   I am stuck.   Tried different options with end characters, etc..    Could there be an incompatibility between my VISA drivers and LabView 2019?   

 

Attached screen shots of the VI and the two working setups.

 

 

0 Kudos
Message 1 of 7
(347 Views)

DO NOT USE THE BYTES AT PORT!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! (still not enough emphasis)

 

Get rid of the Bytes At Port and the time delay immediately after it and just tell the VISA Read to read more bytes than you ever expect in a message.  This will allow the Termination Character to tell the VISA Read when to stop.

 

For more details, watch this video: VIWeek 2020/Proper way to communicate over serial


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 2 of 7
(334 Views)

I have actually tried it with and without bytes at port in my VI.   I did increase the expected bytes well above what it should be looking for and have the same result.  No data.

 

Tried it with out the Open Port VI as well.    

0 Kudos
Message 3 of 7
(331 Views)

This is what I have currently and does not give any reply.   Will work on making sure commands are getting where they need to go, but since works in TeraTerm and NI Max I have to assume the wiring is correct.   Going to try a different version of Labview in case 2019 is the issue.

 

 

0 Kudos
Message 4 of 7
(286 Views)

What device are you actually trying to talk with?

 

Considering MAX is working, here are the comments on the last image you posted:

1. Remove the VISA Open.  I believe that is overwriting the settings you set with the VISA Configure Serial Port.

2. Delete the constants for Data Bits and Flow Control.  The defaults for these are what you need.

3. Enable the Termination Character.

4. Your attempt for a Carriage Return constant is wrong.  You should first right-click on it and enable the View->Display Style.  Make sure the display style is now in "\ Codes".  I doubt you did that.  And you also used the wrong slash.

5. Make sure you are handling your error in some way other than just blindly clearing it.  Even a simple indicator would help.  There may be an error hiding that you won't know about unless you at least display that error.


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 5 of 7
(277 Views)

Connecting to a micro controlled PCBA I am testing.

 

Thanks for the ideas,

 

 

0 Kudos
Message 6 of 7
(272 Views)
Solution
Accepted by topic author ljark

Got it working appears to have been the switch at the end causing the issue.    thanks for the suggestions.

0 Kudos
Message 7 of 7
(233 Views)