- is
) V- C s) z8 X3 h9 `4 M - r:real; file:string;
+ C5 l2 K8 m/ x - do ~" o }6 w+ ]5 ^
- openConsole;
. ~" c' X8 m/ T' ]! ?
: l! A9 M' w4 ^( m3 C5 t* R8 y% N- /*
R9 H: F, {+ X% @ - file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",
P9 b* T. [& J4 N) f2 a! m - when is64BitApplication then 64 else 32,2 @, a5 L( {/ k2 ^( X7 t
- "bit.dll");
f. U& r: }" R' l% \' \& O4 } - */
1 T; I& d5 L8 \5 L, |5 H- d& l j - file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";4 R7 y4 U0 M i6 ?1 a# [
- local j := loadLibrary(file);1 y$ x9 F- Z/ P% w, o8 @* Y. A
4 D% d0 H# \* Y6 c! p1 @* Y- if j > 0 then
4 @8 C" B& N' b, v8 j5 r - print getLoadedLibrary(j)," is loaded.";" u" v( z+ \9 o) J
- 4 d; i7 d! { f7 D H3 c
- r := callLibrary(j, "calcSin", PI/6);. J( j/ V5 U" g
- promptmessage(to_str("sin(PI/6) = ", r));
5 N, o- n; q# H: T) n7 Z - + v/ V5 X* S" M0 Y6 H+ w
- local str:string;
; b, Z' a% T) M5 T( b" c - str := "I'm OK!";
" c; X. g* N3 f! C. U! i5 S - str := callLibrary(j,"resetStr",str);9 s7 Z: K1 C% Q% i
- promptmessage(str);7 l. _" m1 X5 G
- 2 u1 P4 u3 J6 j* V) W) _
- callLibrary(j, "listAccess", Tablefile);& P. `7 `% a5 m+ x0 [4 H
-
) T: G+ J! s" m2 b7 G: ` - print "Unloading: ", freeLibrary(j);9 C8 \- Z7 O+ t2 ?, e! S$ g
- end;0 K& ?* W2 V# U! g+ q, ^
- end;
& y+ z+ w0 ?9 Z/ k* `
复制代码 |