- is
. `; ]0 x) I5 j2 { - r:real; file:string; W! t0 B1 P- W. ?; G
- do
0 N% O' k2 X4 {" }+ L( ? - openConsole;
: k8 y4 s" [0 G- ^1 q
' n. q% |! a* X( a( z& M9 S& O- /*
3 Q1 [( l" S+ B - file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",% K9 ^( ]/ V( J _& r
- when is64BitApplication then 64 else 32,. C1 f0 `) U+ S4 S& |- o
- "bit.dll");
2 m( s. K+ d6 C( p+ d - */9 m# A& u. n4 C. l
- file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";% X/ }/ k7 c" d( T/ x
- local j := loadLibrary(file); j; |' c. Q" `8 R5 r
# [: z# ~, [8 i, H- if j > 0 then( T; E/ h! R% v) X( V
- print getLoadedLibrary(j)," is loaded.";( D# V9 T$ g* Q# O f: w# u4 G: s
- 0 J5 W: L, `1 g9 E) c; ^7 m
- r := callLibrary(j, "calcSin", PI/6);, b5 e/ z" _: H7 e3 m' `
- promptmessage(to_str("sin(PI/6) = ", r));! g' Q B- B2 T( ~5 ^+ z* O5 a, o
-
7 I, r: m+ b& f; Z; m+ z - local str:string;
# S, a4 s# O( @0 Q+ A - str := "I'm OK!";% l; }9 o6 h/ E: |$ b+ S3 A9 T1 Z
- str := callLibrary(j,"resetStr",str);
' |/ t1 @+ M1 C, W% M; e( ~ - promptmessage(str);+ d9 O; \5 T' z9 ^8 }
- % U( {7 l: O' x- m
- callLibrary(j, "listAccess", Tablefile);
# K9 `* q' U$ @1 P0 }+ L- e# j -
+ f8 a; ~$ z( `/ M7 m - print "Unloading: ", freeLibrary(j);
9 R+ X1 A8 M& _. \" `4 L( i - end;6 t: f s1 [* ]" D3 G
- end;
5 q% J, X$ j6 K" n7 b# @" T
复制代码 |