- is: t( H2 f& X- O3 I& ]
- r:real; file:string;. O* o3 I. h% A$ o
- do9 G( s9 `3 Q+ h1 |$ N/ ^
- openConsole;
7 k! p; ]* E/ D% _/ v% W
! E4 F/ U v0 N$ i' L- /*4 S& o: C$ m% [8 y( O0 o; d
- file := to_str(ApplicationHome, "\Plant Simulation\C-Interface\cinterf",
3 Y m# @" y4 j, v. a - when is64BitApplication then 64 else 32,
% S+ U# v8 X; q9 l+ B - "bit.dll");. l! X; o6 i+ X% ^! O
- */: E/ J! c9 `* A- ]9 z
- file := "C:\Users\sun\Documents\Visual Studio 2010\Projects\sg64dll\x64\Debug\sg64dll.dll";& ] ?5 V, v4 X' r2 |& J
- local j := loadLibrary(file);7 [. b$ u" O/ K" G( L+ P# A# B
8 Z2 \2 N. o& j: `0 ?; v( g- if j > 0 then5 X# H; a1 q* z; n: p
- print getLoadedLibrary(j)," is loaded.";
. j# W% J# [* X8 u5 v) C$ h: N
0 g( V# h* J& a% v, R* t, m, ]- r := callLibrary(j, "calcSin", PI/6);2 V0 e/ M1 N! k0 O
- promptmessage(to_str("sin(PI/6) = ", r));
8 i0 x6 ^ G# X5 p* X& T! e4 k -
* b9 @* E6 P. U, X% L3 n+ O - local str:string;
; b5 k* Q U: R* V+ G - str := "I'm OK!";: t2 M) b' z) d$ N
- str := callLibrary(j,"resetStr",str);
# T1 r1 h; }& L1 y- h" n - promptmessage(str);
" N/ ?4 s1 N3 l' N% `( ~! g -
V- R# w7 k# _! k - callLibrary(j, "listAccess", Tablefile);" j" N M7 V) Q B" i
-
; _& \9 i/ N* X5 o) a7 K/ Z - print "Unloading: ", freeLibrary(j);
; m: D: v/ H8 l. c% S - end;
' B0 {9 f* C5 t9 s( V3 }9 n - end;
% \5 N' I* } J1 g. i/ Y
复制代码 |