谢谢shakie的耐心解释,我按照你的建议改了代码如下(并在window窗口定义了L_null);5 z2 x/ Z+ p P/ b$ t& d4 J5 f
begin model initialization function
9 y! F5 S3 a' z create 1 load of load type L_null to P_Creation2
* [& I) w$ a6 r" z' e create 1 load of load type L_null to P_Creation3
- X2 R" d9 ? E2 T( B5 j G create 1 load of load type L_null to P_Creation4! D- Q. r, t, E/ D, ^- T: C
return true
0 }) g8 s$ v+ d2 S4 u4 Dend
5 N; t4 ]& p* G/ b& n+ {$ K" B! F8 V
begin P_Creation2 arriving procedure
, e, F3 e* w) h% C4 pwhile 1=1 do
9 r- k0 ^. T% D Q# t. @1 a begin
% Z' k9 [- s W9 w wait for 1 sec
* i3 i$ q( O. x; e$ L3 Q- H1 h create 1 load of load type L_C2 to oneof(0.2 _In2,0.8:die)
1 w* e2 y: A! G8 x end1 c- ^ o8 X) K O, }2 I& D
end! K& ]* z% U1 M" P
v! M" y1 Y8 m9 abegin P_Creation3 arriving procedure5 b0 P& m+ J5 q6 ]9 f
while 1=1 do& L9 [; v% @' E t
begin
) i: Z0 R$ }& U6 N, P; t wait for 1 sec
8 n5 U, \ ~' a5 n/ ^5 m create 1 load of load type L_C3 to oneof(0.2 _In3,0.8:die): b6 |, D7 n. @' z. o
end
& t4 C# J& f& C- ^! O9 Jend
0 X) B8 q5 ?8 m, q6 g# _
2 x. K6 j/ ^" R% O& U9 Q7 pbegin P_Creation4 arriving procedure
) Q6 m& i& t' b3 B, Ywhile 1=1 do, F! m% D! o' V# p6 L
begin
% |) Q s/ _! l2 |& f' |6 y. q wait for 1 sec
0 W5 c! t! m9 J; k create 1 load of load type L_C4 to oneof(0.2 _In4,0.8:die)4 Q# N! X' ]9 n
end
/ x* D# T+ b" kend
( H; q: C" V6 U2 V4 [! c, M, F: O; B. ^
但运行时仍然出现相同的问题(提示:ox100f5e09指令引用的“ox00000028"内存。 该内存不能为"read"),无法运行。不知问题出现在哪里,请高手指点,多谢! |