FGH 2000 Series Communications Manual Download Page 17

16

SERIES 2000 COMMUNICATIONS MANUAL

M41 Issue 1.1

APPENDIX A - BASIC COMMUNICATIONS PROGRAM

1000 REM DEMO PROGRAM FOR S2000 COMMUNICATIONS (GW-BASIC V3.23)
1010 ON ERROR GOTO 6000
1020 GOSUB 2000 'INITIALISE
1030 GOSUB 3000 'DRAW SCREEN
1040 WHILE  PAUSED=0      'Main loop
1050   KEY (7) STOP:KEY (8) STOP
1060   FOR I=1 TO MAXPRM
1070     KEY (5) STOP:KEY (6) STOP
1080     LOCATE 5+I,1
1090     GOSUB 4000        'Send read question and get answer
1100     GOSUB 5000        'Display answer
1110     KEY (5) ON:KEY (6) ON
1120   NEXT I
1130   KEY (7) ON:KEY (8) ON
1140 WEND
1150 GOTO 1040
2000 REM *****  INITIALISE  *************
2010 ON KEY (5) GOSUB 7000 : KEY (5) ON  'Write
2020 ON KEY (6) GOSUB 10000 : KEY (6) ON  'Address
2030 ON KEY (7) GOSUB 11000 : KEY (7) ON  'Pause
2040 ON KEY (8) GOSUB 12000 : KEY (8) ON  'Cont
2050 ON KEY (10) GOSUB 9000 : KEY (10) ON  'Break
2060 WHILE PRAM$(MAXPRM) <>"END"
2070   MAXPRM = 1
2080   READ PRAM$(MAXPRM)
2090   READ PRMCODE$(MAXPRM)
2100   READ PRMMUL(MAXPRM)
2110   READ PRMUNITS$(MAXPRM)
2120 WEND
2130 MAXPRM = MAXPRM-1
2140 OPEN "COM1:1200,O,7,1,DS0,CS0,CD0" AS #1
2150 ADDRESS$= "55"             'Initial controller address
2160 RETURN
2170 REM DATA TABLE. TEXT(18 MAX),PARAMETER LETTER,1/UNIT VALUE,UNITS
2180 DATA "MEASURED VALUE","A",1,"DEG"
2190 DATA "OUTPUT","B",10,"%"
2200 DATA "LOCAL SET POINT","C",1,"DEG"
2210 DATA "PROPBAND","D",10,"%"
2220 DATA "INT ACTION TIME","E",1,"SEC"
2230 DATA "DER ACTION TIME","F",1,"SEC"
2240 DATA "DER APPROACH BAND","G",10,"XP"
2250 DATA "END","",0,""
2260 RETURN
3000 REM *****  DRAW SCREEN  ************
3010 SCREEN 0,0:WIDTH 80
3020 CLS
3030 KEY 5,"WRITE"
3040 KEY 6,"ADDR'S"
3050 KEY 7,"PAUSE"
3060 KEY 8,"CONT"
3070 KEY 9,""
3080 KEY 10,"QUIT"
3090 LOCATE 2,24
3100 PRINT "F:G:H  S2000 SERIES   COMMS DEMO"
3110 LOCATE 4,1
3120 PRINT TAB(4)"Parameter"TAB(23)"Question"TAB(33)"Answer" TAB(52)"Result"
3130 RETURN
4000 REM *****  READ AND GET ANSWER  ***
4010 PRINT "->";
4020 TX$="R"+APRMCODE$(I)+CHR$(13)
4030 PRINT #1,TX$;
4040 GOSUB 8000                 'GET RX$
4050 RETURN
5000 REM *****  DISPLAY QUESTION AND ANSWER
5010 PRINT TAB(4) PRAM$(I);            'Text parameter title
5020 PRINT TAB(23) "R"APRMCODE$(I);"   =  ";RX$ SPACE$(5);
5030 VALUE$=RIGHT$(RX$,5)

Summary of Contents for 2000 Series

Page 1: ...Communications Manual Series 2000 FGH Controls Ltd Openshaw Way Letchworth Herts SG6 3ER Tel 01462 686677 Fax 01462 480633 Email sales fghltd demon co uk www fgh co uk ...

