|
|
|
|
|
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
|