LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Read many value at same time

Hello,
 
I communicate with many device by RS485/RS422 with a PXI-8431/8 card. Each device are frozen for a minimum of 80ms. My problem is that I want to receive data from 4 devices on the same port at same time. For example :
 
COM5, address 2, I want to receive Output : 87
COM5, address 3, I want to receive Output : 45
and so on...
 
There is no problem for one device.
I don't want to read address2 and after address3 .... because of the delay of my device, it will take 240ms ! It's too long.
I don't want to use all my port as well, so 4 devices for 1 port.
 
If you look at my vi in attached file, you will see that I have 2 query operations in parallel but it doesn't work. Have you any solutions to receive data from many address on the same COM in a parallel configuration ?
 
Many thanks
0 Kudos
Message 1 of 11
(3,536 Views)

It looks like you are trying to use a one lane road for 2 cars. The serial data can't be tagged for each unit on the same port, so you are sending both commands intermixed to both the units. The responses are likely mixed as well.

Imagine using a water tube and sending blue and red dye down it... once the colors mix in the tube, you can't tell what color your supposed to recieve at the other end. You need separate tubes... or in your case, com ports, for parallel operation.

0 Kudos
Message 2 of 11
(3,527 Views)
I cannot read the FIFO of a singular unit (with its address) without read the FIFO of the other ?
 
 
0 Kudos
Message 3 of 11
(3,520 Views)
I don't think you can do parallel reads/writes on an RS-485 connection. It's still a serial bus and can only process one command at a time.
 
It might be possible if the devices you are reading from can accept a request where multiple device are specified.
 
Maybe a command something like, "COM5, address 2-4, Output : 87,45,23,14". Then maybe they could sequentially send the data back. You'd have to look through the device command set to see if something like this is supported.
 
Ed


Ed Dickens - Certified LabVIEW Architect
Lockheed Martin Space
Using the Abort button to stop your VI is like using a tree to stop your car. It works, but there may be consequences.
0 Kudos
Message 4 of 11
(3,517 Views)
As a rule of thumb, I NEVER split off a reference to a device. You can't use one physical device in two places at once in a reliable fashion. Imagine two people talking to you about similar projects at one time... it gets all mixed up!
0 Kudos
Message 5 of 11
(3,509 Views)

I will check what Ed tells me. But I can't do something like :

Query1 (com5, address2... writing operation 1 ms)       -->    Query2 (com5, address3... writing operation 1 ms)    -->    Waiting 80ms because of my devices -->    Read1 (com5, address2.... reading operation 1ms)   --->   Read2 (com5, address3... reading operation 1ms)

I can't just specified the address on which device I want to read and then the others. Or I stuck to read all the address on the same port at same time? 

0 Kudos
Message 6 of 11
(3,505 Views)
If you send a query without waiting for a proper response, how will you know what device responded?
0 Kudos
Message 7 of 11
(3,502 Views)

I'm a newby in that kind of things, but if a specified an address for a reading operation (if it's possible) i will know what device has responded me. If I cannot do that kind of things with RS485, can I do it with an another communication type ?

Many thanks  

0 Kudos
Message 8 of 11
(3,496 Views)
GPIB. It is basically serial with instrument addresses.
0 Kudos
Message 9 of 11
(3,489 Views)


@Doyon wrote:

I'm a newby in that kind of things, but if a specified an address for a reading operation (if it's possible) i will know what device has responded me. If I cannot do that kind of things with RS485, can I do it with an another communication type ?

Many thanks



TCP and USB both support multiple connections. A lot of test equipment now has either TCP/IP and/or USB control.

Ed



Ed Dickens - Certified LabVIEW Architect
Lockheed Martin Space
Using the Abort button to stop your VI is like using a tree to stop your car. It works, but there may be consequences.
Message 10 of 11
(3,476 Views)