- is
1 e8 ]3 {" k, H6 r2 N# R - r:real; file:string;
+ K' ^& L6 n4 B/ Z) v - do
) A9 \ }5 G- F! U0 v5 c - openConsole;) G* \! {& y6 ?+ q: u% F& L
- 5 }' Z8 K( Q' j- u1 F, m
- /*
) n n6 U9 V2 p B - file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",3 G7 y/ J' l }
- when is64BitApplication then 64 else 32,
1 \+ Y) a9 P9 x$ d7 c - "bit.dll");+ @4 A6 k( a. {; i" k" R9 p/ f
- */
3 O" X! w5 _' m0 ]0 \* Z - file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";
) R* ~8 Q' W$ J& a8 F# H - local j := loadLibrary(file);
7 u, }3 A6 i7 v3 E6 K4 h: @ - ' d9 ~7 t) P8 W# v# x9 k
- if j > 0 then
0 ~: q; Q3 w6 s# L: C" \- ^- W - print getLoadedLibrary(j)," is loaded.";. ^, z. s( l- @. \
! b/ U- X0 E0 O& z: R- r := callLibrary(j, "calcSin", PI/6);) L0 `+ x& {( o
- promptmessage(to_str("sin(PI/6) = ", r));, q; Y. b0 q' |7 t
- 0 ^- f! u1 D5 f" w: i: |
- local str:string;
: z/ `$ d5 _6 Y3 u$ b. _ - str := "I'm OK!";0 V6 S$ w# Z0 D9 n
- str := callLibrary(j,"resetStr",str);- W# B, R4 h8 Q) r6 K
- promptmessage(str);" W0 A" h; c0 Q& P7 \. N
- 7 H" m3 Q3 }. ]/ b
- callLibrary(j, "listAccess", Tablefile);% K" C5 _% N, L U7 t
-
1 {& v z) `0 s4 l, `2 Q0 d5 Y - print "Unloading: ", freeLibrary(j);
7 S9 n8 ?2 q1 B: _& B - end;* t1 Z8 r: Y( K
- end;
% _" m- E, E; z
复制代码 |