dknechtions
Technical User
Hey i am a little new to Procomm and needed help comparing a voltage value out of a Sage930A to a set number of values. Here is what i have however it always gives me a -0VDC no matter what the voltage is:
string string1, string2, string3, string4, string5, string6, string7, string8
string string9, string10, response4, response5, response6, string9a, string9b, string9c, string9e
string string9d, string9f, string2a, stringMT, stringMT2, stringMN, stringSN, stringVDial
integer STEP, RGVDC, TGVDC, AMPS, MT1, MT2, MN, SN, Event
integer Choice = 2 ; Used for radio button group.
string1 = "= -"
string2 = "= -"
string2a = "= +"
;XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
;;;;;;;;;;;;;;; verify tip to ground 0 VDC ;;;;;;;;;;;;;;;;;
TGVDCtest:
transmit "G,6,J,K,K,K"
waitquiet 4
rxflush
transmit "X"
waitfor "= +" 2
rget string2a 1 2
atoi string2a TGVDC ; Convert string to integer.
waitquiet 1
termmsg "*****************************`r`n"
termmsg "* Tip to Ground Voltage = -%d VDC*`r`n" TGVDC
termmsg "*****************************`r`n"
if TGVDC<=9 & TGVDC>=0
;usermsg "TGVDC success"
goto currtest
else
goto TGVDCtest2
endif
TGVDCtest2:
waitquiet 2
rxflush
transmit "X"
waitfor "= -" 2
rget string2 1 2
atoi string2 TGVDC ; Convert string to integer.
waitquiet 1
termmsg "*****************************`r`n"
termmsg "* Tip to Ground Voltage = -%d VDC*`r`n" TGVDC
termmsg "*****************************`r`n"
if TGVDC<=9 & TGVDC>=0
;usermsg "TGVDC success"
goto currtest
else
goto TGVDCtest3
endif
TGVDCtest3:
waitquiet 2
rxflush
transmit "X"
waitfor "= -" 2
rget string1 2 2
atoi string1 TGVDC ; Convert string to integer.
waitquiet 1
termmsg "*****************************`r`n"
termmsg "* Tip to Ground Voltage = -%d VDC*`r`n" TGVDC
termmsg "*****************************`r`n"
if TGVDC<=18 & TGVDC>=10
;usermsg "TGVDC success"
goto currtest
else
usermsg "TGVDC fail POT Test %d" STEP
dialogbox 0 0 0 100 50 11 "Choose One"
radiogroup 1 Choice ; Define radio group.
radiobutton 2 5 5 90 12 "Quit, go to next POT"
radiobutton 3 5 20 90 12 "Continue Test"
endgroup
pushbutton 4 25 35 50 15 "&Done"
enddialog
while 1
dlgevent 0 Event ; Get dialog box event.
switch Event ; Evaluate the event.
case 0 ; No event occurred.
endcase
case 1 ; Radio group control selected.
endcase
default ; Exit case selected.
exitwhile ; Exit the while loop.
endcase
endswitch
endwhile
dlgdestroy 0 CANCEL ; Destroy the dialog box.
if Choice == 2 ; Evaluate radio group state.
goto NEXTPOT1
else
endif
endif
;;;;;;;;;;;;; measure current ;;;;;;;;;;;;;;;
currtest:
string string1, string2, string3, string4, string5, string6, string7, string8
string string9, string10, response4, response5, response6, string9a, string9b, string9c, string9e
string string9d, string9f, string2a, stringMT, stringMT2, stringMN, stringSN, stringVDial
integer STEP, RGVDC, TGVDC, AMPS, MT1, MT2, MN, SN, Event
integer Choice = 2 ; Used for radio button group.
string1 = "= -"
string2 = "= -"
string2a = "= +"
;XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
;;;;;;;;;;;;;;; verify tip to ground 0 VDC ;;;;;;;;;;;;;;;;;
TGVDCtest:
transmit "G,6,J,K,K,K"
waitquiet 4
rxflush
transmit "X"
waitfor "= +" 2
rget string2a 1 2
atoi string2a TGVDC ; Convert string to integer.
waitquiet 1
termmsg "*****************************`r`n"
termmsg "* Tip to Ground Voltage = -%d VDC*`r`n" TGVDC
termmsg "*****************************`r`n"
if TGVDC<=9 & TGVDC>=0
;usermsg "TGVDC success"
goto currtest
else
goto TGVDCtest2
endif
TGVDCtest2:
waitquiet 2
rxflush
transmit "X"
waitfor "= -" 2
rget string2 1 2
atoi string2 TGVDC ; Convert string to integer.
waitquiet 1
termmsg "*****************************`r`n"
termmsg "* Tip to Ground Voltage = -%d VDC*`r`n" TGVDC
termmsg "*****************************`r`n"
if TGVDC<=9 & TGVDC>=0
;usermsg "TGVDC success"
goto currtest
else
goto TGVDCtest3
endif
TGVDCtest3:
waitquiet 2
rxflush
transmit "X"
waitfor "= -" 2
rget string1 2 2
atoi string1 TGVDC ; Convert string to integer.
waitquiet 1
termmsg "*****************************`r`n"
termmsg "* Tip to Ground Voltage = -%d VDC*`r`n" TGVDC
termmsg "*****************************`r`n"
if TGVDC<=18 & TGVDC>=10
;usermsg "TGVDC success"
goto currtest
else
usermsg "TGVDC fail POT Test %d" STEP
dialogbox 0 0 0 100 50 11 "Choose One"
radiogroup 1 Choice ; Define radio group.
radiobutton 2 5 5 90 12 "Quit, go to next POT"
radiobutton 3 5 20 90 12 "Continue Test"
endgroup
pushbutton 4 25 35 50 15 "&Done"
enddialog
while 1
dlgevent 0 Event ; Get dialog box event.
switch Event ; Evaluate the event.
case 0 ; No event occurred.
endcase
case 1 ; Radio group control selected.
endcase
default ; Exit case selected.
exitwhile ; Exit the while loop.
endcase
endswitch
endwhile
dlgdestroy 0 CANCEL ; Destroy the dialog box.
if Choice == 2 ; Evaluate radio group state.
goto NEXTPOT1
else
endif
endif
;;;;;;;;;;;;; measure current ;;;;;;;;;;;;;;;
currtest: