Download FieldMaster™ GS
Transcript
FieldMaster GS Simple RS-232 Program Example ‘ Program to read FieldMaster GS power through the RS-232 ‘ Displays current, min and max. ‘ Written for Microsoft QBasic v 1.0 (the one that comes free with DOS) DECLARE FUNCTION GetInput$ () COMMON SHARED term$ ‘ Termination Character string ‘ FieldMaster GS can be set to terminate 4 different ways ‘term$ = “\” ‘ for \ line termination ‘term$ = CHR$(13) ‘ for CR line termination ‘term$ = CHR$(13) + CHR$(10) ‘ for CR-LF line termination term$ = CHR$(10) ‘ for LF line termination CLS LOCATE 1, 5 PRINT “FieldMaster GS RS-232 demo program” ‘ Change the com port and baud rate as required OPEN “com1:9600,n,8,1,CD0,CS0,DS0,OP0,RS” FOR RANDOM AS #1 ‘ Setup screen LOCATE 23, 10 PRINT “Press any key to stop”; LOCATE 8, 21 PRINT “Current” LOCATE 8, 36 PRINT “Min” LOCATE 8, 51 PRINT “Max” LOCATE 10, 5 PRINT “Power = “; ‘ Set min/max values to extremes pwrMin = 1000000! pwrMax = 0! 58