- is4 s# O0 \8 j. K/ j3 K/ D, y7 h0 [
- r:real; file:string;
; E9 x0 ?& d% p9 ]3 {) t - do4 }5 ^( s6 Q" v
- openConsole;
+ f; b! R1 B9 l/ k& @3 j$ Z$ k
0 I2 m7 E/ b. M7 a- j- /*
8 h) S1 I2 N; q# y. y - file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",
( \0 G6 U! z. a! M1 S2 y5 T/ O# m - when is64BitApplication then 64 else 32,
$ h, r8 y2 j# A, {% j - "bit.dll");' w) e( H2 Y: F) K" k3 i
- */; i) X& h* p. q& x4 M% r
- file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";
. K5 T' s! m$ Q0 v; C - local j := loadLibrary(file);2 m' _# U$ V$ g- z( Z
- * T* u8 N6 U: Y+ Q7 V! E
- if j > 0 then1 F: F+ d `" i3 A
- print getLoadedLibrary(j)," is loaded.";
/ I2 V" J8 m: d6 m
2 {$ G! W4 b: T3 |3 z- r := callLibrary(j, "calcSin", PI/6);
( B/ g$ s" S: Q% q; Z) W! k% ] - promptmessage(to_str("sin(PI/6) = ", r));
9 u i& X1 J: F, W -
+ A9 u, a. O: p. G/ a - local str:string;
8 }- N+ }1 g: f - str := "I'm OK!";
, j8 w: J0 F- N* S C! d2 V - str := callLibrary(j,"resetStr",str);5 s7 z" j- O$ E
- promptmessage(str);5 [& h$ X/ J4 z
- ' K5 O$ i5 \: g# W. z R2 Z% N2 ^7 Y& c
- callLibrary(j, "listAccess", Tablefile);' o8 t" J+ L1 i5 b) A" h8 V* v
- 9 J X' |$ |% u, |; U& h$ i
- print "Unloading: ", freeLibrary(j);
0 b! d6 Z: d2 K5 K - end;3 [6 h, W( H" n$ F
- end;
4 @0 s# R# L1 Q0 [. [$ D' ]
复制代码 |