A question of architecture

N

Nicolas Noakes

Hello,

Firstly, my current experience is asp classic and vb6. The reason that
i am posting in this group is that i feel that most people hear would
(should?) have a pretty good feel for pre-NET programming, and would
therefore be able to give me the most comprehensive advice. Well, here
we go:

I am working on a project to implement a system which will provide a
web-based interface to a serial connected hardware device. Prehaps that
is enough, but i will expound a little...

We we have is a 3rd party hardware device (let's say in this case, a
building-automation product) which can accept commands to switch on and
off its outputs, and reply to requests for the status of these outputs.
Therefore, it may take a command like "SET Q1 = ON" on its serial port,
and understand this to mean that the Output Relay 1 should be on. Or it
may take a request like "GET Q1 = ?" and replay with "GET Q1 = OFF".
Other commands/requests may act upon numeric values such as a
temperature reading. Now this system is limited to a control interface
based on a PC serial connected to the controller, and we need to be able
to control the system from more than one computer at the site. What i
would like to create is a web-based interface with "buttons" showing &
able to change the status of the outputs. I would not expect more than
about 10 possible users, so we are not looking at a million-hits-a-day
site!

Now here is your chance to show your ablility...

What I need to know, is the most applicable design to achieve this end?

1) Do i create a custom webserver exe. I know vb6 is not
multi-threaded, but is it an absolute no-no to develop such a system in
vb6?

2) Do i create something in ASP? If so, how does one handle rs-232
comms in ASP

3) Is there a better way?

I'm listening...

Thanks,
Nicolas
 
N

Nick Malik [Microsoft]

Hello Nicolas,

I'm going to suggest a third option.

You have a serial device. You have only one of them, and you probably don't
want to try to share the comm channel across many processes. In other
words, you have a resource that you need to protect.

I would suggest that you create a Component in C# that you run in Component
Services. That will use P/Invoke to perform the serial communications.
http://msdn.microsoft.com/msdnmag/issues/02/10/NETSerialComm/
http://www.ondotnet.com/pub/a/dotnet/excerpt/com_dotnet_ch10/index.html?page=2#82110

There's also an excellent book on Remoting by Ingo Rammer that may help.

Then, your ASP.Net site simply calls the singleton object, asks for status
and sends commands. This allows many IIS users to use one COM+ component
that manages the access to your serial device.

--
--- Nick Malik [Microsoft]
MCSD, CFPS, Certified Scrummaster
http://blogs.msdn.com/nickmalik

Disclaimer: Opinions expressed in this forum are my own, and not
representative of my employer.
I do not answer questions on behalf of my employer. I'm just a
programmer helping programmers.
--
 
N

Nicolas Noakes

Hello Nick,

Thanks for the suggestion, I was wondering along those lines.

As mentioned in my original post, I am not yet "up to speed" with .net -
Would you say your suggestion is practicle in ASP classic with a VB6
component? Or is .net going to really be worthwhile?

Thanks,
Nicolas
 
N

Nick Malik [Microsoft]

of course you can do this in VB6 as well. VB6 has a comm OCX you can use,
which is helpful. VB6 may not have the same performance numbers, but you
don't need a highly scalable application. On the other hand, .Net is a
consistent, clean, Object Oriented framework with two excellent OO languages
sitting on top. Why NOT do it in .Net? Especially if you need to support
and maintain this code for a few more years. It's going to become
increasingly difficult to find VB6 developers of the next few years, and
that will make it harder and harder for you to keep your app up to date.

Ultimately, its your call. .Net would be my choice.

--
--- Nick Malik [Microsoft]
MCSD, CFPS, Certified Scrummaster
http://blogs.msdn.com/nickmalik

Disclaimer: Opinions expressed in this forum are my own, and not
representative of my employer.
I do not answer questions on behalf of my employer. I'm just a
programmer helping programmers.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top