LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

LabVIEW unable to detect COM Ports.

Hey,

I am trying to read the data coming from the Arduino connect in my laptop USB com ports.

I have written the code for reading and writing the data from the COM ports in LabVIEW but LabVIEW is not detecting any COM ports, just only refresh is available while selecting the COM ports. Kindly please help I have attached screenshots of the front panel which shows no COM is seen only the "refresh" option after refreshing still no COM ports are displayed. I have attached a screen snip from the device manager where it shows Arduino is connected to the COM(6) port. Kindly please help me.Capture2.PNGCapture3.PNGCapture4.PNG

0 Kudos
Message 1 of 6
(1,758 Views)

Hi Larry,

 

what is shown in MAX about the COM ports?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 6
(1,753 Views)

Those Serial Configure VI's belong outside the while loop.

And Bytes at Port is the wrong thing to use about 99.9% of the time.

0 Kudos
Message 3 of 6
(1,698 Views)

Not much more to add, really.  For your immediate issue, we really need to see what software you have installed (LabVIEW and VISA versions specifically).  Then there is also the question if the serial ports show up in MAX (they definitely won't if you don't have VISA installed).

 

But there are some major issues with your code.  First is that initialization of your ports need to be outside of your loop.  Secondly, you typically have a termination character when using an Arduino (using the PrintLn command).  So do not use the Bytes At Port to tell the VISA Read how much data to read.  Instead, just set the number of bytes to a large value and the read will grab 1 line at a time (stops reading when the termination character is read, default being the Line Feed).  I suggest watching this: 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
0 Kudos
Message 4 of 6
(1,685 Views)

@StookeyKinder wrote:

This issue is usually caused by an improper or no installation of the NI-VISA driver. Without NI-VISA, MAX is unable to access or create serial, GPIB-VXI, or TCIP/IP interfaces. Make sure you have the latest compatible version of the full NI-VISA driver installed.

TargetPayandBenefits


 Y'all need to pay attention!

"Refresh" is there.  NI VISA and Configuration support are installed and compatible with the LabVIEW version.  

 

So, can somebody kindly post up some screenshots about I/O resouse Filtering from the I/O Container right-click options.  


"Should be" isn't "Is" -Jay
0 Kudos
Message 5 of 6
(1,650 Views)

Given that you are showing only a single COM port on your system, should you really be establishing two different VISA sessions, one for read and one for write. If the intent is for those to both be COM6, it will not work. You should use a single VISA resource for both your read and your write. the other thiing is if you are intending to read a response after you have sent a command to the Arduino, this code will not work. You need to use data flow to control your execution so that th ewrite happens before the read. As written, you really don't know which operation will happen first.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 6 of 6
(1,642 Views)