NQC Overview Data Logging Contents | Master Index
 RCX   RCX2 

FUNCTIONS / COMMANDS
 
          CreateDatalog()  Create a datalog of the specified size (which must be a constant).
          AddToDatalog()  Add the value.
          UploadDatalog()  Initiate and upload of count data points beginning at start.

VALUES / QUERIES
 

OVERVIEW
 
          The RCX contains a datalog which can be used to store readings from sensors, timers, variables, and the system watch. Before adding data, the datalog first needs to be created using the CreateDatalog(size) command. The 'size' parameter must be a constant and determines how many data points the datalog can hold.
   CreateDatalog(100);	// datalog for 100 points
Values can then be added to the datalog using AddToDatalog(value). When the datalog is uploaded to a computer it will show both the value itself and the source of the value (timer, variable, etc). The datalog directly supports the following data sources: timers, sensor values, variables, and the system watch. Other data types (such as a constant or random number) may also be logged, but in this case NQC will first move the value into a variable and then log the variable. The values will still be captured faithfully in the datalog, but the sources of the data may be a bit misleading.
   AddToDatalog(Timer(0));	// add timer 0 to datalog
   AddToDatalog(x);	// add variable 'x' 
   AddToDatalog(7);	// add 7 - will look like a variable
The RCX itself cannot read values back out of the datalog. The datalog must be uploaded to a host computer . The specifics of uploading the datalog depend on the NQC environment being used. For example, in the command line version of NQC, the following commands will upload and print the datalog:
   nqc -datalog
   nqc -datalog_full

 
FUNCTIONS / COMMANDS
 RCX   RCX2 

         CreateDatalog(size) Overview | Top
         
Create a datalog of the specified size (which must be a constant). A size of 0 clears the existing datalog without creating a new one.
CreateDatalog(100); // datalog for 100 points


         AddToDatalog(value) Overview | Top
         
Add the value, which may be an expression, to the datalog. If the datalog is full the call has no effect.
AddToDatalog(x);


         UploadDatalog(start, count) Overview | Top
         
Initiate and upload of count data points beginning at start. This is of relatively little use since the host computer usually initiates the upload.
UploadDatalog(0, 100);  // upload entire 100 point log



 
VALUES / QUERIES
 RCX   RCX2 

Comments