Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

How to obtain measurements from multiple identical instruments in parallel

Solved!
Go to solution

Hi,

 

I have 3 transducers connected in a RS-485 multi-drop network using a USB to serial converter. I would like to be able to obtain measurements from these transducers quickly (upwards of 50 Hz) and with each individual measurement having minimal time difference from the others.

 

Currently I am using the timed loop structure with a sequence inside to write a query to each instrument, and then another timed loop with a sequence inside to read the responses. This works but is terribly slow and currently only talks to two transducers.

 

I am new to labview (and these kinds of problems in general) but if anyone can offer some ideas of how to better approach this problem, I would be extremely grateful!

 

Thanks in advance.

0 Kudos
Message 1 of 6
(3,120 Views)
Solution
Accepted by topic author jm22b

Since it is the same RS-485 drop, you can only talk to 1 at a time.  So you just loop through which one you are talk with.

 

1. Timed Loops add way more overhead and other weird things that they are basically useless in Windows systems.  Just use a normal While loop and a Wait.

2. Use a FOR loop to loop through your instrument addresses to build up your commands.

3. Since you are using a Command-Response mechanism, do a write followed by a read.  This eliminates the need for the second loop.

4. To make things even easier on you, you can build up the commands before you start the communications.


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
Message 2 of 6
(3,092 Views)

Hi

Which transducer are you using and where can I find the low level vi's you use?

I have a few comments

1) the sequence frame is doing nothing, so also the acquire and release semaphore are not needed.

2) you probably need to read directly after the write of the command, so why not program them immediately after each other?

3) why do you forget to wire error out to see if an error hass happened?

4) why are you using boolean references instead of values?

 

Just a few questions, that I do not understand yet.

 

greetings from the Netherlands
Message 3 of 6
(3,079 Views)

Thank you very much for your thoughtful answer. I have implemented a small test and the improvements are vast! It is far simpler than what I had too.

 

You mention that timed loops are more trouble than they are worth on windows... Is there an OS that they work well on?

 

P.s I'm heartened to see such a helpful community for labview here; learning it has been challenging

0 Kudos
Message 4 of 6
(3,073 Views)

Hi,

 

I am using PPT2's from Honeywell.

 

1) are you referring to the external or internal sequence frames? or both? My intention with the internal sequence frames was to ensure the commands had been written before trying to write the next one.

 

re. the semaphore: this comes from an upper level vi, I think it's necessary.

 

2) This is based upon inherited code, so a lot of the design decisions were not made by me, and the person who did make them is not here for me to ask. Your suggestion seems to make more sense though, and in light of crossrulz's answer, I have tried this.

 

3) I will try to remember to use this function in the future. Still getting used to labview.

 

4) Another design decision not made by me. This one has confounded me too...

 

I appreciate you taking the time to post, but I think I have a solution to my problem. Always happy to hear extra input though!

0 Kudos
Message 5 of 6
(3,071 Views)

@jm22b wrote:

You mention that timed loops are more trouble than they are worth on windows... Is there an OS that they work well on?


A time-critical loop in a Real Time OS, such as what is on a cRIO or sbRIO.  When I say time-critical, I mean a loop that has to execute an iteration at a set rate or things can go horribly wrong, typically in an industrial control setting.

 

In FPGA, the timed loops turn into Single Cycle Timed Loops which cause all kinds of optimization in order to get everything inside to execute in a single clock cycle.


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 6 of 6
(3,065 Views)