- is
" y/ O7 }2 h8 ^, }% { - r:real; file:string;. i$ E! k2 N$ ^# H8 B
- do
, A' d: n9 a; K - openConsole;
0 ^% C8 }" m# J
8 g# a: `' N# m% r6 i' k- /*: q8 r2 R( k# p! u) e& l# |3 i
- file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",( A5 i, G" a5 e5 q9 l: C; Z
- when is64BitApplication then 64 else 32,
; ^. z( X. p h - "bit.dll");
k$ q$ I; _4 l. }; M O, p1 `) ^( V - */" \, c. H1 Q5 a6 t X8 ]
- file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";# ^7 I) g4 s! A% ^
- local j := loadLibrary(file);
1 q2 e$ D, h9 T6 I) I - 4 ]& Y' m& l3 i: O7 A8 N. H& d2 _
- if j > 0 then- B" t d. T7 k. _: u2 }
- print getLoadedLibrary(j)," is loaded.";
$ _: y; n5 L8 M) q' y% q
! w, U, e. u5 [. W" m+ X7 ?9 O* M- r := callLibrary(j, "calcSin", PI/6);
0 N, A2 S4 s3 ?$ v% w; c) q - promptmessage(to_str("sin(PI/6) = ", r));: V+ G3 X) P1 k- J! i! M% M
-
. u" y7 F* E! _, U2 d4 _8 p - local str:string;
. ~) A7 t( I3 T, j9 @! H8 u - str := "I'm OK!";% t5 I& S2 P6 ?2 k7 \8 P- `
- str := callLibrary(j,"resetStr",str);
. L4 c+ r3 l: t - promptmessage(str);
4 T5 `) o; P. }) a( D" H - + B6 g6 Z8 j; B' X
- callLibrary(j, "listAccess", Tablefile);
8 n/ R% \& I& T& i+ ?$ ?. | -
- s% S0 K, _4 J - print "Unloading: ", freeLibrary(j);
o9 v& B4 p# ?7 E) o- \& r - end;
0 d6 h% x/ U1 Y! |- }& M2 B3 ~% U - end;
8 X" h; y# q+ i0 C6 }( T9 Q
复制代码 |