Data Acquisition (DAQ) and Control from Microstar Laboratories

Knowledge Base: Applications

Q10115 No logged data from direct disk logging

Tags: Help, DAPtools, logging, disk logging, server-side, Matlab, daplogpd function

Applies to: Matlab, direct-to-disk logging applications

When I try to log sampled data direct to my disk drive, I don't get any data. What can I do?

"Server-side disk logging" allows an application to configure data acquisition and spool logged data directly to a file as a separate process, while the main application continues doing other things. To do this, three processes must coordinate precisely, each one nontrivial to observe and control individually:

  1. The DAPL script. (Undetected configuration error? Never started?)
  2. The application. (Did an operation fail undetected?)
  3. The disk logging. (Was configuration successful? Was file creation successful?)

The example script [1] attached to this article provides an example of how to set up and perform server-side disk logging. Some special points to notice about this:

  • Make sure that communication channels open correctly. A command that works under normal circumstances can still fail if prior application activity terminated prematurely without closing handles to the channels.

  • The configuration file can download successfully on the host side even if commands in the downloaded configuration file fail to run properly for some reason within the DAPL system. You must poll the DAP board to see if there were any problems on its side.

  • Most configuration scripts place the START command at the end of the script file, to immediately start the data acquisition activity. You must have the server-side disk logging configured and ready before the DAPL configuration starts running — otherwise, the disk logging will begin its typical "FlushBefore" operation after the DAP starts sending the new data, discarding data that you probably wanted to keep. Using a separate START command, and sending this after both the DAP processing and disk logging are configured, makes it clearer when the processes are ready to run.

  • The disk logging doesn't stop until the application closes the handle to the data stream. Be sure allow the data logging enough time to collect all of the data, otherwise the file handles will be closed and logging will terminate prematurely.

  • When the application is done, do a clean-up by resetting the DAP board and closing all of the handles to data streams. If you fail to shut everything down in an orderly manner, unintended "orphan" processing could continue running on the DAP board, which could interfere with later access to the DAP board or the communication channels.


[1] Use these links to view the example m-file script for server-side disk logging, with a typical dapl configuration script that could be used with it.