Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

How to easily read multiple signals from multiple modules on one serial port

I am communicating with four CB-7018s via one serial port (with one module outputting temperatures and flow rate data).
 
First, I was wondering if there was a shorter, easier way to continuously read temps from the four modules than by just copying and pasting the Basic Write and Read VI into a flat sequence structure inside a loop. (aka: do I have to configure, read, write, close every time I want to read temperatures from a different module?) (see attached)
 
Second, since I have to read two different types of data from one module, I was wondering if there was a more efficient way of doing so than what I have in my VI already (see attached).  Also, when running the program as is, I sometimes get short, inaccurate changes in temperatures from module #4 (the module collecting two different data types).  Is this because there's not a long enough delay inbetween telling the module what type of data to read?
 
Any help/suggestions would be greatly appreciated!
 
Thank you!
0 Kudos
Message 1 of 4
(3,504 Views)
Anyone??
0 Kudos
Message 2 of 4
(3,471 Views)
Hi UMN CEMS,
 
First of all it seems that your resource settings are exactly the same for each module.  Therefore you can just configure the serial connection settings in the first sequence and simply pass the resource line to the next frames.  Also get rid of the Close VI resource blocks at the end of each frame except the last one that does that.  That ought to save you some execution time.  Also since you will be connecting the resource and error lines to each VI, that will inherently enforce the dataflow and therefore you won't need the sequence structure at all.
 
In general if you want to get continuous measurements from an instrument with the same settings, you only want to initialize once and configure once and then do only the read measurement part in a loop.
 
Let us know if you have any more questions.
Regards,
Berk
Instrument Drivers / IVI
0 Kudos
Message 3 of 4
(3,468 Views)

Thanks for your suggestions, Berk!  They make a lot of sense. Smiley Happy

However, I'm still wondering if I have the correct sequence when I write to the 4th module to tell it to read mA instead of temps.  Logically, here's what I'm thinking:

  The 4th module starts out reading type T tcs  -->  write to it to tell it to now read mA  -->  write to it again to tell it to read the mA  signals from each channel  -->  read the channels and display the correct reading on the front panel (flow rate)  -->  write to the 4th module to tell it to read type T tcs again  -->  close the configuration so that the loop can start over   ???

(Again, I have attached an updated version of my VI.)

When I run the program as is, though, there's a period of time when the temperature outputs from the 4th module (TCs 25-27) read negative numbers, and the flow rate displays 20mA when it should be reading ~3mA (see attached spreadsheet for an example).  Any ideas as to why this is?

Thanks again!

Download All
0 Kudos
Message 4 of 4
(3,442 Views)