- is& |: R! U' f4 G/ H* }2 b( e% W/ L
- r:real; file:string;# p# F2 x# M! w7 Z" S' G% c/ C
- do$ {6 |/ m% V' T ~3 m/ y
- openConsole;7 `3 L {0 ^" C- G! d! G" [% t; s
5 p9 v) T: \5 p2 j- W- /*
0 u6 Q6 y6 o, h+ ]( F5 B - file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",5 M. n1 b# |% x5 x9 K
- when is64BitApplication then 64 else 32,; r8 u& C% C4 f" l+ p$ F! V
- "bit.dll");: l [' ^' ]- @' d
- */
" Z$ K: Z$ d! F# I - file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";
: I' _* l9 ^, P' W% z - local j := loadLibrary(file);1 a/ {; h1 I9 d6 t5 R
- {; X5 g: a9 G' v" g6 o( w- if j > 0 then
* _" x6 s/ B# w3 g n7 f - print getLoadedLibrary(j)," is loaded.";
; C0 m) j' Q" [( m, _0 d - 6 R) p: `5 R& i! r2 z3 s5 |
- r := callLibrary(j, "calcSin", PI/6);
! ^% C- a0 J2 p6 n& P - promptmessage(to_str("sin(PI/6) = ", r));- V1 Z5 x2 D& P' r
- - t' D' y$ a* s5 o" o
- local str:string;% K9 p' ^ r( L: H' {
- str := "I'm OK!";) J- i9 i. g" N6 D' U
- str := callLibrary(j,"resetStr",str);
7 k1 Y. f! t/ b1 z; c - promptmessage(str);' G1 B' E9 X. M
-
" f1 s+ m1 f# B/ F4 ^% }* U9 A - callLibrary(j, "listAccess", Tablefile);
$ Z% t. P8 A d7 L/ B8 x -
! i! K4 h2 G+ ~ - print "Unloading: ", freeLibrary(j);
3 k+ K! k7 d0 l5 b2 x9 B - end;" r' `" i, T1 g: @* s! y& ~, Z
- end;
7 s; D0 g! V2 l4 R
复制代码 |