- is
?1 v; Z8 Q: Z7 a; ] - r:real; file:string;, H. ^0 [. i: \5 M+ |' b9 b. x# R/ l
- do+ t7 Q8 \& C9 Q4 ^
- openConsole;
' V! X2 _3 n# v2 \6 f
, r# N. ]( I: G/ Q- /*" Y* z' B+ t/ E# U, Y; U9 Z
- file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",( H6 p5 F* a: E! d( B0 Z( x
- when is64BitApplication then 64 else 32,
. B) S" s/ }# t- I+ [ - "bit.dll");3 ~, c$ @) R3 l6 Z+ \# T4 T1 ^
- */
- `: _: ~8 t" t( [1 P" i; U+ f. E - file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";
8 P& e# C" A% ^) o/ ^# E - local j := loadLibrary(file);# B2 H9 ^) B) I9 e, [% _' I0 Y( F
7 l: u0 A+ ?) M; x- if j > 0 then& F2 d3 b' X4 Y
- print getLoadedLibrary(j)," is loaded.";
4 Z* Y& J7 y: v4 { - 6 ~3 d9 z: p1 B
- r := callLibrary(j, "calcSin", PI/6);+ x. `# `' ]! f5 J& ], m
- promptmessage(to_str("sin(PI/6) = ", r));; q1 q( ~) o+ I( r. i0 q8 v8 x7 _
-
- i& s; y( X3 o/ D" s - local str:string;! t: C! d/ S+ D
- str := "I'm OK!";
3 ]1 y( a$ r# i, S- r, D/ u - str := callLibrary(j,"resetStr",str);3 |6 u- O- o( m" W# v# {( V
- promptmessage(str);
# I% K6 \. T/ E1 z N( J6 N. _; u, n" m: y -
3 A1 z: ~; z/ x. P% E5 X0 R; n9 l - callLibrary(j, "listAccess", Tablefile);. [, k# N8 s& e) H, b1 d8 D2 z
- * C' _: w1 x" N0 c. {6 M% J, f
- print "Unloading: ", freeLibrary(j);; ~+ m, \- f. K/ F) Z
- end;, F" w0 u7 Q( p% T6 k% y
- end;
% _( x! i, y7 O( v( s# ?+ I. e
复制代码 |