LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

PC to PC RS-232 communications

Hello, I’m a novice LabVIEW user with LabVIEW 2012 full professional. I would like to communicate between two PC's using the RS-232 com1 ports. I will need one PC to be a controller and the 2nd to be a data recorder gathering data sent to it from the controlling PC. Once the data gathering PC digested the data, it will send a command to the controlling PC that it is ready to move on. Is this possible with LabVIEW?  Can anyone point me in the right direction for information and or VI examples? I cannot use the Ethernet method as there will not be any access to servers at the test location.

Thanks

0 Kudos
Message 1 of 9
(3,187 Views)

Yes.  You can use RS-232.  You will need a null modem cable.  Look at examples for Serial ports within LabVIEW's example finder.  You will just need to rework the examples so that you have one on each PC that can handle the command/response structure that you want to create.

 

Just because you don't have a server, you can still connect two PC's with an ethernet cable.  Use a cross-over ethernet cable.  Set the IP settings on the network card on each PC to be a private network such as 192.1.1.10 and 192.1.1.11.  Then you can use TCP/IP examples to send data.  Or even used shared variables.  You will have effectively set up a mini-network of 2 PC's without needing a server.

0 Kudos
Message 2 of 9
(3,182 Views)

@SMGTEM wrote:

Hello, I’m a novice LabVIEW user with LabVIEW 2012 full professional. I would like to communicate between two PC's using the RS-232 com1 ports. I will need one PC to be a controller and the 2nd to be a data recorder gathering data sent to it from the controlling PC. Once the data gathering PC digested the data, it will send a command to the controlling PC that it is ready to move on. Is this possible with LabVIEW?  Can anyone point me in the right direction for information and or VI examples? I cannot use the Ethernet method as there will not be any access to servers at the test location.

Thanks


Who said anything about servers?  All you need is a hub, switch, or crossover ethernet cable.

 

I have to ask about bandwidth and amount of data you want to move.  RS-232 is not very fast at all.  But it is simple.

 

Look in the LabVIEW Example Finder (in the help menu) for "Serial Read Write".  There should be a few examples of how to communicate over the serial bus using VISA.


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 3 of 9
(3,181 Views)
Of course its possible but so is Ethermet. There is no need for ' servers'. I'm not even sure what you mean by that. All that you need is a cross-over cable. The TCP/IP examples will work on any 2 pcs.

If you really want to do it the hard way, the TCP/IP examples would be a good place to start. You would be basically replacing the TCP/IP writes and reads with VISA writes and reads. Instead of an Ethermet cross-over cable, you use an RS-232 cross-over cable, otherwise called a null modem cable.
0 Kudos
Message 4 of 9
(3,179 Views)

Thank you all for your responses. As I said, I am a novice and I thought a server was needed as a go between the two PC's. The reason I need RS-232 communication is that is what the testing lab service I am using requested for their controlling PC to send data to my supporting data recording PC. When I return to work I will do some more example searches under serial communications.

 

Thanks Again

0 Kudos
Message 5 of 9
(3,158 Views)

@SMGTEM wrote:

Thank you all for your responses. As I said, I am a novice and I thought a server was needed as a go between the two PC's. The reason I need RS-232 communication is that is what the testing lab service I am using requested for their controlling PC to send data to my supporting data recording PC. When I return to work I will do some more example searches under serial communications.

 

Thanks Again


The unwritten question is: who tasked this poor soul with doing something that is so totally outside his area of expertise?  😞

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 6 of 9
(3,130 Views)

@SMGTEM wrote:

Thank you all for your responses. As I said, I am a novice and I thought a server was needed as a go between the two PC's. The reason I need RS-232 communication is that is what the testing lab service I am using requested for their controlling PC to send data to my supporting data recording PC. When I return to work I will do some more example searches under serial communications.

 

Thanks Again


I understand them requesting the RS-232.  But if you are moving any decent amount of data, you really should push back to use Ethernet.


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 7 of 9
(3,125 Views)

The advantage of ethernet is that some of the low level stuff is already handled in the TCP/IP protocol.  With RS-232, it is not.  Suppose you send a message and the other PC doesn't get it,  TCP/IP will have an automatic retry, whereas RS-232 won't.

0 Kudos
Message 8 of 9
(3,113 Views)

 


 

billko wrote:

The unwritten question is: who tasked this poor soul with doing something that is so totally outside his area of expertise?  :smileysad:

Bill
(Lowly minion.)

     I have done some measurement automation with LabVIEW but it has all been with GPIB and instrument drivers so PC to PC with RS-232 serial was new to me.

     I did find an example for port to port serial on the same PC to check port operation and I think I can modify it for my needs. There is not a lot of data being sent here, it is mostly a time stamp, frequency and amplitude measurements.

 

     I will learn what I have to and do what is required of me to stay gainfully employed.Smiley Wink

Thanks

Message 9 of 9
(3,100 Views)