- is; H9 T4 R# b+ b: \, s5 p5 L: x/ I7 L; s
- r:real; file:string;% S+ z/ d% P& k5 T) s+ [
- do
7 t6 s; g( b! L) }% s7 s T - openConsole;6 z' n- `: t0 K N5 ^
- / \, c+ W$ e; K% N6 K+ o. h
- /*
2 ?" w8 t4 r* A7 l- S. [ - file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",7 b& q: g- t/ U" T
- when is64BitApplication then 64 else 32,
) B* M# q6 x' v$ |1 d! `2 E4 d - "bit.dll");( w# g' k5 [$ P, r1 o
- */
- L1 e* S* f' D& B - file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";
% k" [! _- E# Y/ Q$ ~ - local j := loadLibrary(file);% G: K, @% h0 ~) l, ]2 d8 O( n
- ' X; K' m: F! ?" U8 t
- if j > 0 then
7 Z/ @8 @( j5 X, [% f, F' E/ ?' e4 e% c - print getLoadedLibrary(j)," is loaded.";
4 h" t$ q0 b% [# L t T* p
/ i# \ p6 _$ p" o! x- r := callLibrary(j, "calcSin", PI/6);/ ]$ {* f4 l7 B2 {& u, b
- promptmessage(to_str("sin(PI/6) = ", r));
' Q. L8 F. Y* D8 t - + C. ^3 A ~9 L0 c/ |' y4 I8 u4 i
- local str:string;% G; d. v. O4 i- m+ ]
- str := "I'm OK!";5 b0 d' X) i! a+ F6 ?
- str := callLibrary(j,"resetStr",str);
5 _/ s4 [: |8 G - promptmessage(str);% F* T. q" M$ U/ U8 Q" Z6 g
-
, E& V6 o8 x5 C7 o - callLibrary(j, "listAccess", Tablefile);! B! ]! l3 U! E( O
-
1 w5 d. ?. I) g7 L4 ~ - print "Unloading: ", freeLibrary(j);+ Q8 l7 B/ W. K3 Z* Q
- end;5 C8 J. ]" o+ @+ \4 `9 G# X- ?
- end;, w8 |0 i+ m' o
复制代码 |