Date: Thu, 28 Mar 2024 20:51:53 +0100 (CET) Message-ID: <538987127.111250.1711655513317@srvdoc.doc.ipesoft.com> Subject: Exported From Confluence MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_Part_111249_1501209605.1711655513317" ------=_Part_111249_1501209605.1711655513317 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Location: file:///C:/exported.html
Supported device types and versions
Com=
munication line configuration
Communication statio=
n configuration
I/O tag configuration
Lite=
rature
Changes and modifications
Document re=
visions
This protocol provides data reading/writing into Landis&Gyr devices,= type PRV 1.xx, and 2.xx.
You can define the following parameters:
Table 1
Keyword | Full name | Meaning | Unit | Default value |
---|---|---|---|---|
MR | Retry Count | The number of repeated requests if the communica= tion error occurs. | - | 3 |
MWR | Max Wait Retry | Maximum retries of reading the response until it= is completed. | - | 14 |
RT | Retry Timeout | The delay between request repetitions in ca= se of a communication error. | s.ms | 1.000 s |
WT | Wait Timeout | The delay between reading the response until it = is completed. | ms | 300 millisec. |
WFT | Wait First Timeout | The first wait after the request has been sent b= efore reading the response. | ms | 1200 millisec. |
RD | Request Delay | Delay before sending the request. | ms | 1000 millisec. |
MBS | Maximum Buffer Size | Maximum size of request in bytes. | byte | 60 |
DOFF | Date Offset | The correction of the date offset in PRV and D20= 00 System. D2000 System interprets the date as a number of days from 1-1-19= 72. To test PRV 1.64 (SW ver. 4.04) we had to set the value 20089 because P= RV implements the date from 1-1-1917. | - | 4806 |
A string containing the protocol parameters is defined as follows:
Key_word=3Dvalue;Key_word=3Dvalue; ...
Example:
MR=3D4;RD=3D500;
If there is used a keyword with an invalid value in the initialization s= tring, there will be used corresponding default value according to the tabl= e 1.
I/O tags: AI, AO, CI, CO, DI, DO, TIR, TOR, TIA, TOA
The address must be in text format for configuration. In comparison with= the implementation in D2000 ver.3.xx, the range of types is not limited. T= he table shows the writing format of some types:
Type in D2000 v.3.xx | Write in D2000 v.4.x | Example |
---|---|---|
I/O | $xxx.name | $120.HW |
PLT | PLTx.name | PLT5.PAR1 |
ZON | ZONx.name | |
RGB | RGBx.name | |
VIP | VIPx.name | |
CVP | CVPx.name | |
@MGR | @MGRx.name | |
@MGG | @MGGx.name | |
@SEZ | @SEZx.name | |
@AI | @AIx.name | |
@AO | @AOx.name | |
@DI | @DIx.name | |
@DO | @DOx.name | |
@CI | @CIx.name | |
@PHON | @PHONx.name | |
@RING | @RINGx.name | |
TTY | TTYx.name | |
@PBUS | @PBUSx.name | |
@MBUS | @MBUSx.name | |
@OS | @OSx.name | |
@BLN | @BLNx.name | |
@BPS | @BPSx.name | |
TSK | [tsknr]name | [10]S2 |
SYS | name | DATE |
Format of the message:
<STX><ADDRESS><FUNCTION><SEQ><CONTENT OF ME= SSAGE><ETX/ETB><CRC>
STX - Start of text, character 0x02
ADDRESS - double-digits in ASCII format - the range from 01 - 99.
FUNCTION - double-digits in ASCII format - the function number. The numb= er 50 is added to the function number in response.
SEQ =E2=80=93 a consecutive number of message - one byte - the values 0x= 41 =E2=80=93 0x5A
CONTENT OF MESSAGE - a message in ASCII format - the parts of the messag= e are separated by =E2=80=9C;=E2=80=9D.
ETX - end of message
ETB - end of the block
CRC - checksum CRC-CCITT Cyclic Redundancy Check according to IBM<= /p>
Acknowledgment:
ACK - O.K. - the message contains the ACK character
NAK - error - the message contains the NAK character
Functions:
Function | Number | Content of message | Response |
---|---|---|---|
Config Check | 01 | Config ID | ACK/NAK |
New Point Def | 02 | ID:NAME;0:ConfigId; | ACK/NAK(memory) |
Delete Point | 03 | ID;ConfigId; | ACK |
Read All | 04 | --- | ID:VALUE;... |
ReadAllContinue | 05 | INDEX | ID:VALUE;... |
Set Output | 06 | ID=3DValue; | ACK |
Reset PRV | 07 | --- | ACK |
Clear Config | 08 | --- | ACK |
On the D2000 System side:
1. PRV does not respond in a defined limit.
2. Wrong checksum.
The message is repeated N-times - all necessary parameters can be set by= the station protocol parameters.
On the PRV side:
Wrong checksum - PRV does not respond.
Usage: The communication with PRV1/PRV2 via the serial lines and a radio= modem with OnLine configuration of transmitted values.
The number of transmitted tags from one station is max. 255.
Task 3:
Communication port number in PRV: PRT variable <1..3>
Station address: variable AD$ - the address always consists of two digit= s, e.g. =E2=80=9C01=E2=80=9D - address 1.
Communication task number - 3 is the default. If it needs to be changed,= modify tasks 254 and 253 - a restart after power failure and WatchDog Erro= r. Task 4 must be modified - the references to the local variables of task = 3.
WatchDog number - 7 is the default. If it needs to be changed, modify th= e task 253 and set a new WatchDog number in the calling of WADO function on= line 305.
The maximum size of the transmitted message to PC - BLK variable - the l= imit is 160.
Baud rate: The parameter TTYPRT.BD on line 60.
Task number for data acquisition: Task 4 is used. If it needs to be chan= ged, the task number on line 48 must be modified - the start of Task 4.
Task 4:
Parameter TSKFRM$ - defines an output format of the task. Actually, it d= efines an accuracy of transmitted float numbers.
Parameter WAIT DURING 5 on line 70 defines a value acquisition period in= seconds.
.TSK 3
1 -- FUGGA PROTOCOL (C) IPESO= FT 1997 V 1.02
5 ad$ :=3D "21"; -- station a= ddress
10 er :=3D 1 ; cf$ =3D"";RT$ = :=3D "";mx:=3D100
15 sl :=3D 2; bl =3D 60; cn := =3D 1; wx :=3D 5;
20 DIM N$(mx); DIM V$(mx); DI= M NW(mx);
25 FOR I :=3D 1 TO mx
26 V$(I) :=3D ""; NW(I) :=3D = 0;
27 NEXT I;
48 STOP 4; RUN 4;
40 TSKPRP:=3D3
50 TSKTTY:=3D1
55 TSKPRIO:=3D15
56 SYSDIAG:=3D0;
58 ON ERROR GOTO 7000
60 TTY1.BD=3D19200
61 -- TTY1.PARCHK =3D 0
62 TTY1.SSB =3D 0
70 TTY1.NOEC=3D1
72 TTY1.NCON=3D1
74 TTY1.MOD=3D0
76 TTY1.NWCR=3D1
78 TTY1.NFCR=3D1
79 TTY1.NOX=3D1;
80 INITTY1
90 BEGIN_INKEY
100 cm$ :=3D "" ;C$ :=3D ""; = ax$ :=3D "";fn$ :=3D "";CR$ :=3D "";WT:=3D0
200 ST :=3D 1; fc :=3D 0;
300 INKEY A$
305 WADO(7,60) ; -- 7 is Watc= h Dog number
310 IF A$=3D"" THEN WT :=3D W= T + 1 ELSE WT:=3D 0;
320 IF WT > wx THEN GOTO 1= 00
330 IF WT > 0 THEN WAIT DU= RING 1; GOTO 300
400 FOR RI:=3D 1 TO LEN(A$)= pre>
450 C$ :=3D A$[RI..RI]
500 ON ST GOSUB 600,800,1000,= 1200,1300,950,3000
540 cm$ :=3D cm$ + C$
550 NEXT RI
560 GOTO 300
600 IF C$ =3D CHR$(2) THEN ST= :=3D 2; ax$:=3D"" ELSE ST:=3D 1
610 IF C$ =3D CHR$(24) THEN S= T:=3D7;
620 cm$ :=3D ""
700 RETURN
800 ax$ :=3D ax$ + C$
820 IF LEN(ax$) < 2 THEN R= ETURN;
830 IF ax$ =3D ad$ THEN fn$:= =3D "";ST :=3D 3 ELSE ST :=3D 1;
900 RETURN
950 RT$ :=3D C$; ST :=3D 4;= pre>
960 RETURN
1000 fn$ :=3D fn$ + C$
1020 IF LEN(fn$) < 2 THEN = RETURN
1025 fc :=3D VAL(fn$); ST := =3D 6;
1030 fn$ :=3D STR$(fc+50);
1040 RETURN
1200 IF (C$ =3D CHR$(3)) OR (= C$ =3D CHR$(23)) THEN ST :=3D 5; CR$ :=3D ""
1210 RETURN
1300 CR$ :=3D CR$ + C$ ; C$ := =3D "";C4$ :=3D "";
1320 IF LEN(CR$) =3D 6 THEN G= OTO 1400;
1340 RETURN
1400 C1 :=3D VAL(CR$[1..3]); = C2 :=3D VAL(CR$[4..6]);C1$ :=3D "";
1410 C1$ :=3D CHR$(C1) + CHR$= (C2);
1415 C4$ :=3D CRC$(4,cm$)
1420 IF C1$ =3D C4$ THEN GOTO= 1500 ELSE ST :=3D 1;
1430 RETURN
1500 ON fc GOSUB 2100,2200,23= 00,2400,2500,2600,2700,2800
1505 ST :=3D 1;cm$ :=3D ""
1510 RETURN
2100 ET :=3D INSTR(7,cm$,";")= ;
2110 FOR I :=3D 1 TO mx
2115 IF N$(I) <> "" THE= N NW(I) :=3D 1;
2117 NEXT I;
2120 IF cm$[7..ET-1] =3D cf$ = THEN GOTO 2125 ELSE 2130
2125 SB(CHR$(6),3,ad$,fn$,RT$= ); RETURN
2130 SB(CHR$(21),3,ad$,fn$,RT= $); RETURN
2200 S :=3D 7
2210 FM :=3D FREE
2220 IF FM < 1000 THEN SB(= CHR$(21),3,ad$,fn$,RT$); RETURN
2230 E :=3D INSTR(S,cm$,":")<= /pre>
2240 ix :=3D VAL(cm$[S..E-1])= ;
2245 IF ix > mx THEN SB(CH= R$(21),3,ad$,fn$,RT$); RETURN;
2250 ET :=3D INSTR(E+1,cm$,";= ");
2255 IF ix =3D 0 THEN cf$ := =3D cm$[E+1..ET-1]; GOTO 2270;
2260 N$(ix) :=3D cm$[E+1..ET-= 1];
2270 S :=3D ET+1;
2280 IF cm$[S..S] =3D CHR$(3)= THEN GOTO 2290 ELSE GOTO 2210
2290 SB(CHR$(6),3,ad$,fn$,RT$= ); RETURN;
2300 E :=3D INSTR(cm$,";")
2340 ix :=3D VAL(cm$[7..E-1])= ;
2350 N$(ix) :=3D ""
2360 ET :=3D INSTR(E+1,cm$,';= ')
2370 cf$ :=3D cm$[E+1..ET-1]<= /pre>
2380 SB(CHR$(6),3,ad$,fn$,RT$= )
2390 RETURN
2400 cn :=3D 1;
2402 SB$ :=3D "" ;VL$ :=3D ""=
2405 FOR I:=3D cn TO mx
2407 IF NW(I) =3D 0 THEN GOTO= 2420
2408 IF N$(I) =3D "" THEN GOT= O 2420
2410 SB$:=3DSB$+STR$(I)+":"+V= $(I)+";"; NW(I):=3D0; IF LEN(SB$)>bl THEN GOTO 2445
2420 NEXT I
2430 SB(SB$,3,ad$,fn$,RT$)
2440 RETURN
2445 SB(SB$,23,ad$,fn$,RT$);R= ETURN;
2500 cn :=3D VAL(cm$[7..9]); = GOTO 2402
2600 E :=3D INSTR(cm$,"=3D")<= /pre>
2640 ix :=3D VAL(cm$[7..E-1])= ;
2645 ET :=3D INSTR(E+1,cm$,";= ");
2650 LVAL(N$(ix)) :=3D VAL(cm= $[E+1..ET-1])
2660 SB(CHR$(6),3,ad$,fn$,RT$= )
2665 V$(ix) :=3D STR$(VAL(N$(= ix)));
2667 NW(ix) :=3D 1;
2670 RETURN
2700 SB(CHR$(21),3,ad$,fn$,RT= $)
2701 RETURN
2800 FOR I:=3D 1 TO mx
2810 N$(I) :=3D ""; V$(I) := =3D ""; NW(I) :=3D 0;
2820 NEXT I
2825 cf$ :=3D ""
2830 SB(CHR$(6),3,ad$,fn$,RT$= )
2840 RETURN
3000 fn$ :=3D fn$ + C$
3010 IF LEN(fn$) =3D 5 THEN G= OTO 3100
3020 RETURN
3100 IF fn$ =3D "FUGGA" THEN = GOTO 3200
3150 ST :=3D 1; fn$ :=3D ""; = RETURN;
3200 WADO(7,-1);SDTTY1;SYSDIA= G :=3D 1; STOP;
7000 ON er GOTO 8100,8200
7100 RESUME 100
8100 RESUME 100;
8200 er :=3D 1;
8300 VL$ :=3D "???";
8400 RESUME 2410;
9999 END
.TSK 4
10 ON ERROR GOTO 200;
15 TSKFRM$ :=3D:(S:2) -- outp= ut format - transmission of float values
20 VL$ :=3D ""
30 FOR I:=3D 1 TO [3]mx
40 IF [3]N$(I) =3D "" THEN GO= TO 60 ELSE VL$ :=3D STR$(VAL([3]N$(I)));
50 IF VL$ <> [3]V$(I) T= HEN [3]V$(I) :=3D VL$; [3]NW(I) :=3D 1;
60 NEXT I
65 WADO(6,20); -- watch dog f= or task 4
70 WAIT DURING 5; -- value ac= quisition period
80 GOTO 20
200 VL$ :=3D "???";
210 RESUME 50;
500 END
.TSK 253
5 EA :=3D EVADR
10 IF EA=3D$340.ADR AND $340.= ERR =3D 20 AND $340.ER1=3D7 THEN GOTO 30 ELSE GOTO 100
20 ; -- 7 is Watch Dog number= , 3 is the communication task number
30 WADO(7,-1); STOP 3; RUN 3,= 40; GOTO 200
100 IF EA=3D$340.ADR AND $340= .ERR =3D 20 AND $340.ER1=3D6 THEN GOTO 130 ELSE GOTO 200
130 WADO(6,-1); STOP 4; RUN 4= ; GOTO 200
200 END
EXIT
TSK 254
5555 RUN 3,40
EXIT
\
.PROC SB
ENTRY (IN:B$,Ex,A$,F$,R$)
1050 BF$:=3DCHR$(2)+A$+F$+R$+= B$+CHR$(Ex)
1060 CR$:=3DCRC$(4,BF$);
1070 BF$:=3DBF$+CR$
1076 FOR I:=3D1 TO 15 ; PRINT= CHR$(255); NEXT I
1100 PRINT BF$
1200 WAIT DURING 1
1500 CLITTY1
7000 ENDPROC
EXIT
-
Related pages: