Sutron Corporation 8310 & 7310 Users Manual 8800-1125Rev. 2.7 (BETA) 4/16/2014 pg. 197
and event variables.
Ability to run programs even while recording is turned off.
Create custom input types
Create custom processing steps
Create custom measurements
Steps to Using Basic Programs
Create the Basic program on a PC using a text editor, and save it with a .bas extension.
Load the Basic program into the 8310.
Toggle recording OFF then ON, to cause the new program to be compiled (any syntax errors will
be detected at this point), or you can compile a program from the Diagnostics Menu/Basic
Status option.
Creating a Simple Program
Here are some examples of some simple programs…
Example 1. Measuring, processing, and logging an A/D channel using Basic
The following program will measure, convert, and log an air temperature sensor connected to
the AN1 input.
Interval = TimeSerial(0,1,0) : ' Log every minute
Offset = TimeSerial(0,0,0) : ' On the minute
Const ADModule = 1
Const ADChannel = 1
Public Function MeasureAirTemp(Parm)
' Set the return value to 0 to keep re-scheduling
MeasureAirTemp = 0
' Measure A/D channel the sensor is connected to
Volts = Ad(ADModule, ADChannel)
' Now convert from raw voltage to degrees C
degC = -20 + 20 * Volts
' Now convert to degrees F
degF = degC * 9/5
' Log the data to the Data.log under the name AirTemp
Log "Data", Now, "AirTemp", degF, "G", "deg F"
End Function
' Measure and log AirTemp every minute
StartTask "MeasureAirTemp", 0, Offset, Interval
Example 2. Custom GOES formatting
Basic may be used to create custom GOES messages. In this case, we’re going to append a raw