- is
$ |8 |5 v; a7 v5 }7 u; R - r:real; file:string;* G9 s! l! c% S' h' l8 F& N( h
- do0 Y0 c' C4 m* U- {' R% Z2 f( _
- openConsole;
* L+ v8 f! y0 V - 1 _4 q' t; I/ ?3 Y* f
- /*
7 S) b) m* E: }$ k - file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",) j `3 P4 O9 v: r( u% L9 R! O
- when is64BitApplication then 64 else 32,# _. ~$ y8 O. P$ ?
- "bit.dll");; B* i; t' [4 \) [1 _) ?$ w
- */1 b1 P: {/ d: E
- file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";* v* p% n) C6 I& h
- local j := loadLibrary(file);; y' k; z. g& D3 ?
- + a e; \3 u z2 \. ?6 a8 n: V
- if j > 0 then
! V3 p4 D) U' q2 d: n; X8 e - print getLoadedLibrary(j)," is loaded.";) W8 }6 z& s7 f1 t) E
- E4 _, Z, ~8 M4 q& m/ ^0 K# e' S1 _- r := callLibrary(j, "calcSin", PI/6);
4 t' T' ]# q! l+ s8 Z- p, l0 U$ G - promptmessage(to_str("sin(PI/6) = ", r));
- q" k' K7 l6 c$ i+ k -
" e& @8 B+ ]* G - local str:string;
9 O' Q+ J2 ?9 \+ v4 J+ t9 ~0 p, x5 R - str := "I'm OK!";
& E) F! @+ u$ h$ x$ z - str := callLibrary(j,"resetStr",str);
6 o, O/ I* w- G; l - promptmessage(str); h0 @$ X4 I. w* x# G$ C
-
3 L3 S$ C2 F5 c) o9 f9 z2 D' Y - callLibrary(j, "listAccess", Tablefile);
4 ^+ F+ w2 `6 `* \ - ; g6 R- t& ~$ p' K+ ^; e; F
- print "Unloading: ", freeLibrary(j);2 m; |1 f- A4 H! u( {7 `
- end;# I+ d3 D$ v4 ]- P0 y
- end;
- l+ p/ }/ y/ t& }
复制代码 |