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?
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.
Apply technology in business.
Marked as answer by nicolasr75 on Aug 10, 2012 10:59 PM
nicolasr75
Member
1 Points
8 Posts
Realtime view of hardware devices
Aug 09, 2012 09:27 PM|LINK
Hi all,
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!
Nicolas
HenryLiang
Member
284 Points
45 Posts
Re: Realtime view of hardware devices
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.
nicolasr75
Member
1 Points
8 Posts
Re: Realtime view of hardware devices
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.
Nick