- is& r9 _0 U, ^1 P& P" w9 Q) b$ g
- r:real; file:string;
+ l; X G( s7 P) B - do7 X6 q* N9 U8 [7 |9 j3 q
- openConsole;+ i5 C) b1 L! A+ \% o
- ; [. `6 t. H$ |6 `5 N& r" X
- /*8 n1 W3 |" i+ C
- file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",
# B2 e) L) i/ E - when is64BitApplication then 64 else 32,
C! m3 o; S/ d% a) Z* | - "bit.dll");
$ Q$ l$ _+ T4 @ - */* b/ x" t9 f( q" ~ _- A
- file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";: f, d7 a( Q7 W) j# e# I/ S! W
- local j := loadLibrary(file);
. o- \' Z+ R, m4 V8 M. { - & u# @9 R; s# l- R' d5 ^
- if j > 0 then/ m" r. s0 \1 C! i
- print getLoadedLibrary(j)," is loaded.";
8 x1 Z( z8 j7 N; z5 G/ S/ M# h5 v
' z% K \- m- I" S7 Q3 G- I- r := callLibrary(j, "calcSin", PI/6);
8 H' k9 R* T$ X6 F% x S" _* ^ - promptmessage(to_str("sin(PI/6) = ", r));6 |7 n# S" V. }
- 8 c4 P7 `9 W$ _' |9 f- y1 {7 x( [( B
- local str:string;& ?4 o& c' f8 f4 p; L6 q5 j0 A8 q) L
- str := "I'm OK!";1 g" }$ X4 S: s2 \/ X+ d8 Y9 B
- str := callLibrary(j,"resetStr",str);, d3 M) \" l) C+ t a
- promptmessage(str);0 f2 e0 R$ Z! o
-
$ v) e$ N8 ^( D0 n* x `# N - callLibrary(j, "listAccess", Tablefile);; ~" m; ]. x2 N/ `. z
- 8 N: t/ J# ~9 k% T1 J9 [
- print "Unloading: ", freeLibrary(j);
- g0 G3 U8 k G5 P - end;
5 g; C9 a o f! ~% _4 P6 S - end;
. b D Y8 U; H
复制代码 |