Hello,
I am writing a program to calculate stage in a water control structure.
We have been using a FRun sequence to enter the actual field stage value into the public table, and the logger was updating the offset if it was needed. This has worked great:
'Offset calculation 'Offset_SG'
If FRun=0 Then
Staff_Gage_Obs=0
FRun=1
EndIf
Changed=Staff_Gage_Obs-Old
If Changed=0 Then
Stage=CS450_Stg+Offset_SG
Else
Offset_SG=Staff_Gage_Obs-CS450_Stg
Stage=CS450_Stg+Offset_SG
Old=Staff_Gage_Obs
EndIf
We are trying to modifiy this code to enter a tape down measurement (instead of stage) to have it auto correct the offset.
I modified the following code:
'Offset calculation 'BR2 Out Stage Offset'
If FRun_BR2Out=0 Then
(BR2_RP_to_Vnotch-Obs_TD_BR2Out)=0
FRun_BR2Out=1
EndIf
Changed_BR2Out=(BR2_RP_to_Vnotch - Obs_TD_BR2Out)-Old_BR2Out
If Changed_BR2Out=0 Then
Stage_BR2Out=Raw_Level_ft_BR2Out+Offset_TD_BR2Out
Else
Offset_TD_BR2Out=(BR2_RP_to_Vnotch - Obs_TD_BR2Out)-Raw_Level_ft_BR2Out
Stage_BR2Out=Raw_Level_ft_BR2Out+Offset_TD_BR2Out
Old_BR2Out=(BR2_RP_to_Vnotch - Obs_TD_BR2Out)
EndIf
Where:
BR2_RP_to_Vnotch = Our reference point fromt he top of the control structure
Obs_TD_BR2Out = our distance to water
I am getting an "Invalid or out of place expression" for the 2nd line of the revised code: (BR2_RP_to_Vnotch-Obs_TD_BR2Out)=0
We would like to use this sequence as opposed to having field staff manually calcualte an offset. Is there a fix to this, or a better way to procede?
Thanks
You need to store your calculated expression into a variable first:
Public NewVar
newvar=BR2_RP_to_VNotch - Obs_td_br2out
newvar=0
Dana W.