This is the first part of the series where we address problems users occur with LabVIEW real-time module.
If the instability of Windows appears to be a concern, we recommend a fault tolerant design that could handle the Windows platform going down occasionally.
Here’s what we’re talking about
1) DB Server
2) DB Writer
3) RT Data collection
1) DB Server of your choice. Preferably SQL based.
2) Responsible for pulling readings from RT and writing to DB. The buffer between two systems. More on this below.
3)RT Data Collection and short term storage. More below.
The DB writer acts as a buffer between the short term storage on the RT platform and the server. The data collected from the RT system will be coming in at a steady rate. The updates going to the DB should be viewed as being asynchronous.
Break RT app into two parts, Time Critical (TC) and other. The TC loop reads data and queues to the other loop. The other loop should read the queued data and write to LV2 style globals. These LV2 globals should maintain an array of the data. If the array exceeds some predetermined level, newest data goes to buffer file. This journaling to file will allow the Windows based DB writer to fall behind, re-boot etc.
Meanwhile, on the Windows platform...
DB Writer could periodically use a call by reference node to execute a read operation to the LV2 global written by the "other loop" on the RT platform. Read data is then used to write DB using SQL Toolkit or whatever.
The data collection rate will determine the amount of local disk storage you will need on the RT platform to handle buffering backlogs while the Windows app is down. The size of the cached array in LV2 global should be large enough to handle the non-periodic nature of the DB Writer's read operations. When the LV2 global on the RT platform is read it should return the contents of the cached buffer when a read operation is performed (by the RT Writer). If there are samples waiting in the RT's buffer file, a read of the oldest values should be read from the file and placed in the buffer waiting for the next read. The LV2 global should also return a boolean or similar flag that indicates more reading are waiting to be read.
We realize that this article does not tell you how to write to a DB from the RT platform but it does represent an architecture that will allow you to harness the stability of an RT based app while taking full advantage of the functionality that is already in place. Our LabVIEW experts will try to provide answers to your questions. Do you have any?