locked
Realtime view of hardware devices RRS feed

  • Question

  • User1549527782 posted

    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

    Thursday, August 9, 2012 5:27 PM

Answers

  • User365699807 posted

    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.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, August 9, 2012 7:09 PM

All replies

  • User365699807 posted

    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.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, August 9, 2012 7:09 PM
  • User1549527782 posted

    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

    Friday, August 10, 2012 6:59 PM