- is r2 R) v: z6 l) h, s% E0 T2 ?8 ^
- r:real; file:string;3 j1 e9 M0 s5 U, W: \
- do3 \9 |* W' U2 W+ L
- openConsole;
" A8 {/ B4 m5 x; w& S! m - : r8 r) l* {( @# j
- /*# L+ Y, ]0 Q+ ^; Y' b$ k! E" D! X
- file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",
4 t; \% {4 ]3 P" k/ Z - when is64BitApplication then 64 else 32,8 j4 ?1 ?4 i8 e( f5 J
- "bit.dll");2 z, o& ^! [9 m# t; @
- */9 e, ~* \' \; Q/ s8 B0 r
- file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";
, K/ j1 [5 g) U6 @* E2 l1 a- ] - local j := loadLibrary(file);; S/ o% \6 Z( f _
- 2 K, K+ } i) ^8 d- J' J
- if j > 0 then
& J! t, M- v7 h - print getLoadedLibrary(j)," is loaded.";
& M' F6 ^: J! P% x+ i - # B6 e+ x/ Z3 i, R( S
- r := callLibrary(j, "calcSin", PI/6);; r& `; h6 b _6 b2 D7 n+ M, H
- promptmessage(to_str("sin(PI/6) = ", r));
E0 _; G) A" Z; b4 ~ -
+ f" F6 M; @4 z) n: ?6 j% ] - local str:string;
/ ~' i; t4 B8 e M( C+ X3 m5 l - str := "I'm OK!";, v+ Y4 `6 j) _5 s# x# Y
- str := callLibrary(j,"resetStr",str);
9 N$ Q) q" Y# Z9 T; q2 y+ m" N - promptmessage(str);0 S+ Z9 ]6 H: E
-
$ f) C, X; ]* [5 r6 G1 I - callLibrary(j, "listAccess", Tablefile);# R4 @' @' |5 w( V* O5 c7 C7 K
- . ]* t& A, T) A. r
- print "Unloading: ", freeLibrary(j);4 M4 l& I8 D1 `( y
- end;3 A- y+ @' O, D& b& _# r# c2 @
- end;
4 C. B- M( q3 ]/ \8 d& @
复制代码 |