- Code: Select all
// Main Vars exposed to the outside world
Public Structure AllaisingArray_t // All these read only
VarArray(20) as byte
WaterLevel as VarArray(0).AsUshort // Water level as % 0-100
CurrentNCVolume as VarArray(2).AsUshort // Volume as a % to 0.01
TotalCondeVolume as VarArray(4).AsUshort // Current running volume
CurrentStage as VarArray(6) // Current Stage Need to add values
NCTrueValue as VarArray(7).AsUshort // Last proper NC value following a full cycle
CurrentRawLevel as VarArray(9).AsUshort // Raw value of the level
BottomOptoRaw as VarArray(11).AsUshort // Last raw value of bottom opto
TopOptoRaw as VarArray(13).AsUshort // Last raw value of top opto
BottomOpto AS VarArray(15) // 0 or 1 value of the status of the bottom opto 1 = water is seen
TopOpto as VarArray(16) // 0 or 1 value of the status of the top opto 1 = water is seen
End Structure
Public Dim NC_Status as AllaisingArray_t
But would like to add boolean or even bit
In the example above I have a byte in place of a bit but lines like
NC_Status.BottomOpto = LowLevelFlag
Throw up an "Incompatible type"
I know I could use
if LowLevelFlag = 1 then
NC_Status.BottomOpto = 1
Else
NC_Status.BottomOpto = 0
End if
But would love it to be a little more elegant. Also is there a list somewhere with a list of the .AsAlias types allowed?