- is
. q+ H1 E- r9 d/ Q* F$ i - r:real; file:string;0 ]* d& T) s/ a3 U
- do1 Y+ D. Z% R& a, f* q- D8 j/ [+ ?
- openConsole;& n7 ~) F% H j+ ~2 b0 o+ U
5 Q* M8 T6 |5 e. A5 k% G# R- /*
5 m! Y _8 d" I1 k k% j- ]. @ - file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",; v# e& i+ P4 C9 e
- when is64BitApplication then 64 else 32,
7 k: n1 |5 ~2 t - "bit.dll");
2 g M: E& W/ _; F( X& m% ~ - */. s$ f: C" _" t1 j# p, G
- file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";1 j1 K8 B; _* |9 y
- local j := loadLibrary(file);
' a. r5 c1 r2 A9 l. T
2 u b1 L' n) k+ ~- v- if j > 0 then
" ]- n' J- d& O- U9 [8 q - print getLoadedLibrary(j)," is loaded.";
* y$ d7 Q5 q1 [2 r& I' N - ; }' q( @+ j- S6 D5 m }. p* U
- r := callLibrary(j, "calcSin", PI/6);
9 P6 L8 \5 u2 M. P - promptmessage(to_str("sin(PI/6) = ", r));2 k. d5 k5 P) z5 U- ?
-
, x0 ?" `' X' g* a1 x - local str:string;
" o+ v6 e% }- P9 u/ l" Z: p( Q - str := "I'm OK!";9 p Q7 S$ \$ |, p; A
- str := callLibrary(j,"resetStr",str);: t% ]5 |" U0 I4 w- s' I) U
- promptmessage(str);* f2 k- |& w& i
- 3 E: p1 V7 ]7 d ?, u' _
- callLibrary(j, "listAccess", Tablefile);# P/ w. y6 U" W, A: n
-
/ |! ^# ~( k. N9 u - print "Unloading: ", freeLibrary(j);
" m: C" F7 H. Y2 U. J% U - end;; `) O2 K9 D0 P2 H! h9 `
- end;4 D. t& p4 d$ y, t# n/ O
复制代码 |