- is
3 H, { Z# M5 w' w7 h. |; A8 ] d1 c - r:real; file:string;
: N: n7 o& t9 n9 I' {8 J) L3 V2 Y - do
& X: j y$ ?, R8 V6 q/ `/ X - openConsole;1 @+ r5 J* b! Q# u+ Y5 ^
- B6 D' D! K$ a3 Z- @( X
- /*; ~" ]: [' g# O! ^( o% P& Y
- file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",
$ C0 C: V. u8 B$ r - when is64BitApplication then 64 else 32,8 k. |% A5 M! {8 i
- "bit.dll");
; u" P- I3 h1 l* j( @ - */0 Y3 o4 {: t$ y( m+ `2 w$ W
- file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";
7 r% k& I7 t" I9 d+ ~7 | - local j := loadLibrary(file);
/ c1 s0 N+ @; [5 g - 7 { H# M4 d" _" U( C- K* V
- if j > 0 then
) i/ I2 Y; ~0 j% Y: ?# q( Y - print getLoadedLibrary(j)," is loaded.";0 M y0 E# ?- R6 P# |4 j
7 j; H5 U( V3 p' d7 r- r := callLibrary(j, "calcSin", PI/6);
# c- u8 ]2 [7 \) {8 N& w H - promptmessage(to_str("sin(PI/6) = ", r));
7 i$ [* J6 q2 g& Z" x& C - + ?" M' O4 w, E
- local str:string;$ ^" ~5 B% M: L
- str := "I'm OK!";: S! f) x8 t4 h/ K( s( C2 |
- str := callLibrary(j,"resetStr",str);
( D, T8 W, f0 p; G& x: |0 w - promptmessage(str);; A4 k# A4 Y5 Y( @0 `# r) D
-
6 y7 n: s+ {8 |! K - callLibrary(j, "listAccess", Tablefile);
0 `+ [& N% Z3 U/ {# C/ X* L - 7 }8 T) [% \% Y `3 {
- print "Unloading: ", freeLibrary(j);
0 M" z0 M3 w) c( [9 N - end;4 f& a: j# w N! S$ A v9 T; O
- end;# N6 J4 G8 ?/ H- n
复制代码 |