- is
1 Y, ], s/ O& d. s: O5 I - r:real; file:string;* ^) f$ r0 Z% N; a7 h1 P
- do
5 t5 E5 }- x- r0 B7 }2 u3 N" [ - openConsole;4 u( I+ ?/ P+ ?3 X7 g/ C2 |
- e$ B! j9 Q+ O j3 X
- /*
8 Q' y$ F* b" U - file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf", } ^3 X: @$ K0 _6 w; z
- when is64BitApplication then 64 else 32,
- G2 c r3 C, P, t) H. w' C - "bit.dll");2 J+ x1 ~% W/ o6 h1 M( X7 L
- */' J% Y1 J* f2 p4 t1 M3 `9 d
- file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";# C; o5 J0 j7 f( O5 ]
- local j := loadLibrary(file);
/ J3 ?0 h5 `; Z0 y1 V
* r1 M% p# q$ \3 w. K, H- if j > 0 then0 X& \3 s" `! D# d# x/ u
- print getLoadedLibrary(j)," is loaded.";
9 n- ~: ?% c% C9 |, A - I! q8 I$ d# C) O5 N% @
- r := callLibrary(j, "calcSin", PI/6);
* t! f/ i" x6 v( r W( c' O% G9 A1 _9 Q - promptmessage(to_str("sin(PI/6) = ", r));+ g/ j. I/ J9 W4 @4 T! C& d# E
- * `8 D$ `$ Q. u W9 f% j$ f
- local str:string;
" v$ r3 k* s+ o; o - str := "I'm OK!";( \. K: h" q* X. v
- str := callLibrary(j,"resetStr",str);
. [6 P% r( @# @ h8 } - promptmessage(str);/ t |' r; V d- m" i3 Z: i
-
; l3 U1 \3 c) g9 I, l - callLibrary(j, "listAccess", Tablefile);6 P: ~- R1 g# @: G0 `1 R
-
6 c v' u$ h S; U9 y - print "Unloading: ", freeLibrary(j);
; Q0 t' O) a) l% U - end;2 F" D" h( F, q* ^' ]) a% u/ Y
- end;
# F" |$ G( b: L( ~+ w1 x E/ i0 t, J( G
复制代码 |