Hi All

I'm about to attempt to write a library for communicating with a precision pressure transducer (PPT). The PPT communicates through serial port, with a relatively simple protocol.

I have never written a .dll library before that has been used with another language. So I was wondering, is it possible to write a library that communicates with serial port without having an instance of the serial port connection inside the library? With the goal of being able to use the .dll with different languages. Or is it okay to include references to the .net serial libraries and have an instance used for communicating with the device?

The library is likely to be used in C# and Delphi.

Also, I've been reading about design patterns, and was wondering if anyone could recommend a pattern that could be used for designing sensor / device communication libraries. Ideally whatever architecture I use for this project, it would be good if it can be re-used for another type of sensor.

Cheers guys

Cameron

Library extensions written in C# are good when the programs using them will be written in VB, C#, or C++.net. I don't think it would go well if you tried to use it will Delphi as C# libraries are managed code compiled to an IL that requires a virtual run time to watch its execution.

If you intend on an entirely C# solution its no problem just remember that a Library extension is just a program without an entry point. It can't run by itself but can contain any code that could be in another program. Don't treat it any different.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.