- is
* u; _+ ^; l1 A4 \: r' S - r:real; file:string;
6 s$ |9 y `) t8 g& ? e( C, M4 o - do; B8 ^. @+ H! X4 \ E, g
- openConsole;
x; ]7 q) x& A6 ]% j
7 K& o) V1 w, e3 \5 {6 J3 L- U- /*
& G a0 A+ L \/ q0 F6 D6 s - file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",/ e* m% k2 d; a8 T; @ O( X0 ^
- when is64BitApplication then 64 else 32,
% M7 [/ w# |( P, c6 q - "bit.dll");
$ p: i( Y7 @: l3 M( g- d5 F2 ~, b - */
& f6 ] p. y0 h2 q! J E - file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";
5 A, p" o0 S9 v$ a) d - local j := loadLibrary(file);6 {6 {- T2 w4 _* o3 E
- 9 k6 K: L" H N+ R
- if j > 0 then
# `7 ^4 y4 @' s7 S3 W - print getLoadedLibrary(j)," is loaded.";
0 F# X6 [" L# r6 a
+ \; ~& e# q- w. A# a$ F- r := callLibrary(j, "calcSin", PI/6);8 _& A- t# O' x y
- promptmessage(to_str("sin(PI/6) = ", r));
( ~. c; q8 Y, D, M- g9 C - $ u) E) X7 V* o0 R
- local str:string;2 @2 M; p+ g& p! @5 t
- str := "I'm OK!";
8 H8 `5 t; X: v8 }% w - str := callLibrary(j,"resetStr",str);( l m7 w- E6 w
- promptmessage(str);1 d- V, H/ y9 c4 H2 j2 x j3 F" D
-
$ t6 U% M9 O$ r" D7 R0 g* ] - callLibrary(j, "listAccess", Tablefile); a9 _" ^: j' y6 m
-
! Q0 [) x0 e; W& R - print "Unloading: ", freeLibrary(j);
. _# F5 W. J6 r8 h8 m" E/ d - end;
' U: Q9 n$ ^; ]0 O# A, X0 c - end;) M! }/ p8 t+ S, S1 b* H. _% X
复制代码 |