I am attempting to take an average reading over 30 seconds, once every 5 minutes. I am new to CRBasic, and I am a little confused about the sstructure of the scan and the data interval for the table. Which of these should I be adjusting(or both?) to get my desired outputs?
Thank you in advance.
I hope i have interpreted your requirement corrctly. The following shows the sensors are measured every1s. An average of both measurements is taken every 30s. This is only calculated and put in the output table depending on the state of the public variable "TorF".
This should get what you need or at least put you in the right direction :-
Public PTemp, Batt_volt
Public TorF As Boolean 'Define Data Tables
DataTable (Test,TorF,-1) 'TorF decides if the table is output or not
If IfTime (0,5,Min) Then
TorF = True
TorF = False
Thank you, this is clear! An additional question is if there is any way to only power the sensors for the 30 seconds of data collection?