- is
1 D* A! a& @9 n: m - r:real; file:string;. t: U& B+ W$ D( @& S' N7 G" U
- do
8 z/ w: k' _* u& q$ a: \6 W - openConsole;: o ~) y( r( }8 b
- 2 l+ t9 `8 E' Y/ u
- /*
, @* N( K- A7 x' f7 V& e - file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",7 h* B; F! t# r7 A1 D- A: O
- when is64BitApplication then 64 else 32,
, h( k8 U! w3 e5 e' |: Z - "bit.dll");
# {1 W5 I" X6 Q3 M! W - */
6 {% L/ u6 I* X4 V& v - file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll"; y' T; Y* A# k2 O+ ^- |
- local j := loadLibrary(file);
* g. [; y# O( C7 J5 C: q* A
# B9 p; x: M" T* K* a0 Z& B5 t- if j > 0 then% k' V2 {6 B; a0 F
- print getLoadedLibrary(j)," is loaded.";( C7 {6 [' g' X% S, }) H8 u
4 d7 v+ l7 T0 d4 g& u- r := callLibrary(j, "calcSin", PI/6);) n2 k* b9 H- a. y P8 g2 y+ |/ r
- promptmessage(to_str("sin(PI/6) = ", r));
( s/ F' y4 n( b" W - 2 t6 s) _# A8 f& E; i
- local str:string;
1 m; o, L7 K# h1 ]( ^1 U: Z - str := "I'm OK!";$ X) y1 L. j; E/ a. i$ J
- str := callLibrary(j,"resetStr",str);
$ F& X: t4 E( k3 ?- e) A - promptmessage(str);
$ p4 ]( t; ^3 i$ {2 `- S j -
3 L6 n0 e t3 l& g - callLibrary(j, "listAccess", Tablefile);
. K5 Q7 K$ L( A. N* | -
2 m. B! s' C0 q _ - print "Unloading: ", freeLibrary(j);
6 X2 B# |; s: A/ q. A - end;
. S+ ]1 A1 h6 s - end;
* [' H6 Y$ Z. ^: o8 h
复制代码 |