- is! ?9 d3 {8 p' V
- r:real; file:string;
' |; z) F! {2 O& _: s - do
6 Q9 U+ c6 y' o# g" |. Y - openConsole;
0 y L' D" b# V$ C% k k0 A: G - 4 T( d9 Z9 `, \* q, P
- /*
6 J \# ^" @( C1 P; { ? - file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",
9 }3 P+ p; e7 O2 T - when is64BitApplication then 64 else 32,
& d. I6 P% K N' W: [! \ - "bit.dll");9 S2 I" ?* |& T: m
- */
Z) h8 ]5 ?9 U9 J6 Q% b7 ` - file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";$ ` [8 a9 [- B. m, N! H G
- local j := loadLibrary(file);9 }$ T, i$ L0 i4 \. A3 X+ b9 ]/ u
- ; s( @/ P& Q) |( x2 @. R5 p
- if j > 0 then
7 b' J1 D! ]6 G( M; v; d - print getLoadedLibrary(j)," is loaded.";' V. d- z& Y0 s1 ]; ~
- 6 z2 z; _' k" {' ?6 @/ X- A
- r := callLibrary(j, "calcSin", PI/6);# D- \, R: J( u& T% k5 j1 [
- promptmessage(to_str("sin(PI/6) = ", r));
* d2 d5 D2 P* P9 l& l9 O - ! d7 Z: ?# a/ S+ |
- local str:string;- D6 k$ O$ m1 {. A3 a2 L I7 G
- str := "I'm OK!";( m3 h3 j8 N1 g: H0 a0 e8 \
- str := callLibrary(j,"resetStr",str);0 n. M2 N2 s5 G/ R) j+ K
- promptmessage(str);# ]9 ?/ I$ R$ y9 n& ^; l, n
- ! Y& x: u1 \- n; |7 D$ t
- callLibrary(j, "listAccess", Tablefile);. X% Y1 v- ^1 N- G1 R$ q
- : I) y* M' f6 F$ \' j; C4 }3 `
- print "Unloading: ", freeLibrary(j);
: V* d. p5 i# p g - end;' n( o1 I. ~% |9 C K9 C7 G! l
- end;
$ b5 T( h6 ~& R' ?+ o, M
复制代码 |