- is/ b3 x* \( {; q0 t
- r:real; file:string;
3 ^! w, l3 K- q6 O8 P6 b$ \0 \# h - do7 q/ A" e! o! C! f4 U
- openConsole;8 G" O: a- o- H/ F f
- , S& @5 n1 d1 H) f0 t
- /*
/ A' d- o: p1 c3 e - file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",
h& y) f3 {# V. E$ a8 A1 B( m: U8 d3 N - when is64BitApplication then 64 else 32,
# c5 L- l5 o. }9 t9 | - "bit.dll");% H, r- a1 H' p* S( x* o
- */ M' h" ]5 Y2 z$ I# r9 E3 o
- file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";/ U8 m! v- Q9 m# C( X( r# \
- local j := loadLibrary(file);
( G% n1 _6 I: Z9 r - 2 \# Q2 m0 C" \- _
- if j > 0 then- K; w* k1 ]8 @& z1 }7 k
- print getLoadedLibrary(j)," is loaded.";' j0 G: @7 r5 y# ] S Q
- 7 r: e% I3 ?9 y% o
- r := callLibrary(j, "calcSin", PI/6);
- E. C& f& `5 a h1 s - promptmessage(to_str("sin(PI/6) = ", r));
7 r5 I |1 _+ P) h* t6 Q -
" Q& A. q8 Y f0 @6 J - local str:string;1 k+ Q {4 B- h1 [2 S" ]
- str := "I'm OK!";
7 e! F% }0 C6 @7 ? - str := callLibrary(j,"resetStr",str);
) t& Y: e$ Q2 b6 X& b - promptmessage(str);4 w+ d; o9 g& v& A$ [
-
. F+ Z. P# {, j5 A" o7 ? - callLibrary(j, "listAccess", Tablefile);
# i7 o* ]% L" X) W -
" F9 E; i" |( z( p- z% o - print "Unloading: ", freeLibrary(j);
4 L& E2 O, K2 A. l& \, R* M4 f - end;
# l6 k% J2 y3 C, ]8 B0 N7 b - end;, _ g0 L8 ~3 X+ d! M1 a$ e
复制代码 |