- is
: H! ~6 q* e: y/ C6 `/ m. M - r:real; file:string;6 L. e# P7 I1 `7 \/ c% T1 i6 G
- do+ [) L4 x% Y3 @ ~5 `
- openConsole;% P" j+ M9 [0 ]' h' I! d
- 6 L3 S. k6 d1 Y& p$ j6 S
- /*2 K' `6 R" j! `# t; e) \, B+ z( R a
- file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",- z7 O4 g: c/ a9 \/ Q! \
- when is64BitApplication then 64 else 32,2 C5 r3 ~9 F8 i2 F
- "bit.dll");
% U0 d$ Z3 _ W( P& m& V - */0 |, s2 N4 }$ e0 i* q' b! |6 ~
- file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";- H- a2 z& Y8 o6 w, Y$ i
- local j := loadLibrary(file);" ]5 v5 e1 v3 ^
- " v4 G8 O& b1 q7 C# B- p$ H
- if j > 0 then6 A. e n' H8 F
- print getLoadedLibrary(j)," is loaded.";
# \" {3 _- J' _9 S) {" C- p
3 l& ]/ Z& ]3 t6 C: o8 i- r := callLibrary(j, "calcSin", PI/6);0 P& c2 f. v# P! P# u7 t' C, L: D
- promptmessage(to_str("sin(PI/6) = ", r));! |: f' k) n" b- B+ {& I' T) r
- ( K' S' D' Y- C4 e1 H. a
- local str:string;5 U* A' S" L8 V& V$ A1 a5 M) V
- str := "I'm OK!";5 s! \% l$ e: L: Q( A7 w
- str := callLibrary(j,"resetStr",str);
* A# ?8 }+ |. _6 t8 b: D - promptmessage(str);
2 m$ i Q6 Y! s -
, h& [$ p* `) h1 S - callLibrary(j, "listAccess", Tablefile);
9 e! j3 \& D. l2 d' [ - ( j' X% J& a! b- t1 L J
- print "Unloading: ", freeLibrary(j);
! I8 ~/ S0 q: d% A. Q - end;6 X! H2 o3 F7 K" x
- end;6 w& K8 }( c( |
复制代码 |