Unreasonable is a good word for it. Some bosses (non-technical background) seem to believe if you're a hardware guy, then your automatically a s/w guy too.
I believe I have the general idea with writeln. However, I found it was modified a bit so I went with the examples already there. (BIWritelnStr). Seems to work OK.
I've modified the code a bit, but the main parts are still there.
Here's where the error occurs:
If BI_Result(False)>0 Then <---------- This is what triggers the abort. BI_Result is above 0
Begin
BIWritelnStr('line 1274'); <---------- I added this
BIWritelnStr('FAILURE : Abort ramping voltage'); <---------- Displayed error msg.
Failure:=True;
End;
When I grep for "BI_Result" I found the Function below. (still trying to make sense of what it's doing) See comments.
(*________________________________________________________
| FUNCTION : BI_Result
| VERSION : X.XX
| DATE : XXXXX XX, XXXX
|.........................................................
| DEFINITION/NOTES:
| Returns last error number from abort.
| Reset - True = Set BI_ResultVal to 0, plus abort
| vars.
| False = Do not reset BI_ResultVal
|________________________________________________________*)
Function BI_Result(Reset : Boolean) : Word;
Begin
(* Override abort, forcing powerdown of instruments *)
If (Insidepwrdwn=True) Or (InsideHVpwrDwn=True) <---------If in one of the pwr dwn modes, it resets BI_Result to 0
Then BI_Result:=0
Else BI_Result := BI_ResultVal; <-------------If not in a pwr dwn mode, it leaves the BI_ResultVal unchanged
If Reset=True Then <------------
What determines if Reset is true or false?????? Seems like if true, error would clear??
Begin
BI_ResultVal:=0; (* Resets to indicate no error *) <-------------This comment is orig
xProcedure:=yUnknown; (* Reset xProcedure *) <-------------This comment is orig
xSubProc:=yUnknown; <---- not sure what's going on from here down
xBin:=0;
zBin:=0;
xNode:=0;
zNode:=0;
xPin:=0;
zPin:=0;
xUnit:=0;
zUnit:=0;
xValue:=1E37;
zValue:=1E37;
xDevice:=UFI; (* Uncommon *)
zDevice:=UFI;
xHV_Addr:=$FF;
xHV_OrgData:=$FF;
xHV_NewData:=$FF;
zHV_Addr:=$FF;
zHV_OrgData:=$FF;
zHV_NewData:=$FF;
xHV_Value:=0;
zDataStr:='';
xDataStr:='';
GlbAboNodePinValue:=0;
End;
End; (* Function RI_Result *)