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.

Event driven TableFile


bKlippert Feb 24, 2014 06:46 AM

Hello,


I've got a CR1000 logging data from a Hydro-Electric power plant. I've got three data tables in my program: EventTable, HourlyTable, DailyTable.

I've got EventTable storing samples every 5 seconds and the other two tables storing min, max, avg respectively.

When the plant goes down I want to preserve the data in the EventTable and possibly write the data to a file on the USR partition.

At this time when the plant goes down, I'm simply not calling the data table. This works, but only if the data table is downloaded before the plant is brought back up again.


I need to take a snapshot of the table, in full, leading up the the "Event".


Any suggestions are welcome.

DataTable (_Event_Data,1,720) 'Defined to record the last 60 minutes leading up to an event
DataInterval (0,5,Sec,10)
Minimum (1,BatteryVoltage,FP2,False,False)
Sample (1,PanelTemperature,FP2)
Sample (1,Err_UnderFrequency,Boolean)
Sample (1,Err_UnderVoltage,Boolean)
Sample (1,Err_OverFrequency,Boolean)
Sample (1,Err_OverVoltage,Boolean)
Sample (1,Err_GovernorWaterFlow,Boolean)
Sample (1,Err_GovernorWaterHighTemp,Boolean)
Sample (1,Err_TurbineVibrationSwitch,Boolean)
Sample (1,Err_GeneratorWindingTemp,Boolean)
Sample (1,WaterTemperature,FP2)
Sample (1,AirTemperature,FP2)
Sample (1,Hydro_EnergySumVar,FP2)
Sample (1,Hydro_PowerSum,FP2)
Sample (1,Hydro_PowerA,FP2)
Sample (1,Hydro_PowerB,FP2)
Sample (1,Hydro_PowerC,FP2)
Sample (1,Hydro_VoltAvgLN,FP2)
Sample (1,Hydro_VoltA,FP2)
Sample (1,Hydro_VoltB,FP2)
Sample (1,Hydro_VoltC,FP2)
Sample (1,Hydro_VoltAvgLL,FP2)
Sample (1,Hydro_VoltAB,FP2)
Sample (1,Hydro_VoltBC,FP2)
Sample (1,Hydro_VoltAC,FP2)
Sample (1,Hydro_Frequency,FP2)
Sample (1,Hydro_RMSCurrentA,FP2)
Sample (1,Hydro_RMSCurrentB,FP2)
Sample (1,Hydro_RMSCurrentC,FP2)
Sample (1,Diesel_VoltA,FP2)
Sample (1,Governor_VoltB,FP2)
Sample (1,Governor_RMSCurrentB,FP2)
Sample (1,Governor_CtAmps_Int,FP2)
EndTable


Scan (5,Sec,0,0)
RealTime(rTime)

Call Measurements
Call Analog2Digital
Call QueryModBus_A
Call QueryModBus_B
Call SiteStatus

'If hydro goes offline, DO NOT overwrite contents of table until idiot lights are cleared
If Hydro_Online = True Then CallTable _Event_Data
CallTable _Hourly_Data
CallTable _24Hour_Data
NextScan

* Last updated by: bKlippert on 2/23/2014 @ 11:53 PM *


jra Feb 24, 2014 03:14 PM

Take a look at the DataEvent() instruction. It lets you specify a number of records to store before your event (720 in your example) and number after (0 or just a few in your case).

Here's an article that may help also:
https://www.campbellsci.com/tips-dataevent

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