[Mono-list] gpib + mono

Jonathan Pryor jonpryor at vt.edu
Fri Jul 14 05:17:19 EDT 2006

On Thu, 2006-07-13 at 23:39 -0700, gnuplot post wrote:
> I do not know where to start.  Basically, the question is very simple.
> I would like to talk to the GPIB based lab equipment via C#. In other
> words, I would like to run lab equipment through mono.
> I've installed mono framework and open source gpib kernel driver
> (http://sourceforge.net/project/showfiles.php?group_id=42378)  on
> CentOS 4.3. It seems to me that both packages work reasonably well. I
> can talk to GPIB instruments via C|C++|PERL|sh|tcsh.
> But, I do not know how (and where) to start to talk to the GPIB
> instruments via C# (aka mono framework).

How do you talk to the GPIB instruments in C, etc.?  Do you need to open
a /dev device and talk some binary protocol?  Or is there a define C API
that you need to use?  Use a serial port?

If a /dev device, you can probably create a System.IO.FileStream
instance for the specified file, and read/write the binary data as

If a C API, you can use DllImport declarations to import the C API into
C#; see http://www.mono-project.com/dllimport.

If a serial port is used, use `gmcs' to compile (to target the .NET 2.0
runtime) and use the System.IO.Ports.SerialPort type.

 - Jon

More information about the Mono-list mailing list