Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Aug 10, 2012 10:59 PM by nicolasr75
Aug 09, 2012 09:27 PM|LINK
I have build a simple web application with ASP.NET web forms and jQuery which shows measurement values from hardware devices to our users. So far we have only included 15 minute averaged values which are stored in a database. There is yet no direct connection
to the devices (the database is filled by another application every hour).
Now we want to inlcude in the same application a realtime view of the devices current measurments. What we already have is a COM/OLE DLL that allows to connect to the device and deliver data with a period between 1 and 3 seconds. All devices are connectable
in the LAN of the WebServer, but only one TCP connection can be made per device!
My questions are:
1) Assuming that multiple clients want to view the realtime data at the same time: how would you connect the web application to the COM DLL? Do I need an intermediate application to handle the data requests? What technology would I use to accomplish this?
2) I read about the SignalR library which would avoid having the clients to poll the web application for data every second. Do you think it is possible to use this in the above scenario?
thanks for any idea!
Aug 09, 2012 11:09 PM|LINK
In my opinion, it would be tricky to pull data directly from COM/OLE dll in web app. You could try to reference to those dlls and build a static sealed class as "wrap" around the dll, and instantiate it in Application_Start stage. Due to the class is static
and sealed, it can be thread safe in asp.net environment. Depend on the type of dll, you may or may be successful in this option.
Another way is to pump the data into a database. As you have already got it working, you can save the data into database in the interval of your choice. And then to read the data from the database is standard. I have built an app in this architecture, and
the data is collected every second. The app is almost "real-time". Of course loading the web page takes time, so you will never see the true "real time" data anyway.
SingalR is from the browser to your web server. As long as you got the connection between your web server and the device ready, you can always use SignalR or regular ajax request to load data in a timely basis.
Hope this helps.
Aug 10, 2012 10:59 PM|LINK
Hi and thanks for your reply!
I will try to create a static class that manages the connections and see how far I get with this.