- is
) L" v* s* t- X- B8 A: g - r:real; file:string;
4 e; K) L6 O) O+ s' r0 a* [ - do
$ ?* t1 D7 U' z7 v - openConsole;
: Q% z: U& T; m4 a2 i f" ? - 4 H- ]2 `/ Q, P$ Y% p) d
- /*8 V& c" w9 C; }1 u4 e2 ?) S& i3 ]
- file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",/ s7 M: e/ x/ {1 P, K
- when is64BitApplication then 64 else 32,; E1 I3 B6 e$ k+ _; ~6 r
- "bit.dll");- V" Z2 [. \9 ]+ K* M- ~1 \
- */2 J& k( o d* I3 i% U+ C, {
- file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";
0 k9 p, ~, B4 Y! b0 A" Y - local j := loadLibrary(file);
7 u/ X& i0 B1 [4 m - ) k& N. V( ^; w
- if j > 0 then
( \$ t1 ^! R% X( D+ N - print getLoadedLibrary(j)," is loaded.";( s1 O3 t$ s7 [- L; O) Q. k0 H+ \3 m+ N
- 4 G* G! T2 x2 R$ Z7 P0 ^! W
- r := callLibrary(j, "calcSin", PI/6);& [. t& h0 a' S2 {& `3 @4 g" ]+ \
- promptmessage(to_str("sin(PI/6) = ", r));
) c7 q0 \' U S+ v5 s -
' _' {. @! D- e - local str:string;# M* V$ [6 P% N9 r" Z/ `
- str := "I'm OK!";( @9 j7 D5 {. p! I9 n1 ~- }
- str := callLibrary(j,"resetStr",str);! M( l& s% f+ V7 j/ X
- promptmessage(str);
9 f; v1 ]! V& ?8 B - 8 O$ }/ u- b0 c% o: D) t8 v' q
- callLibrary(j, "listAccess", Tablefile);
, e6 q9 F7 Y: F, b" f -
$ l3 e) e$ e! d* W7 ^ - print "Unloading: ", freeLibrary(j);% _' x3 h6 h# \4 T6 N0 e# J% b
- end;
# C. b3 ` ?# Q* @1 n - end;
& [, ~" H# Q G/ |5 x* A/ j
复制代码 |