- is
* H% p: v( `, u2 m - r:real; file:string;& H# }" ~3 |' x1 F6 y& p4 u+ A
- do
4 G% C4 M8 K* N# o9 T+ h9 X7 o - openConsole;& O! I, C1 u- M/ M- C. q! h
- / B; y( h) k5 @/ P8 Q! ^$ _
- /*! [( a4 x! \' B4 l
- file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",
8 u( [0 A( | |* o w- y! S. ~: B( p - when is64BitApplication then 64 else 32,
0 r0 g; c: I; n) X9 k - "bit.dll");
& M8 b6 V5 {+ Y) s) v5 i( q5 r2 o - */
! A A) \. x8 ^* }- D* |' ~ K - file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";( s9 P5 O" b# g& e2 B
- local j := loadLibrary(file);
9 f: e9 z# Z4 C; _" s
5 x+ z' K8 Z+ {( ]! w' y( k- if j > 0 then* E1 | {0 }, s0 w v
- print getLoadedLibrary(j)," is loaded.";! l. U- Q/ _. ?& e: C. t
- {( L+ ~; K0 ?1 ]2 f
- r := callLibrary(j, "calcSin", PI/6);
2 Z3 n& t* d$ _. w! G5 L) q6 q - promptmessage(to_str("sin(PI/6) = ", r));
1 Q9 \' `% V! D7 h/ h b -
) a8 Q8 I/ _: a i3 m9 }. z a - local str:string;
4 K$ u a y9 N$ a8 y - str := "I'm OK!";" H5 [! A9 N5 C( ?
- str := callLibrary(j,"resetStr",str);+ R- o4 {. m/ r0 P0 U
- promptmessage(str);* ~, } {& P0 N; I
- 3 a" h) e! B. I' {5 }
- callLibrary(j, "listAccess", Tablefile);& d" n. Q9 g6 s* W- C4 F8 H% m8 E
- ( C4 F' {1 b' B' g8 p1 V/ n5 {
- print "Unloading: ", freeLibrary(j);
+ ~) e. k$ Y6 j6 M: d - end;6 i6 h) V6 [$ m7 \
- end;' V. ~2 Q- E( ^2 _& e7 L
复制代码 |