We have a table on a CR1000 that is used to store values manually entered by a tech via ten key. They will manually measure a temperature, snow depth, use a 0,1 to indicate a sensor cleaning, etc. Currently these values are written to a table every 5 minutes. Most of the time, these values are a NaN.
Is there a way to filter a datatable to delete rows where certain fields are all NaN or is there a way to set up an event based table so that it writes only at a defined interval?
It could be accomplished with the DataEvent instruction, or the TrigVar parameter of the DataTable instruction.
The TrigVar parameter is the simplest. The DataEvent instruction has more flexibility.
DataTable (Test,PTemp <> NAN,100)
When you have some kind of conditional table, it is recommended to not leave the size on autoallocate. Giving it more space than it needs takes space away from other tables.
This is almost exactly what I'm looking for.
Is there a way to set up the TrigVar to check for <>NAN on multiple variables - (there's not much on that frunction in the Help docs)? There will always be a value for SiteID, LoggerID, and ProgID.
You can combine multiple logical expressions with operators like OR.
It could be easier to manage by making a boolean variable that turns the table on or off. Then you can set that variable with a logical statement within your scan.
The program guidance above works very well. One issue the field crew is having is after they initialize the table by setting a TrigVar, the values are sometimes written to the final storage table (thus public values return to nan) before they finish and they have to go back and enter all the manual values again. Is there a way to stop this from happening?