I'm interested in creating a data table of just certain Status Table fields (e.g., MaxProcTime, MeasureTime, MaxSlowProcTime) and was wondering how to specify specific Status Table fields in a program? I understand that I can output the entire Status Table, but I want the ability to create a data table with only those fields I'm interested in. Any suggestions would be greatly appreciated. Thanks.
You can access most variables in the status table using the syntax for accessing any table, i.e. Tablename.Fieldname, where the tablename in this case is "Status". You can assign the variable to one of matching type or to a string if you wish.
I can't seem to do what you mentioned. Can you provide an example of how I: 1) create a variable from Status.MaxProcTime, and 2) create a data table that samples Status.MaxProcTime daily?
Try this, you can either assign the value to a variable, which may be useful for comparisons etc OR just sample it directly:
'CR1000 Series Datalogger
Public proctime As Long
DataTable (Test,1,1000)
DataInterval (0,1,min,10)
Sample (1,proctime,Long)
'or
Sample(1,Status.MaxProctime, Long)
EndTable
'Main Program
BeginProg
Scan (1,Sec,0,0)
proctime=Status.MaxProctime
CallTable Test
NextScan
EndProg
Thanks for the suggestions. I tried but was trying to establish the variable proctime in the variable declaration section, not the main program.
This raises a follow up question. Is there a way to call the entire Status table within in the main program? I've tried several different ways and can't get it to work. The reason is that currently I only get the full status table when I connect to a remote CR1000 once every few months and Collect Now. I would like to create a data table of the entire Status data table once a day so that I can upload it on each visit to the remote logger.
The only tables that CallTable() will work with are final storage tables. The status table is a horse of an entirely different colour. It gets updated on demand or, rather, when it is polled. You could actually do two things:
- You can enabled the status table for scheduled collection in LoggerNet and set it up to output to a file.
- You can set up a scheduled task to poll the status table using the logger-query transaction in corascript as shown below:
Program Name: "c:\program files (x86)\campbellsci\loggernet\cora_cmd.exe
Command Line: --input={connect localhost; logger-query station Status c:\campbellsci\loggernet\station_table_status.dat most-recent --format=toa5
This latter option has the advantage of not forcing the status table to be polled with every collection.
Hi jtrauntvein,
Although I think I understand what you are proposing, neither solution would allow me to collect daily status table information at a station that wasn't hooked up to a PC. Enabling scheduled collections for the status table requires that Loggernet be connected to the station which isn't my case until I visit a field site once every 3-months. The Cora Script also seems to require it be run on a PC connected to a station.
So, if I wanted a station to output the status data table once daily but was only connected to the station once every 3 months, what options, if any, do I have?
I think a solution was offered above, where you create a variable (either public or dim) and log it like any other variable. We typically log the program signature this way, e.g.,
public progSig as long
DataTable (Diagnostic,1,-1)
DataInterval (0,60,Min,0)
Sample (1,progSig,uint2)
Average (1,batt_volt,FP2,0)
...
EndTable
BeginProg
progSig = status.ProgSignature
Scan (5,Sec,0,0)
...
CallTable Diagnostic
NextScan
EndProg
This would be laborious if you want to record the whole public table, having to mirror each entry with a variable of the right data type. Maybe there's a way to periodically write all the values to a named file on the logger?
I'm hoping for a solution that doesn't require creating a variable for each of the Status Table entries. As you suggested, is there a way to periodically write all status table values to a named file on the logger?