Page 2: ...3 5 Segment number field P2000 Only 6 3 6 Message data field 6 3 7 Controller read write parameter codes 6 3 8 Programmer read write parameter codes 8 3 9 Controller Set status codes 8 3 10 Programmer Set status codes 9 3 11 Response from read or write 9 3 12 Set status response 9 3 13 Controller error responses 10 3 13 1 Corrupt message response 10 3 13 2 Syntax error response 10 3 14 Data fields...

Page 3: ...4 Wire EIA 422 A Mode RS422 Transmission standard EIA 422 A RS 422 Data rates 1200 2400 4800 and 9600 baud Data format 1 start 7 data odd parity 1 stop bit Implementation 4 wire half duplex Max drivers per line 1 Max receivers per line 10 Max cable length 1200 metres 3937 feet 2 0 CONNECTIONS 2 1 General The series 2000 may be connected to any computer or device which supports the RS422 or RS485 i...

Page 4: ...tted between RX and RX on both the computer and the furthest instrument For two wire networks this resistor should be fitted at the computer end only Only one such resistor should be fitted on each wire pair 2 2 2 Wire EIA 485 Mode RS 485 This diagram shows the connection for EIA 485 mode Note the use of screened cable This connection method may be continued on to other instruments up to the maxim...

Page 5: ...nd select the baud rate required from 1200 2400 4800 or 9600 using the up down keys Scroll to the element AddrS This is the controller instrument address and may be set between 0 and 99 using the up down keys If the instrument is a P2000 programmer then the controller part of the instrument will have an address as set by this parameter and the programmer part of the instrument will have an address...

Page 6: ...ad message header AA instrument address P parameter code to be read SS segment number P2000 Only Again the message must be terminated with a CR and spaces may be included if desired 3 1 3 Set instrument status messages Set messages to the instrument take the following form SAAC CR where S set message header AA instrument address C set parameter code to be performed Again the message must be termin...

Page 7: ...f 60 to 69 having their local set point set to 100 Instruments written to with wildcard addresses do not reply 3 4 Message parameter code The parameter code field of the message is a single ASCII character In a write message this corresponds to one of the control parameters listed in paragraph 4 6 parameter codes In the case of set messages this is still a single ASCII character but corresponds to...

Page 8: ...high air setpoint limit H PL HiOP 1 1 I R W Heat TP cycle time in S Ratio positive reference type HCyC rEFH 1 1 J R W Alarm 1 level ALr1 1 K R W Alarm 2 level ALr2 1 L R Controller status 2 M R W User Retransmit value 1 N R Resultant control setpoint 1 O R W Setpoint type code StyP 1 P R W Alarm 1 type code A1ty 1 Q R Instrument type code 3 R R Analogue remote setpoint value 1 S R W Alarm 2 type c...

Page 9: ...us YES TYPE 4 N N A Ready mode event status NO TYPE 4 P N A Profile pointer NO TYPE 1 Q N A Profile status YES TYPE 5 R YES Segment event outputs NO TYPE 4 T YES Segment time in minutes NO TYPE 6 X N A Profile currently running YES TYPE 1 3 9 Controller Set status codes Writing a set command to the instrument with a parameter as follows will produce the specified action if the address field matche...

Page 10: ...ond with a string of ASCII characters The header will consist of Hex 2A The AA P and SS fields will be exactly the same as in the message which prompted the response The SS field will only be present for some messages to and from the profile generator part of the instrument The format of the data field D D is specific to the parameter code used and these field types are described in section 3 14 3...

Page 11: ... error response Messages that were correctly received but don t make sense as long as the address part was o k generate the following response AANN CR where AA address of the instrument responding NN two digit ASCII HEX error code Error code binary weightings bit7 Illegal trailer bit6 Tx buffer overflow bit5 Illegal number of characters bit4 Illegal data bit3 Illegal parameter code bit2 Rx buffer ...

