- is @* K7 I, b7 u. R
- r:real; file:string;
O2 s8 x+ e K( j. @( V1 G - do
/ G' T" K2 v# f - openConsole;7 y8 B; M8 a3 v' ]$ ?7 g
7 u; v. f0 o0 B6 [5 @% g% R9 N- /*2 |$ m: [' W1 J8 F! \
- file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",4 Z* c. I- y; ]3 I
- when is64BitApplication then 64 else 32,# b+ A2 e. F9 N. [% h
- "bit.dll");5 Z. R2 w' J; ]
- */
, X4 n' Z( l& e, H - file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";
Q6 ~( {$ z' u2 G- `/ j. k - local j := loadLibrary(file);
; b" x* o; {: h( |8 G; S( Z b - 5 `8 X, P: T: a+ v( L- H
- if j > 0 then' Y2 i- J; Y) w! H5 D
- print getLoadedLibrary(j)," is loaded.";7 l i' D0 K: K$ V. ?
- . _$ `; }3 p2 {* Y2 {
- r := callLibrary(j, "calcSin", PI/6);3 L( p0 w1 Q2 P
- promptmessage(to_str("sin(PI/6) = ", r));
5 k' v }: B: U4 t7 ~ -
+ F3 `0 J, I) D, D' Q9 V - local str:string;
. D# N* G: s4 }) X/ u - str := "I'm OK!";4 O" a! P! j$ H0 g1 V- n
- str := callLibrary(j,"resetStr",str);0 l7 q Q6 `& S
- promptmessage(str);
" k5 R$ j/ }8 g! A& a -
. Y, n- z8 q. V- L! I! n( K: l - callLibrary(j, "listAccess", Tablefile);$ h; U! k0 P6 v5 Z
-
) u7 e4 D% j2 X; |0 ^8 O - print "Unloading: ", freeLibrary(j);
3 g; ^. T; X$ E' G+ l) U - end;) ~& w& J3 t3 ^5 Q/ {# Z1 |
- end;5 {( z9 a) y3 X2 u* }
复制代码 |