谢谢shakie的耐心解释,我按照你的建议改了代码如下(并在window窗口定义了L_null);' h$ s; |! d* |& A T
begin model initialization function
# w- p! p' [/ Y9 Y2 K* _/ E$ M+ u create 1 load of load type L_null to P_Creation2
" I3 s" E5 Z! l2 F% c create 1 load of load type L_null to P_Creation3+ ^0 [" z7 o% x0 N8 q6 ^" j
create 1 load of load type L_null to P_Creation4/ Y4 l. t. f) V8 Z
return true
9 a/ } l4 n, O( ?4 s) q4 Yend9 o0 F9 E7 ^" y5 _6 {
; a9 q1 d, [2 x+ j; s) _2 d4 S9 h
begin P_Creation2 arriving procedure, \$ o: I& J' @8 a
while 1=1 do# j/ A4 o; E) |8 Q9 M
begin
( W1 e* J) s. f k0 p wait for 1 sec
- K9 U6 D1 E* A3 o0 Y+ ~ create 1 load of load type L_C2 to oneof(0.2 _In2,0.8:die). p- r+ Q" u: H+ a v @. ?
end, e$ Q4 v4 T; V" N$ @
end3 E: K9 l) A- x% a q6 E, e& l
" l: }6 h1 F+ f3 _8 d. \, Fbegin P_Creation3 arriving procedure
, \3 i! e' V1 f4 R$ Awhile 1=1 do# x0 C% S' T; j6 K* Q9 z; s
begin+ S T$ \- r1 b- w8 k3 f
wait for 1 sec
- A n1 x+ r; { d8 d2 z create 1 load of load type L_C3 to oneof(0.2 _In3,0.8:die)
. m2 T. L( A, O# E7 A' r6 u end
, X; I, v, W# N5 d# ~ Kend
6 [; y2 J+ M" D# s5 [% S; ]. o; a. Z( U3 @, @7 Y3 r
begin P_Creation4 arriving procedure
5 Q( h* c, ?, v) t- Y$ A3 _/ Kwhile 1=1 do
) ]% Z) i- o- \3 {: h- ~ begin9 ?/ C W0 w, i& q+ R* O) c" p
wait for 1 sec; j h: u0 F) V
create 1 load of load type L_C4 to oneof(0.2 _In4,0.8:die)
4 ~$ O* r5 O+ ^( j, a4 m+ v) | end& S1 f1 E, v& K0 V0 I6 w* S
end
4 o) L% W8 p2 o: m8 T; d0 j, `( `: _: g! k
但运行时仍然出现相同的问题(提示:ox100f5e09指令引用的“ox00000028"内存。 该内存不能为"read"),无法运行。不知问题出现在哪里,请高手指点,多谢! |