Page 12: ...Both alarms off 1 Alarm 1 on alarm 2 off 2 Alarm 2 on alarm 1 off 3 Both alarm 1 and 2 are on C Tuner status 0 pretune and atune are off 1 pretune is on atune is off 2 atune is on pretune is off 3 pretune and atune are on D Auto Man 0 Automatic 1 Manual 3 14 3 Data field type 3 This data type is reserved for the instrument type code The instrument type code may be read from the controller by readi...

Page 13: ... S degrees F BC Input 18 Type R degrees F type 19 Type J degrees F 20 Type K degrees F 21 Type T degrees F 22 Type E degrees F 23 Type B degrees F 24 Type N degrees F 25 Type W degrees F 26 Type W3 degrees F 27 Type W5 degrees F 28 Type NM degrees F 29 Type L degrees F 30 Type K10 degrees F 31 Type T10 degrees F 32 Type RT10 degrees F 33 Type RT degrees F 34 Type Linear 35 Type Root D Control 0 No...

Page 14: ...R20Q CR May invoke the reply 20QR dy CR indicating that the programmer is in ready mode Or 20Q02 CR Indicates that segment 2 is currently running Or 20Q03HM CR Indicates that segment 3 is running the H indicates that the programmer is in hold and the M indicates the programmer is recovering from a mains failure 3 14 6 Data field type 6 P2000 Only This data field type is only used for parameter cod...

Page 15: ...OW ALARM INDEXED LOW ALARM 0005 MANUAL ACK RELAY MANUAL ACK RELAY 0006 REMOTE SP ACK RELAY REMOTE SP ACK RELAY 0007 INVALID PROGRAM RELAY 0008 INVALID READY RELAY 0009 INVALID UP RAMP RELAY 0010 INVALID DOWN RAMP RELAY 0011 INVALID SOAK RELAY 3 15 2 Setpoint type codes The setpoint type parameter code O is coded as follows DATA FIELD SETPOINT TYPE 0000 HIGH CLAMPED SETPOINT 0001 LOW CLAMPED SETPOI...

Page 16: ...AL HOLD 0005 HOLD ON RAMPS ABOVE SETPOINT ONLY 0006 HOLD ON RAMPS BELOW SETPOINT ONLY 0007 HOLD ON RAMPS ABOVE AND BELOW SETPOINT 0009 HOLD ON DWELLS ABOVE SETPOINT ONLY 0010 HOLD ON DWELLS BELOW SETPOINT ONLY 0011 HOLD ON DWELLS ABOVE AND BELOW SETPOINT 0013 HOLD ON RAMPS DWELLS ABOVE SETPOINT ONLY 0014 HOLD ON RAMPS DWELLS BELOW SETPOINT ONLY 0015 HOLD ON RAMPS DWELLS ABOVE AND BELOW SETPOINT ...

Page 17: ...MAXPRM 2110 READ PRMUNITS MAXPRM 2120 WEND 2130 MAXPRM MAXPRM 1 2140 OPEN COM1 1200 O 7 1 DS0 CS0 CD0 AS 1 2150 ADDRESS 55 Initial controller address 2160 RETURN 2170 REM DATA TABLE TEXT 18 MAX PARAMETER LETTER 1 UNIT VALUE UNITS 2180 DATA MEASURED VALUE A 1 DEG 2190 DATA OUTPUT B 10 2200 DATA LOCAL SET POINT C 1 DEG 2210 DATA PROPBAND D 10 2220 DATA INT ACTION TIME E 1 SEC 2230 DATA DER ACTION TI...

Page 18: ...0 LOCATE CURY CURX 7110 RETURN 8000 REM GET RESPONSE RX 8010 RX IN 8020 TIMLIMIT 300 TIMEOUT LIMIT 8030 TIM 0 TIMOUT 0 RXEND 0 8040 WHILE RXEND 0 AND TIMOUT 0 8050 WHILE NOT EOF 1 8060 IN INPUT 1 1 8070 IF IN CHR 13 THEN RXEND 1 ELSE RX RX IN 8080 TIM 0 8090 WEND 8100 TIM TIM 1 8110 IF TIM TIMLIMIT THEN TIMOUT 1 8120 WEND 8130 IF TIMOUT 0 THEN RX TIMEOUT 8140 RETURN 9000 REM BREAK KEY 10 9010 LOCA...

Reviews: