Manual
M7LL
/
M70LL
Laser
‐
Sensors
HB
‐
M7LL
‐
M70LL
‐
E.doc
page
21
of
23
V20130301
MEL
Mikroelektronik
GmbH,
Breslauer
Str.
2,
85386
Eching
/
Germany
www.MELSensor.com
S
S
o
o
f
f
t
t
w
w
a
a
r
r
e
e
e
e
x
x
a
a
m
m
p
p
l
l
e
e
s
s
D
D
i
i
s
s
c
c
l
l
a
a
i
i
m
m
e
e
r
r
For
integration
of
the
M7LL
‐
and
M70LL
‐
sensors
a
DLL
is
available.
More
details
are
available
on
request.
Our
software
development
engineers
use
Visual
Studio
/
C++.
Source
code
published
by
MEL
should
be
considered
as
examples.
This
code
could
have
bugs
and
MEL
could
not
make
warranties
if
this
code
would
cause
harmful
damadge
to
your
system
or
render
it
inoperable.
MEL
may
change
the
code
examples
without
notice.
H
H
e
e
a
a
d
d
e
e
r
r
#define
M27ILANPROTOKOL2302ETHERNETPACKETSIZE
860
#define
ADVALUESPROTOKOL2302MAX
200
typedef
struct
{
unsigned
int
uiVersionProtokol;
//2
0x2302
unsigned
int
uiVersionProtokolSize;
//2
860
unsigned
int
uiSerienNummerMJ;
//2
MMJJ
unsigned
int
uiSerienNummerCnt;
//2
XXX
unsigned
long
ulEinschaltzaehler;
//4
unsigned
char
ucReserved[20];
//20
unsigned
int
uiPacketNummer;
//2
fortlaufende
Nummer
unsigned
char
ucEthSpeed;
//1
10/100
‐
MBit/s
unsigned
char
Reserved1[3];
//3
unsigned
int
uiAMB;
//2
AnfangsMessBereich
unsigned
int
uiMB;
//2
MessBereich
unsigned
int
uiTriggerMaxValue;
//2
im
WebBrowser
eingestellter
Wert
unsigned
int
uiTriggerMinValue;
//2
im
WebBrowser
eingestellter
Wert
unsigned
char
ucTriggerMaxIntensity;
//1
142
unsigned
char
ucTriggerMinIntensity;
//1
14
unsigned
int
uiTriggerStatus;
//2
(uiTriggerMax
<<
1)
|
uiTriggerMin
unsigned
int
uiReserved2;
//2
unsigned
int
uiADZMaxValue;
//2
0xFFFF
unsigned
int
uiADIMaxValue;
//2
0xFF
unsigned
int
uiADFrequenz;
//2
30000
unsigned
int
uiADValuesMax;
//2
200
unsigned
int
uiADValues[ADVALUESPROTOKOLMAX];
//2x200:400
unsigned
char
chADIValues[ADVALUESPROTOKOLMAX];
//1x200:200
unsigned
char
chADLValues[ADVALUESPROTOKOLMAX];
//1x200:200
}
_structADValues;
//860
E
E
t
t
h
h
e
e
r
r
n
n
e
e
t
t
S
S
e
e
n
n
s
s
o
o
r
r
S
S
o
o
f
f
t
t
w
w
a
a
r
r
e
e
I
I
m
m
p
p
l
l
e
e
m
m
e
e
n
n
t
t
a
a
t
t
i
i
o
o
n
n
For
communication,
the
WinSocket
function
is
used.
These
functions
are
part
of
all
Windows
operating
systems.
Other
operating
systems
may
use
similar
functions.
Winsock
functions
are
encapsuled
in
a
„
ws2_32.dll
“
‐
file.
This
file
is
part
of
Windows.
Communication
uses
TCP/IP
protocol
and
the
sensor
works
as
a
server.
This
implicates,
that
the
PC
is
a
client.
After
start
the
„
WSAStartup
“
function
must
be
called,
before
you
can
use
the
common
functions
of
WindowsSocket.
Next
you
get
a
valid
TCP
‐
Socket
(something
like:
object)
from
the
system.
This
is
done
calling
„
socket
“.
Whena
valid
Socket
is
there
a
connect
to
the
sensor
can
be
issued.
For
this
use
the
function:
„
connect
“.
When
this
is
successful,
the
PC
is
connected
to
the
sensor
and
both
units
can
exchange
data
with
the
commands
„
send
“
and
„
recv
“.
At
the
end
of
communication
cycle
memory
and
sockets
should
be
released
using
„
closesocket
“.
Finally
the
function
„
WSACleanup
“
closes
down
activities.
E
E
t
t
h
h
e
e
r
r
n
n
e
e
t
t
f
f
u
u
n
n
c
c
t
t
i
i
o
o
n
n
s
s
–
a
DLL
will
be
available
for
these
functions
‐
************************************************************************************************************
//
size
of
input
receive
buffer:
should
be
modulo
2048,
the
sensor
sends
in
blocks
of
2048
#define
TCPBUFSIZE
2048
//
Structure
for
WinSocket
WSADATA
wsaData;
//
Socket
‐
Variable
SOCKET
sTCP;
//
make
input
buffer
of
specified
size