- is
# b$ f% S8 M1 F, X9 H2 I6 ^ - r:real; file:string;
1 t3 x5 U+ u. D h5 m - do5 [# R7 q6 ]% z( o2 a: E: N, ^
- openConsole;6 R" A$ t! q; [" | b6 i
- ; _( h( n4 L2 r+ N
- /*
; @ @3 N8 V" h; X' I4 s8 q# M: } - file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",( S- Q9 |$ Z8 A- C1 L) F
- when is64BitApplication then 64 else 32,
. J3 E f# _: O5 @$ U+ V& q - "bit.dll");% r: y- x6 \0 h% u6 r
- */$ _5 u: @. N% U6 ~) }; v
- file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";
! a7 y% H! C6 `; \9 g - local j := loadLibrary(file);
. m& c3 h- Y1 m l6 d* n6 C6 D - . G% D6 d+ P& L
- if j > 0 then
, L, p5 o9 l" k+ h - print getLoadedLibrary(j)," is loaded.";
3 w9 J; ^6 H+ e4 N" ]/ _; @4 F - ( g1 F/ K5 C0 i' C% s# \1 \
- r := callLibrary(j, "calcSin", PI/6);3 `( @& M" B. g9 O% n
- promptmessage(to_str("sin(PI/6) = ", r));" ^5 m- k) @7 ]- g* v4 v+ c( l
- # D( t- V; U8 ?
- local str:string;" r- {7 k/ B# |- I
- str := "I'm OK!";& B. |. [4 h q, x0 m- a0 w
- str := callLibrary(j,"resetStr",str);
# j3 J: z8 Y5 X: {. R1 m - promptmessage(str);
' W |4 O( p+ R - # s7 d' ?, B" c; r) V
- callLibrary(j, "listAccess", Tablefile);
) M* p% r# q4 {/ `7 ? - * c4 P2 u( P& h6 g! U* `6 F4 w7 g
- print "Unloading: ", freeLibrary(j);+ I3 ~7 P8 i K# d
- end;+ C. E* t2 Z/ P! u+ |& ^) D, S
- end;3 w2 Z) J7 d7 R3 `4 _, f( b
复制代码 |