- is# k# v. v; g( R. @* l
- r:real; file:string;2 d9 f/ m- R% [* T J
- do
_) \6 }2 `/ r: e( W- t3 p0 b - openConsole;
4 Z8 D4 @8 [ h# J& o
5 c" d, w. k' ~/ z$ E- /*
: D" N3 X& N) h - file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",* ~8 d, ? ] T8 u; b0 N
- when is64BitApplication then 64 else 32,) w$ l# f* |! B' O O" V+ R
- "bit.dll");- Q4 N; P4 C5 C) @
- */. ]4 ]3 D* Q1 N& N
- file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";
6 R8 F5 {% I0 A7 G - local j := loadLibrary(file);
( x3 B# W4 p' E' B1 \; x/ `4 E - # R% b1 l2 X* [# T$ M2 @
- if j > 0 then
7 o: g+ D0 V. N0 ]7 B. V0 y- _ - print getLoadedLibrary(j)," is loaded.";
+ c8 t4 M" g' u - " g, \9 T* q H' e
- r := callLibrary(j, "calcSin", PI/6);
- @9 [% r+ A: N! T' K1 O. _ - promptmessage(to_str("sin(PI/6) = ", r));5 C; ?5 e- z6 J/ M
- 8 i4 t, C8 M2 g# {' e, h9 f1 h
- local str:string; a; \3 T5 w( v& |) J' B- |( q G
- str := "I'm OK!";1 t( S# Z1 k8 S% F# \
- str := callLibrary(j,"resetStr",str);
+ O# }5 g/ C, x) m) }" f" ] - promptmessage(str);
$ Z) a! o$ [$ A) z8 ] - 6 j5 \/ c" v0 {
- callLibrary(j, "listAccess", Tablefile);
2 v9 t. a2 E+ W -
" t* A) t/ [& k$ M - print "Unloading: ", freeLibrary(j);
" s, ~7 C5 C9 Q - end;
5 H0 A6 r8 v& N7 W( V - end;) a; ^8 d7 O( J. {8 G
复制代码 |