From: Olson, T. C. <to...@an...> - 2013-06-25 22:14:24
|
Hi Gabriele, Thanks for the quick response. I have some ideas for keeping CSStudio synchronized with the database. My biggest concern atm is how I might implement them in CSStudio (I have very little experience with RCP applicaiton development). AFAIK there isn't a way to accomplish this in MySQL. However, PostgreSQL supports LISTEN/NOTIFY events for any client connected to it. Assuming I can configure CSStudio to listen (which it kind of already does with Epics), I should be able to setup PostgreSQL to notify it whenever a PV changes. That should allow CSStudio to update the GUI like it currently does with Epics. Another idea I've been playing around with is using Redis. For the simulator I'm working on we can make do with some latency (i.e. the time it takes for SQL to read/write to disc). However, it would be interesting to see how close to real-time we could get using an in-memory database like Redis. Similar to PostgreSQL, Redis supports publish/subscribe notifications. If I could get CSStudio to store PV's' in Redis, that would actually open up a lot of possibilities for our project. It would be relatively simple to configure Redis so that every time the PV value is changed, the old value is written to a traditional SQL database. Basically, Redis would store the current value of each PV (similar to what Epics currently does), and the SQL database would act as an archive of how the values changed overtime. Perhaps I'm overlooking something, but from what I've seen of CSStudio this seems feasible. Any thoughts? Thanks, Tom ________________________________________ From: Carcassi, Gabriele [car...@bn...] Sent: Tuesday, June 25, 2013 4:35 PM To: Olson, Thomas C.; cs-...@li... Subject: RE: Connect CSStudio to SQL Database? Hi Tom, If you are looking for: * I write something in the database * my CSStudio GUI updates I think you are going to have some issues. Databases typically don't provide you notification when data changes. Oracle may have something. MySQL/Postegres I doubt (though I could be wrong). So you need to implement that. The schema you create would have to have that in mind. The polling have to be smartly done... And at the end, you may find that it would have taken less time to have a softIoc and populate that... I am working on a mechanism to have local pvs populated by a database, using service (i.e. publish/subscribe). You push a button, and some pvs now hold the result of the query. This is good for some applications, mainly integrating different sources of external data, not to replace epics. And one has to push the button to get new data. Hope this helps! Gabriele -----Original Message----- From: Olson, Thomas C. [mailto:to...@an...] Sent: Tuesday, June 25, 2013 5:12 PM To: cs-...@li... Subject: [Cs-studio-core] Connect CSStudio to SQL Database? Hello, I'm currently working on a simulator for power plant diagnostics at Argonne. Due to time constraints, we're using Control System Studio for our simulator's GUI (primarily because the widgets are already designed and implemented for us). Since we're not using CSStudio for an actual control system, we don't see any reason to use Epics for storing our simulator data. We were hoping to use something like MySQL/PostgreSQL (or any database other than Epics) to store our process variables. After looking over the CSStudio documentation, it looks like it's possible to connect a relational database to certain tools in CSStudio (archiver, alarm system, etc). Unfortunately, I can't find any documentation for replacing Epics with a database of our choosing. The ReadMe files in the CSStudio source code hint at this being possible. Apparently I can create my own plugin to implement the IPVFactory interface. Has anyone implemented something like this before in CSStudio? If not, is there any documentation on how I might accomplish this? Thanks, Tom Olson ------------------------------------------------------------------------------ This SF.net email is sponsored by Windows: Build for Windows Store. http://p.sf.net/sfu/windows-dev2dev _______________________________________________ Cs-studio-core mailing list Cs-...@li... https://lists.sourceforge.net/lists/listinfo/cs-studio-core |