LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

modbus library for serial comm.

Solved!
Go to solution

I downloaded 8.2 version of labview libray and tried to use serial port to test master/slave example provided...

For some reason null modem solution doesn't work for me (I tested communication succesfully using RS-232 example)

P.S. I do get timeout on reading...

 

Any comments will be appreciated

 

Greetings,

 

jack

0 Kudos
Message 1 of 16
(4,686 Views)

See here for some modbus cable pinouts. But it really depends on the devices your are connecting. Most can be done with pins 2,3,5 on 9 pin connectors. Maybe some jumpers on each end. Usually you do not need more than three wires end to end.

http://www.control.com/1026148199/index_html

Message Edited by unclebump on 11-03-2008 05:07 PM
0 Kudos
Message 2 of 16
(4,682 Views)
I connected pins 2 & 3 on the same COM port...it isn't enough?
0 Kudos
Message 3 of 16
(4,670 Views)

For RS-232, you will need at least 3 wires.  Pins 2 and 3 (one is receive the other transmit) and pin 5 (ground).  In a null modem cable, pins 2 and 3 are crossed between the two ends.  In a straight through cable, pins 2 and 3 are wired straight through.  (Pin 5 is straight through in either cable).

 

Other pins handle handshaking lines.  Whether you need them or not depends on the device you are communicating with.

 

Check the manual on the device you are trying to communicate with to see whether you need a null modem or straight through cable.

0 Kudos
Message 4 of 16
(4,663 Views)

If it is on the same com port, you want a loopback connector.

 

See this page for loopback section.

http://www.lammertbies.nl/comm/cable/RS-232.html

0 Kudos
Message 5 of 16
(4,656 Views)
Did somebody actually use the MB serial examples succesfully on single COM port using connection of pins 2 and 3?
0 Kudos
Message 6 of 16
(4,592 Views)
I've never tried it myself.
0 Kudos
Message 7 of 16
(4,587 Views)

I am really unclear on what you are trying to do.

 

Are you trying to have the same PC run the master and slave example at the same time, and do it by using a loopback adapter on a single com port?

 

If so, why?  That doesn't make any sense.

 

The master example and the slave daemon both are reading and writing to the com port.  If you have them both reading and writing to the same serial port, then the reads and writes are going to step all over each other between the two sets of VI's.

 

Please describe your setup in detail.  How many PC's?  How many serial ports on each PC?  What VI's on each PC?  What kind of cable to connect them?

Message 8 of 16
(4,586 Views)

Right, this is what I wanted to hear (that one can't use same port).

I will be able to continue from here...

 

thanks

0 Kudos
Message 9 of 16
(4,580 Views)

I am still not out of the woods yet (can't make example "work" on my 2 PC's).

By the way, since I am controlling when writes/reads happen the examples should work on ONE COM port as well (of one machine).

First 1 write (let's say on master), then I read on slave...

What's wrong with this picture?

 

jd

0 Kudos
Message 10 of 16
(4,567 Views)