谢谢shakie的耐心解释,我按照你的建议改了代码如下(并在window窗口定义了L_null);# p1 j ?5 u ?: P1 Y3 g
begin model initialization function
; z, B5 d% E5 @& x6 @ create 1 load of load type L_null to P_Creation27 Z# ]& N+ F& Y) V
create 1 load of load type L_null to P_Creation3
P1 e- U5 V* P) R) G8 l create 1 load of load type L_null to P_Creation4
/ g2 W8 C9 D3 P% t) \ return true
, X9 B3 a9 Q- c0 s+ G! e eend
& c/ {& I; o2 p8 `5 ?' f1 N: H# b0 k2 H2 {) [
begin P_Creation2 arriving procedure
O, T/ }0 s# Vwhile 1=1 do
2 k; s+ G' h8 x5 C4 W ? begin# r. e/ i0 D$ U, i ]: w
wait for 1 sec
9 P- K8 G2 \4 [" Z- q( Z; [+ X5 F+ y create 1 load of load type L_C2 to oneof(0.2 _In2,0.8:die)
! g8 R7 J2 V) j5 i7 i" ?* ] end R- o7 L; p) B+ f0 w
end; X5 P6 B. D( B( m9 H" r, E
& E, A- N$ Y: |. R
begin P_Creation3 arriving procedure
7 L: C* R2 i8 ywhile 1=1 do
/ f- o+ C% ^& h0 D8 R- M: C" s begin
6 _# S+ D3 J2 T* @: w B% Q wait for 1 sec/ o6 u' b( e# C! N3 H
create 1 load of load type L_C3 to oneof(0.2 _In3,0.8:die)
4 S w) A, g [: ~* X& K end
* a( ~! M! h8 b: k3 e( [) rend 3 m% W2 a% q' C7 g. ^; M2 g0 `
5 c6 y/ a6 H( C8 @begin P_Creation4 arriving procedure
4 V# M! k1 @, ?% k3 m; h( f- twhile 1=1 do; I: l% U' U* i; B6 _; |
begin
6 G5 u0 J, Z7 g G Y. f wait for 1 sec
8 i. X" j$ o, p, q create 1 load of load type L_C4 to oneof(0.2 _In4,0.8:die)
" C8 A, [. k5 B. K4 o! C8 W, e' B end
3 `2 O3 X2 i) X$ }end. V6 _; l/ w2 s9 l! H
: M3 I6 z$ ?+ S- c1 B- Y' ?
但运行时仍然出现相同的问题(提示:ox100f5e09指令引用的“ox00000028"内存。 该内存不能为"read"),无法运行。不知问题出现在哪里,请高手指点,多谢! |