08-05-2024 01:37 PM
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.
Solved! Go to Solution.
08-05-2024 02:35 PM
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
08-05-2024 02:40 PM
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.
08-07-2024 10:04 AM
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.
08-07-2024 10:39 AM
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.
08-07-2024 10:58 AM
Connecting to a micro controlled PCBA I am testing.
Thanks for the ideas,
08-13-2024 08:40 AM
Got it working appears to have been the switch at the end causing the issue. thanks for the suggestions.