- is: Q! {3 }. ~( r- S" |) N
- r:real; file:string;6 S( L! |: @. |) t: m3 d2 r
- do
1 a% s$ [* m: W% ~% B% l: N& R - openConsole;6 q' _( I: j) t: Q: k+ X7 k
- ! y; V8 K+ q2 r
- /*( T. {$ o9 X" }* t3 X1 i
- file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",
; U8 K5 K/ L* i* b H - when is64BitApplication then 64 else 32,& ]0 E! Z9 O4 `
- "bit.dll");) ^- y) \2 K) f1 j
- */3 H& _; V4 e: M" s: K# g" q F# F
- file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";
. `2 B8 x* T4 {, I/ d9 W2 V: ?5 o - local j := loadLibrary(file);
! g3 b! m" K- C: `1 ~+ q( a
; [/ V1 Y& w; h7 I) u0 ^- if j > 0 then
! H( j2 S( a# u4 ]5 y2 l/ Z - print getLoadedLibrary(j)," is loaded.";
; N l% s+ E4 X% Q
6 L( r1 f; S. Z( W! P/ U4 i- r := callLibrary(j, "calcSin", PI/6);! {/ P, D. K1 B: f
- promptmessage(to_str("sin(PI/6) = ", r));, P, p- d/ l) U/ d7 b# m
-
( s6 g' U' k" h - local str:string;6 `" i2 }! r7 v8 E) k6 A% H
- str := "I'm OK!";# N+ V+ h ], ]) F6 z# @* U ]
- str := callLibrary(j,"resetStr",str);2 Q3 W9 a$ F& q
- promptmessage(str);/ Y# N; C; f) B9 s! ?
-
1 u: B# b: G9 o$ y - callLibrary(j, "listAccess", Tablefile);) X. k6 b: R G$ ]% `$ W, ?
-
& k s9 a( e5 @' R. }+ [ - print "Unloading: ", freeLibrary(j);
2 a' J$ Z @/ k" z4 | - end;1 y, \9 L+ }" S- L% `: V
- end;. ?2 Y6 S8 y9 ~. L3 h; n; X
复制代码 |