- is0 G' L9 i" w; E/ @# k! X* x: R
- r:real; file:string;
( O$ x f# f; z- f - do
8 E; g. @- ?* D, ]: P$ \ - openConsole;
+ m% x5 c6 A5 E* e) R% `9 _+ w/ s
G& W8 U/ O3 E7 A- S8 e- c# ^% @. S- /*
: E8 V: n9 l& \" p - file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",
+ I, W% @; v, C - when is64BitApplication then 64 else 32,0 W- v( j& ~9 l& K( P- ?
- "bit.dll"); Q# {. E+ i- L z* F
- */
: [8 N% ^& V: a, O: d* y$ ^ - file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";4 K* D! i4 U9 S5 w R. z5 S
- local j := loadLibrary(file);
, Z$ r* N5 J* b) @% o/ B2 l: ` - 1 F- S3 j9 j2 x! p
- if j > 0 then ~, A. g }! u1 [, T
- print getLoadedLibrary(j)," is loaded.";
9 e t) m2 F- k7 m/ Z, ?2 R
! l, m* n2 d6 l8 c% N- r := callLibrary(j, "calcSin", PI/6);9 P3 k9 H" ]/ x# {4 l, p$ o
- promptmessage(to_str("sin(PI/6) = ", r));
l( p; M. V6 L/ C# x% q - 4 C/ S% Y5 @3 o2 v
- local str:string;8 u! Q% L& i) Y9 Y; m3 |
- str := "I'm OK!";
0 y$ h+ ~' d1 o8 E. ?4 C" R - str := callLibrary(j,"resetStr",str);
' u4 U9 S& @* D; C3 k" t8 ?3 p - promptmessage(str);
0 E4 s3 {) q9 X9 i2 Q - 7 z* S8 A6 @. @, R5 U! V
- callLibrary(j, "listAccess", Tablefile);, ~7 z4 [$ I( g+ h& E' b/ S
- 2 q7 Z! B+ |) J1 o0 C
- print "Unloading: ", freeLibrary(j);6 n" S" [ w8 {9 I) _7 F
- end;% o- m7 U; u) y, H8 M( n( V
- end;
0 @) V& R. J6 z) H
复制代码 |