- is& [$ g# v) ]3 K- l. O8 ?! h- s" A
- r:real; file:string;
/ ~# k' K5 T7 o! E; m - do& e" J( Z4 J6 e6 ?1 Q3 e/ G6 E
- openConsole;1 }& ^/ Q: C$ I- K! E3 [# e" R: w
- & x ]: G+ [4 ?4 b) h
- /*
$ I! h* J2 j7 C4 W [! C" Y3 d - file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",
5 z; D1 j9 k9 X5 i! _7 m5 | - when is64BitApplication then 64 else 32,# E8 {) @7 g* M$ [6 z% p( n8 p. q
- "bit.dll");/ j) G, Z/ E" M: f1 b# k
- */
( \) Z; F. Q# E - file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";
; I& g5 E. G$ |, L( Q. v6 d& Z - local j := loadLibrary(file);9 M! J7 Z% _; N" z' l
0 ]: S6 f5 b8 \) L; b- if j > 0 then4 Y& L1 O E S ~; E- U7 Z* r
- print getLoadedLibrary(j)," is loaded.";
) t7 |/ P6 _% H! P3 N
Q0 a4 u( w* o/ _, N! Z6 W- r := callLibrary(j, "calcSin", PI/6);
0 m+ C. \# y% B6 \ D - promptmessage(to_str("sin(PI/6) = ", r));5 U _- y1 F% j5 ^( _9 H
-
+ u6 k& u/ R+ U" \2 A6 L! b' @ - local str:string;
$ x. L7 s' B& I& j) y% N( M - str := "I'm OK!";& v+ I) W3 N/ x$ e% F, U! _
- str := callLibrary(j,"resetStr",str);0 K$ n Q# [4 }+ Y/ ], ]! x0 ~
- promptmessage(str);0 p/ B" U. O6 v
-
5 |2 a8 Y& n% ^" w. d) m - callLibrary(j, "listAccess", Tablefile);9 ?" F* E( N( J0 [5 v$ U3 [* i
-
" u1 Z' w" l6 ?% @5 M+ I - print "Unloading: ", freeLibrary(j);
' u+ W; x* G, x9 N% K V) |" | - end;
/ ?! `$ F9 l9 k2 T8 N7 m - end;8 ~- n7 X" j$ r
复制代码 |