- is
# y# `5 n4 g( a2 k - r:real; file:string;" Z# S9 R5 Q. i4 C7 o2 W5 Y/ U
- do. }' @* f6 o( @" T( T
- openConsole;6 G" T: d0 a* r; _( b6 w1 ?! |
n& v. E# W1 `, y) v- /*
( g8 K7 P3 l2 W% ] i/ r - file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",
' i* P3 s+ P, x; [. O( h - when is64BitApplication then 64 else 32,
* L7 b% `0 Z& @; [- Y. L+ w" A - "bit.dll");
# e1 K. `" M7 K3 l$ t, n - */( K4 I |2 s1 v
- file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";
O5 Y& {9 t. k - local j := loadLibrary(file);9 K: w* u' v1 Q% Q8 p
$ p# v- D* ?% z, G- if j > 0 then
3 @# Z( e& L! b - print getLoadedLibrary(j)," is loaded.";' t5 f2 A$ O& e
- 4 r# ^8 K3 B6 s& i" `6 f# M: Z
- r := callLibrary(j, "calcSin", PI/6); C7 {. R @3 O" ~( A) q9 Z5 g3 B
- promptmessage(to_str("sin(PI/6) = ", r));
) U" R# W6 S, ]- n* n4 H" P6 d - " f4 E$ ~: l) H( A- }9 ~, U& y
- local str:string;7 E% d' N* A3 m; }$ z0 b. b( a9 B* n
- str := "I'm OK!";
! Y. Q8 O, S4 n; Z x, d* i6 [ - str := callLibrary(j,"resetStr",str);1 ?$ D* H/ g0 Q
- promptmessage(str);
: ~/ k Y: Q4 p( n* f - # D5 w: {7 J6 |& P
- callLibrary(j, "listAccess", Tablefile);; ]# A4 S) A' K( {! }5 E: O/ o
-
1 p6 a6 Y! n& `$ d1 C$ U- _ - print "Unloading: ", freeLibrary(j);% C- J9 T8 `0 g8 d: J, ?+ O) F& Z
- end;
9 A& t1 S3 [ H - end;
. `, `2 `# p6 q% q
复制代码 |