I'm trying to collect some 20 Hz data from a serial port along with some 1 hz analog temperature data and 1 minute panel temp and battery voltage data. using a CR6
We want to collect at a 50% duty cycle to save power so at top of the hour collect N points (2^15) of 20 hz data along with the 1 Hz temperature and 1 minute panel temp/battery voltage. At the end of the N point collection want everything to basically go to sleep for the rest of the hour. (close serial ports and power down instruments using SW12 command).
What I've tried is a 1 hour main scan, then a 50 msec subscan to get the 20 Hz data, then slow sequences to get the 1 Hz and 1 minute data. What happens with the psuedo code I have below is that the slow sequence scans start as soon as the program starts. At the top of the hour the subscan for the 20 Hz data starts and both SlowSequence scans stop, then when the 20 Hz data finishes collecting, the slow sequence scans start again.
Any suggestions would be appreciated!
Psuedo code I have is:
TableFile("CRD:oneMin_",64,-2,Nmin,0,Day,0,0) ' data collected for Nmin minutes
' One Hz, HC2S3 T/H
TableFile("CRD:OneHz_",64,-2,Nsecs,0,Hr,0,0) '1638 seconds in 27.306 minutes
' 20 Hz table for Sonic anemometer
' Twenty Hz ASCII (RM Young)
Scan(1,hr,1,0) Unending hourly scan
Subscan(50,Msec,N) ' N=2^15
'read 20 Hz data from serial port '
' do some processing of the 20 Hz data'
'read some 1 Hz temperature and humidity data
'read panel temp and battery voltage at 1 minute interval
Anything in a slow sequence is lower priority than your main scan. So, it gets put on hold during the measurements happening in the main scan. You may have to work in the temperature and humidity into your main scan.
Thanks for replying. Any ideas on how to do that? Scanning the slower sensors at 20 Hz I think would give us screwy results.