|
DataMuseum.dkPresents historical artifacts from the history of: RC4000/8000/9000 |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about RC4000/8000/9000 Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - download
Length: 3840 (0xf00) Types: TextFile Names: »adcjob«
└─⟦a41ae585a⟧ Bits:30001842 SW-save af projekt 1000, Alarm-system └─⟦72244f0ef⟧ └─⟦this⟧ »adcjob«
process dcmodule ( opsem: sempointer; var lamsem, netsem, compool, tmosem : !sempointer; var mainsem, s1, s2, s3: !ts_pointer ); const version = "vers 0.07 /"; write = 2; write_control = 6; dc = alarmnetaddr(macroaddr(7,0,0),0); nn = alarmnetaddr(macroaddr(0,0,0),0); sup1= alarmnetaddr(macroaddr(7,9,4),0); sup = alarmnetaddr(macroaddr(7,9,5),0); vch = alarmnetaddr(macroaddr(7,9,5),2); ath = alarmnetaddr(macroaddr(7,9,5),1); vagt= alarmnetaddr(macroaddr(7,9,5),42); at1 = alarmnetaddr(macroaddr(7,9,5),256+7); sic1= alarmnetaddr(macroaddr(7,9,4),3); sic2= alarmnetaddr(macroaddr(7,9,5),3); type aform = record head : alarmlabel; addr : macroaddr; data : array ( 2..8) of integer; end; tform = record head : alarmlabel; data : array ( 1..8) of integer; end; var n, ans, i: integer; adcpool : pool 1 of aform; m, msg : reference; z: zone; \f procedure send ( m : alarmnetaddr ); (* send message to m *) begin lock msg as head: alarmlabel do with head do begin no_of_by:= 30; rec:= m; send:= dc; end; signal ( msg, netsem^); end; \f procedure getcounts ( where: alarmnetaddr); begin msg^.u4:= #hb2; send ( where); wait ( m, mainsem.w^); lock m as buf: tform do for i:= 1 to 8 do testout ( z, "antal = ", buf.data(i)); return ( m); wait ( msg, s1.w^); end; \f begin testopen ( z, own.incname, opsem); testout ( z, version, al_env_version); alloc ( msg, adcpool, s1.s^); msg^.u1:= write; msg^.u2:= 1; msg^.u3:= dc_route; msg^.u4:= #hb1; send ( nn); (* to update routetable in net con *) wait ( msg, s1.w^); msg^.u4:= #hb0; lock msg as buf: aform do begin buf.addr:= sup1.macro; buf.data(2):= 0; end; send ( nn); (* to give local sup an addr *) wait ( msg, mainsem.w^); msg^.u4:= #hb0; lock msg as buf: aform do buf.addr:= sup.macro; send ( nn); (* to give remote sup an addr *) wait ( m, mainsem.w^); return ( m); wait ( msg, s1.w^); for i:= 1 to 3 do begin msg^.u4:= #hc0; lock msg as buf: tform do buf.data(1):= i; send ( sup); wait ( msg, s1.w^); wait ( m, mainsem.w^); return ( m); end; testout ( z, "knudetest 1 ", i); testout ( z, "in sic 1 : ", 1); getcounts ( sic1); testout ( z, "in sic 2 : ", 2); getcounts ( sic2); signal ( msg, s1.s^); \f repeat testout ( z, "ready for n ", 1); n:= 0; while n = 0 do begin wait ( msg, mainsem.w^); if msg^.u1 = write_control then lock msg as buf: tform do n:= buf.data(1); return ( msg); end; ans:= n; (* send n nodetests *) for i:= 1 to n do begin wait ( msg, compool^); msg^.u1:= write; msg^.u3:= dc_route; msg^.u4:= #hc0; lock msg as buf: tform do with buf do begin head.no_of_by:= 20; head.rec:= sup; head.send:= dc; data(1):= i; end; signal ( msg, netsem^); sensesem ( msg, mainsem.w^); if not nil ( msg) then begin return ( msg); ans:= ans-1 end; end; testout ( z, "knudetest 2 ", ans); while ans > 0 do begin wait ( msg, mainsem.w^); return ( msg); ans:= ans-1 end; testout ( z, "knudetest 3 ", n); wait ( msg, s1.w^); testout ( z, "in sic 1 : ", 1); getcounts ( sic1); testout ( z, "in sic 2 : ", 2); getcounts ( sic2); until false; end . (* of adc *) ▶EOF◀