- is
8 z( T* r7 f. p7 s5 D% X - r:real; file:string;3 I" {3 I9 n' } Y' H
- do
+ t! ~( R6 t: @1 [8 { - openConsole;7 C1 G5 S& s2 e7 t; j; e# f
- $ ~ @1 w3 t) [% i( D0 K! g+ W
- /*; r+ [8 R/ ]/ ]) |6 d
- file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",( a% j+ J# `9 {; O/ u0 Y0 o: C/ j
- when is64BitApplication then 64 else 32,0 g' C2 ~6 _% p0 p
- "bit.dll");0 e! ?5 d2 \' r& w; b S3 Q
- */. s9 V3 ]4 {& \
- file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";; N" z8 h0 T& @, @
- local j := loadLibrary(file);
; A# W/ x& Y; |2 q( ~* b
6 w+ r* N l4 P& r" u- if j > 0 then$ y4 u: h, Z0 e6 M8 o
- print getLoadedLibrary(j)," is loaded.";& T4 V% }+ g$ l: R# R" C: O
- 4 ^0 K# Z0 N" P
- r := callLibrary(j, "calcSin", PI/6);* ~& k0 _. L; m* [+ [
- promptmessage(to_str("sin(PI/6) = ", r));
/ P; ?& t0 i, c* _ -
5 Y. `1 e0 R1 ]' x8 f; C - local str:string;
$ Y& ~/ o( o. l5 O9 y - str := "I'm OK!";
8 e- I7 L. [7 K4 ?$ V - str := callLibrary(j,"resetStr",str);! G) Q' E: b( m% O. q4 ], z% Y: X
- promptmessage(str);/ z* }! m9 `1 u' M
- / V# W& ^( R5 n) J* h4 R
- callLibrary(j, "listAccess", Tablefile);
1 z. o: E, e F9 o3 Y6 ? - + h! v, ]2 o/ k' ~7 G9 q' D
- print "Unloading: ", freeLibrary(j);, q4 F% Y* {2 i3 }2 O
- end;9 v1 ?1 K1 q1 J9 b7 `
- end;
" A' T" f0 M& l, C( b2 ?
复制代码 |