Our full technical support staff does not monitor this forum. If you need assistance from a member of our staff, please submit your question from the Ask a Question page.


Log in or register to post/reply in the forum.

CR200 to log data faster than once a minute


JedS Jan 21, 2011 09:24 PM

We have a CR200 installed in a visitor center interactive exhibit that is connected with a basic wind set sensor. The program on the CR200 has a refresh rate of 5 seconds but the table is limited by DataInterval to 1 minute or greater according to the complier. Since this is an exhibit that visitors engage in, 1 minute is far too long a period of time until the display, a Loggernet screen, updates with the new wind data.

Looking at the options I could find, it seems that a Print command can be issued on every main program cycle (5 sec cycle) that outputs the wind speed and direction to COM1. Testing with with a terminal program confirmed this, however, getting the data back into Loggernet 3.4 does not seem to be possible and writing a script to log and graph this seems excessive for something so simple.

So, does anyone know how to increase the table's DataInterval or get the data out of the CR200 and into Loggernet more quickly than on a 1 minute timescale?


Sam Jan 21, 2011 10:43 PM

*****************************
READ THIS !!!
*****************************
One of the differences between the CR200X series and our other loggers is the use of Flash (not battery backed RAM) memory for data storage. Flash storage has a finite number of times it can be read and written.

From the manual:
Data tables are stored in Serial Flash EEPROM. The Serial Flash EEPROM is good for more than 50,000 write cycles. If an EEPROM memory failure is detected ... the datalogger must be returned to CSI to replace the Serial Flash EEPROM.

So there was a reason the smallest selectable data interval is 1 minute.

I strongly advise that you get a CR800 or better for this application.
*******************************

With all of that said, solving your problem is as easy as removing the DataInterval instruction. The following example will write data to the datatable every time it is called - in this case every 5 seconds. Remember, you have been warned.

Public batt_volt
DataTable (Test,1,1000)
Sample (1,batt_volt)
EndTable
BeginProg
Scan (5,Sec)
Battery (batt_volt)
CallTable Test
NextScan
EndProg


If your primary goal is to transfer data from the logger to the PC to populate a RTMC screen and not necessarily store data on the logger, forgo the technique above (to spare your Flash) and just collect the Public table of the datalogger. You can include the Public table as part of Scheduled Collection. You can set the collection process to append the records to the end of the file. Additionally with RTMCPro you make the data source the "Public" .dat data file instead of the LoggerNet cache so you have some history when you relaunch RTMC.

* Last updated by: Sam on 1/21/2011 @ 3:50 PM *


Skipper Jan 21, 2011 10:45 PM

First off, your CR200 can scan as fast as once per second. That is changed in the Scan instruction (e.g. Scan (1,Sec,0,0)).

I was looking at the wrong help files for the DataInterval instruction, so I've edited my post. The CR200's data interval can be no shorter than one minute, but as Sam pointed out, it sounds your application can just use the Public table, which is a real-time table.

I hope this helps!

* Last updated by: Skipper on 1/24/2011 @ 11:26 AM *


JedS Jan 21, 2011 11:07 PM

Thank you both for the information. I had not tried removing the DataInterval, only setting it to (0,5,Sec) which caused the compiler error. I understand the flash issue and the way this logger is being used and there is no reason for it what-so-ever either on the logger or the computer.

So Sam, you mentioned that it is possible to send the data through the 'Public table' which sounds reasonable and a much better way to do it than writing to flash memory. Would you be willing to expand a bit more on how I actually go about setting this up, as I don't remember seeing anything about this when I was looking this morning? Do I just "CallTable PublicTable" at the end of the main program loop or are the variables already in the public table when they are declared 'Public'? And where do I access it in LoggerNet as I hunted for all the data sources I could and don't remember seeing it there either. Thanks in advance.


If your primary goal is to transfer data from the logger to the PC to populate a RTMC screen and not necessarily store data on the logger, forgo the technique above (to spare your Flash) and just collect the Public table of the datalogger. You can include the Public table as part of Scheduled Collection. You can set the collection process to append the records to the end of the file. Additionally with RTMCPro you make the data source the "Public" .dat data file instead of the LoggerNet cache so you have some history when you relaunch RTMC.


Sam Jan 23, 2011 10:01 PM

JedS,

No special calls are required in the CRBasic program. Here is an example program. This program will measure battery voltage and generate a random number between 1 and 10 every 5 seconds. Two tables will be available for query from the logger - "Public" and "Status" - as they are created/available by default. There will be two fields in the "Public" table - "batt_volt" and "Random".
-----------------------------------------------
Public batt_volt
Public Random
BeginProg
Scan (5,Sec)
Battery (batt_volt)
Random = INT((10-1+1)*RND+1)
NextScan
EndProg
------------------------------------------------
Let's take a look at how we can graph "Random" using RTMC and RTMC Pro.
First, load the program to the CR200 and get the table definitions. Second, enable "Include For Scheduled Collection" for the "Public" table. For RTMC there is no need to write the data to a file. When using RTMC, we only have the ability to draw data from LoggerNet's data cache. But when using RTMC Pro we can use a .dat file as a data source. Assuming you will be using RTMC Pro, set the "File Output Option" to "Append to End of File". For both RTMC and RTMC Pro applications, enable "Scheduled Collection" and set the "Collection Interval" to 5 seconds (based on your previous post comments).

When building a project in RTMC, just point the series data to the cached "Public" table for the CR200. You can do the same for RTMC Pro if this is how you want to operate.

If you are using RTMC Pro, and you want to draw data from the .dat file, select Project-> "Manage Data Sources". Add a File Data Source, point to the .dat file being written for the public table, and set the Query Interval to 5 seconds. Also you will probably want to enable "Back Fill Entire File" and routinely do some file management on the .dat file when it gets really big. Now instead of point your Series data to a Server cache source, point it to the DataFile source you just finished creating.

You can find out more by reading the RTMC Pro help. Do a search for "File Data Source" and "Data Source".

* Last updated by: Sam on 1/23/2011 @ 3:06 PM *


ChipsNSalsa Jan 25, 2011 12:46 AM

Set the LoggerNet scheduled collection interval for 5 seconds and you'll get a snapshot of the public variable every 5 seconds and once a minute you'll get a bonus 1 minute final storage table record. Link all of the current conditions components (e.g. digital displays, dials, status bars, etc.) in your RTMC project to fields in the Public table in the Server data source. Link time series components like charts and tables to fields in the 1 minute table or other final storage table of your choice either in the Server data source or a Data File data source if you have Pro. The current conditions componets linked to the Public table should update every 5 seconds if set up this way.


JedS Feb 6, 2011 10:30 PM

Thanks everyone for the input, not sure how I missed something so simple the first time through. Works great now and opens up all sorts of other logging options as you mention 'ChipsNSalsa'.

Log in or register to post/reply in the forum.