LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Interrogation MODBUS Devices

I have a two clones of one VI. And two devices connected to one port. Please explane to me, how I shell to do this correctly?

Devices.png

0 Kudos
Message 1 of 8
(3,549 Views)

Where does Modbus fit into your question?  Your pictures don't show any modbus communication, just simple 8 byte VISA reads.

 

What do you mean by "shell to do this"?

 

Give a more complete description of what you are trying to do.

0 Kudos
Message 2 of 8
(3,534 Views)

I have two devices connected to one com port (RS-232). I send a request to one of them and wait answer. This VI work with one device. And if I connect more to one port VI runs a more times and make the clone. They will open and configure port,  one more time, send requests and will wait answer via one port from a few devices. How will I write the block diagram to do this case? Thank you.

0 Kudos
Message 3 of 8
(3,516 Views)

@0Forest0 wrote:

I have two devices connected to one com port (RS-232). I send a request to one of them and wait answer. This VI work with one device. And if I connect more to one port VI runs a more times and make the clone. They will open and configure port,  one more time, send requests and will wait answer via one port from a few devices. How will I write the block diagram to do this case? Thank you.


As much as I know, RS232 interface only supports a single device communication. So you cannot connect two devices to a single RS232 port. Use two RS232 connectors, so two different COM ports.

0 Kudos
Message 4 of 8
(3,512 Views)

@Blokk wrote:


As much as I know, RS232 interface only supports a single device communication. So you cannot connect two devices to a single RS232 port. Use two RS232 connectors, so two different COM ports.


I agree with Blokk.

 

In general though you would handle having multiple serial Modbus devices by setting or reading the Unit ID/Address.

Matt J | National Instruments | CLA
0 Kudos
Message 5 of 8
(3,497 Views)

@Jacobson-ni wrote:

@Blokk wrote:


As much as I know, RS232 interface only supports a single device communication. So you cannot connect two devices to a single RS232 port. Use two RS232 connectors, so two different COM ports.


I agree with Blokk.

 

In general though you would handle having multiple serial Modbus devices by setting or reading the Unit ID/Address.


I imagine the OP could use a single RS485 interface at the PC side, but it depends on what these modbus devices support. The OP could get more help, if he specified the exact model he tries to communicate with. RTFM! 🙂

0 Kudos
Message 6 of 8
(3,485 Views)

I did try to connect two devices via rs-232. Blokk was right, it didn't work. Then I did try do this via rs-485(2 wire), and it's did work. But only through request(id1)-answer(id1)-request(id2)-answer(id2) order. And this is slowing exchange.

0 Kudos
Message 7 of 8
(3,464 Views)

That's the way half duplex communication works!

 

If you want it to talk to both devices simultaneously, then you need two RS-232 ports, or two RS-485 ports.

0 Kudos
Message 8 of 8
(3,461 Views)