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.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Open com port - need to know how to start

Solved!
Go to solution

I'm trying to collect data so I can use it for analysis, I'm not quite sure where to start. I need to open a virtual com port, and then have the program read the bytes. The packet of data is 1651 bytes long.

 

Thanks,

Andrea

0 Kudos
Message 1 of 4
(3,578 Views)

Open the Example Finder by going to Help >> Find Examples then search for Simple Serial.  The example shows how to send some data, wait, and then read some data back.  There are better designs using synchronous messages but it is a good start.

Message 2 of 4
(3,574 Views)

LabVIEW uses VISA, which stands for Virtual Instrument Software Architecture. Here's an overview of VISA.

The snippet in that article is really all you need to communicate with an instrument. There are other VIs in the palette that help you configure your port and stuff like that. Look through the VISA palette to get familiar.

 

To start the communication, I would suggest using MAX to make sure you can communicate the way you want. Then take what you do in MAX and implement it in LabVIEW.

Edit: Also, the examples are a great help as Hoovah suggested.

Cheers


--------,       Unofficial Forum Rules and Guidelines                                           ,--------

          '---   >The shortest distance between two nodes is a straight wire>   ---'


Message 3 of 4
(3,570 Views)
Solution
Accepted by topic author AndreaD
I may echoing the above two comments!
It's very easy to serial communication in labVIEW as we have available pallets.

It works simple as handling a file like (open , read,write and close)
Open and configure with com port,baud rate,parity etc...
Write with specific command before reading specific command.
Read with providing number of bytes of data you expect and close once your communication Is over.
It's always better to create a communication driver with state machine architecture with (open ,write,read,close )options where shift register is used to keep the resources reference

Check with Examples on serial communication to know basics of communication protocol
----------------------------------------------------------------------------------------------------------------
Palanivel Thiruvenkadam | பழனிவேல் திருவெங்கடம்
LabVIEW™ Champion |Certified LabVIEW™ Architect |Certified TestStand Developer

Kidlin's Law -If you can write the problem down clearly then the matter is half solved.
-----------------------------------------------------------------------------------------------------------------
Message 4 of 4
(3,540 Views)