Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Oceanographic instrument interfacing using RS232 serial communication

Hi,

 

I am trying for a while now to develop a control interface to collect data from a range of oceanographic instruments (Seabird SBE45, Wetlabs FLNTU and others).

The interface works well, I can collect data from the instruments, can do some QA/QC, a bit of calculation.... BUT I get drop out.

Pretty much I loose data at random.

 

I have simplified the VI to only include a VISA read and write to file on two of my instruments to test if their was some kind of timing issue..... but same problem.

I have attached this simple VI (SPOT1.vi) and a capture of the VI (SPOT1_VI.PNG) to the post.

I also ZIP up the output file of each instrument for reference (FLNTU_LABVIEW.lvm and SBE45_LABVIEW.lvm).

You can see on the SBE45 file that everything is fine until line 37010 and line 456 for the FLNTU.

I should add that the instruments are working at 1Hz so spitting data every second.

 

I have done some data acquisition using the same instruments and HYPERTERMINAL (one hyperterminal per instruments) and did NOT have ANY problem at all........!!!!!!!!

I saved the output file, zip them and attached them as well (FLNTU_HYPERTERMINAL.TXT, SBE_HYPERTERMINAL.TXT)

 

So I guess my question is what am I doing wrong?????

Is there anything I am missing?

 

Thanks a lot for your help.

Looking forward for you replies/suggestions.

 

Guillaume (a little bit on the edge..................)

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

Hi Cguigui:

 

Please check out the following KB  that explains how to properly set multiple serial devices, make the necessary modifications in your code, and let us know if you are still having the same error. I can see that you have sevaral coercion dots in your VIs, try to avoid that, instead of using a numeric constant, right clic in the inlet of the VI and clic in Create constant, it will create an ENUM, which is better for the code and make the code more readable.

 

Diego

 

Certified-LabVIEW-Associate-Dev_rgb.jpg

 

 

0 Kudos
Message 2 of 4
(3,359 Views)

Hi Diego,

 

Sorry about the delay............ Juggling between the arrival of my daughter and Xmas break.....

Thanks for your answer, I have remove the coercion points... and still get few errors.

It appears that the instruments are sometime not output exactly at one hertz and therefore I loose a bit of data in my time loop.

 

Is there a way I can just set-up labview to listen to the serial port continuously and feed the data to a subVI for processing?

 

Cheers,

 

Guillaume

0 Kudos
Message 3 of 4
(3,301 Views)

I would suggest that you read each serial port / instrument at least in an individual  independed loop. All data you get is async at they will drift appart anyway.

Each device has is own timing, so after one hour/day the number of received message blocks will differ, so think about how you want to handle this slow missmatch.

I assuming that each instrument is read once a second a +-1 sec mismatch doesn't hurt.

 

 

Take the producer consumer architekture as a starting point, but run more producer loops . In the queue put source, timestamp and  data, your consumer loop take the data and update a most recend data set of all values.This set you log at a rate you like to a file. extra missing data information can be added 😉

 

Big benefit: If one source hangs the rest will still send+log data.

 

 

 

Greetings from Germany
Henrik

LV since v3.1

“ground” is a convenient fantasy

'˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'


0 Kudos
Message 4 of 4
(3,274 Views)