- is
6 L# p" a1 \ {4 J - r:real; file:string;! y5 m# G/ @: P$ {
- do
9 @; z" v% t7 f* I. M+ r - openConsole;
8 B; S' d$ t; g2 K0 n- v, J! p! l
: f& E1 L/ [+ D- /*2 z5 Z! z; q0 C* s5 o( v
- file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",( `) W2 z/ v8 Y0 J$ y6 v
- when is64BitApplication then 64 else 32,
\ B0 I4 e8 |* K- k* c - "bit.dll");
- x- ?! N) g) S. G - */
2 B; E v2 R: r% Q - file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";- b. |5 b0 o& D/ L# g) r
- local j := loadLibrary(file);- l. ^ V _) y: m m# U
8 W( p& X% |4 E2 z2 j9 b- if j > 0 then
( U! O, K9 C: z! i, \ - print getLoadedLibrary(j)," is loaded.";
& f$ A9 m I5 C. ^3 a/ k" L. @
) }9 }/ a, h" y3 z9 H( o) {7 D- r := callLibrary(j, "calcSin", PI/6);
4 ^) O n, h" z - promptmessage(to_str("sin(PI/6) = ", r));% |+ R# v' u' }
-
1 P0 e( K$ K1 o# P1 G, x/ n - local str:string;
. } ?6 \$ t- t. L' o8 V - str := "I'm OK!";5 }4 { e) L) U) F# X7 h$ W
- str := callLibrary(j,"resetStr",str);
1 R2 \# g7 u/ M3 _1 z$ L; J4 ` - promptmessage(str);8 \) y; ~$ m' \4 C/ |
-
+ T$ O2 L& T6 W - callLibrary(j, "listAccess", Tablefile);6 N2 A) a& D* o
- ! f+ _$ E" ^9 [& Q2 [, B4 _: D) A
- print "Unloading: ", freeLibrary(j);
g0 d. W, I, ]( i* c - end;
! c7 |7 V7 y, c" `4 n - end;
0 w3 D7 W$ T4 [8 `& W
复制代码 |