background image

M2D-Laser-Scanner with Ethernet-Interface 

Manual 

 

 

HB-M2D-Ethernet-E 

Page 17 of 39 

www.MElsensor.com

S

S

c

c

a

a

n

n

n

n

e

e

r

r

 

 

c

c

o

o

n

n

t

t

r

r

o

o

l

l

s

s

 

 

Registers  
Hex    Dec 

Bit 

Function Registers 
Marked light blue 

Remark  

0x0 

6 … 0 

Shutter time low 

0x1 

2 … 0 

Shutter time high 

Shutter time  
0= max. 1022 = min. 1023= Laser off 

Manual control 

0x2 

6 … 0 

Max shutter time low 

0x3 

2 … 0 

Max shutter time high 

defines limit for the max. shutter.   
0 = max.   1022 = min. (single scanner) 
Alternate sync meas. not below  130

 

Automatic control 

0x4 

6 … 0 

Start readout pixels 

0x5 

6 … 0 

End readout pixels 

Value range = 0 … 127. 1 Bit corresponds to 8 pixels 
Condition: begin < end, max. is limited automatic 

0x6 

6 … 0 

Video gain low 

0x7 

2 … 0 

Video gain high 

< 256 = +27dB    1023 = 0dB        default = 950 = +2,57 dB 
value is set after first sending the high byte value 

0x8 

6 … 0 

Intensity threshold 

1 … 127  intensity threshold value for internal automatic laser 
control; factory default = 15 

0x9 

6 … 0 

Laser value 

1 … 127   value for the laser control (default = 95) 

0xA 

10 

6 … 0 

Peak width limit 

0 = 0ff;  other = peak width limit,  max. = 127 pixels 

0xB 

11 

FPGA OK LED 

0 = on  1 = off 

0xE 

14 

Reset position encoder 

Reset encoder counter 

0xF 

15 

Synchronization 

0 = simultaneous measmnt.  1 = alternating measmnt. 

0x10  16 

Adjustment scan, image 

0 = scan data         1= complete image (see page 19.) 

 
0x11 

 
17 

 
5 … 0 

 
defines content of status 
register 
 
marked yellow 

0            = sensor temperature 
1            = register content 
2            = version electronic board 
3            = version camera 
4 … 8     = hours counter seconds 
9 … 11   = On/Off counter 
12           = digital inputs 1 +2 + bit for sensors with mirror 
13           = Bit 2 … 9 of Laser control 
14           = Revision number  example: 3.5xxxx 
                  xxxx is the revision number 
15 … 31 = NC 
32 … 63 = 32 Byte Eprom Data (see below) 

0x12  18 

2 ... 0 

Select scanner protocol version  0 = Version 1    1 = Version 2    2 = Version 3    3 = Version 4 

0x13  19 

 

Reset camera chip 

reset hours counter and camera 

 
0x14 

 
20 

0 … 2 

5 .. 4 

Do not use! 
Measurement control 
Field out definition 

Bit 0 … 2 is only for Rev.1 hardware 
0 = continuous 1 = single shot triggered 
00=both fields | 01=only 1

st

. field  | 10=only 2

nd

 field 

0x15  21 

Laser control 

0 = automatic   1 = external (register 0& 1) 

0x16  22 

Linearization 

0 = off 1= on           default start value = 1 

0x17  23 

0 … 1 

Sampling rate and resolution for 
M20D-XF 300 .. 1000 Hz model 

0 = 300 Hz; 1 = 500 Hz; 2 = 700 Hz; 3 = 1.000 Hz 

0x18  24 

 Special 

Function 

Read out status of control registers and FiFO for ISA hardware 

 

 

 

 

 

0x1B  27 

7…0 

Peak detection threshold 

Default = 10 

0x1C  28 

Reset  FiFO 

Erases all values in FiFO 

0x1D  29 

Single picture in trigger-mode 

Register 0x14 (20) must be set before using trigger 

0x1E  30 

Reset Sensor  

set all register values to default 

S

S

p

p

e

e

c

c

i

i

a

a

l

l

 

 

c

c

o

o

m

m

m

m

a

a

n

n

d

d

s

s

 

 

f

f

o

o

r

r

 

 

t

t

h

h

e

e

 

 

E

E

t

t

h

h

e

e

r

r

n

n

e

e

t

t

 

 

v

v

e

e

r

r

s

s

i

i

o

o

n

n

 

 

0x1F  31 

Reset Blue Box 

Network Communication is restarted 

0x20  32 

Watchdog test 

Watchdog issues reset on Ethernet-Scanner 

0x21  33 

Poll Scanner information  

32 re 32 Eprom values set at start-up of the Ethernet 
module were sent. Protocol version is set to 0x10 hex. 

0x22  34 

new network settings 

Activate new IP address 

0x23  35 

Ethernet Trigger mode 

0 = deactivate 1 = activate 

when active, read image with register 0x1D (29) 

 

The content of status register 2 is defined by register 0x11 (17). For all values made by more than one Byte, bit 7 is always 0. 
This means only 7 Bit are transferred per Byte. 
* Each access to the register triggers the function: just send the register address with no parameter. 
Accessing the status register 0x11 selects the contents of the sensors status register. This allows to read out the parameters 
of sensor temperature, register content, version of electronic board and camera, hours and on/off counters, digital inputs, laser 
control, revision number, 32 byte of Eprom data, see the following pages. 

 

Summary of Contents for M2D/LAN

Page 1: ...ner with Ethernet Interface Manual Version 3 6 4 a MEL Mikroelektronik GmbH Breslauer Str 2 D 85386 Eching Tel 49 89 327 150 0 Fax 49 89 319 20 23 www MELsensor de october 2007 Copyright MEL 2004 2006...

Page 2: ...ub 25 pin 9 Ground connection connector D Sub 25 9 Technical data 10 M2DF LAN Laser Scanner electronic system in Blue Box with Ethernet interface 10 Dimensions of the electronic box 10 Other MEL Laser...

Page 3: ...ses and commands 26 3 Command 0x21 dump 27 example read out FiFo status and sensor temperature 32 Setting the IP Address by software 34 Representation of the Serial Number 34 Ports 35 Ethernet WinSock...

Page 4: ...n S So of ft tw wa ar re e C Co on nt tr ro ol ll le ed d P Pa ar ra am me et te er rs s TCP IP address subnet mask TCP ports Operation controls shutter control Laser intensity control Video gain cont...

Page 5: ...ctor Both connections will provide the same function Both connections can never be used in parallel When the connection is made at the RJ 45 connector no Ethernet cable must be connected at the D Sub...

Page 6: ...and display the Scan profile information retrieved from the scanners The performance of CPU and graphic card could cause dropped frames Use the image count number delivered with the scan profile data...

Page 7: ...s s From PC board version 1 3 on the digital inputs may be used to feed encoder signals The digital A B inputs feed a counter which is read out over the registers 13 16 The encoder counter information...

Page 8: ...block See page 5 for details Register 12 sets the version of protocol 1 3 R Re eg gi is st te er r 0 0x x1 1B B P Pr ro of fi il le e p pe ea ak k r re ec co og gn ni it ti io on n t th hr re es sh h...

Page 9: ...Sync input has internal pull down resistor using firmware update is on customers risk no warranty connect RIP Pin Pin 5 to ground Then cycle power After restart the Scanner will communicate on the def...

Page 10: ...ors at the box D Sub 9pin female scanner connector D Sub 25pin male Supply Ethernet Sync ext Trigger RJ 45 Ethernet D Di im me en ns si io on ns s o of f t th he e e el le ec ct tr ro on ni ic c b bo...

Page 11: ...ther the MEL configuration software or a Web Browser could be used UDP version is available on request S Se et t u up p o of f t th he e S Sc ca an nn ne er rs s w wo or rk ki in ng g I IP P A Ad dd d...

Page 12: ...r 3 192 168 123 224 Address Scanner 4 192 168 123 225 Address Scanner 5 192 168 123 226 Address Scanner 6 192 168 123 227 Address Scanner 7 192 168 123 224 wrong IP Address conflict with scanner 3 Add...

Page 13: ...splay of one scanner to display of up to four scanners The red profile is the counter X the white profile shows the coordinate Z as a function of x and the yellow curve is the intensity display Tab 4...

Page 14: ...ield on Tab1 on an inactive IP address and overwrite the temporary IP address Press Enter when done and click the checkbox on the left side of Tab1 to connect to the temp IP address This temp IP addre...

Page 15: ...reserve unsigned char 2 Reserved 52 59 null_8 unsigned char 8 Synchronization raster 8 Null bytes 60 60 version unsigned char 1 Protocol version number default 1 range 1 3 or 10 61 61 status unsigned...

Page 16: ...are version The FiFO status filling level is given also with every scan profile packet of the length 2048 bytes Status registers are the registers marked in yellow on page 15 Status registers can be q...

Page 17: ...Version 4 0x13 19 Reset camera chip reset hours counter and camera 0x14 20 0 2 3 5 4 Do not use Measurement control Field out definition Bit 0 2 is only for Rev 1 hardware 0 continuous 1 single shot t...

Page 18: ...ways 0 R Re eg gi is st te er r v va al lu ue e 2 2 3 3 v ve er rs si io on n n nu um mb be er r o of f c ca am me er ra a a an nd d e el le ec ct tr ro on ni ic c s sy ys st te em m Reg value Bit Nr...

Page 19: ...surface of interest 3 read out laser control Bit 2 9 4 set laser to external manual control mode 5 write back Bit 0 1 as 0 and Bit 2 9 of the previously read out value R Re eg gi is st te er r v va al...

Page 20: ...asurement range Z not linearized 54 6 0 LB 55 6 0 HB Min scan range X not linearized 56 6 0 LB 57 6 0 HB Max measurement range Z not linearized 58 6 0 LB 59 6 0 HB Max scan range X not linearized 60 0...

Page 21: ...I7 I6 I5 I4 I3 I2 I1 Distance Z 0 2048 Scan range X 0 1024 Intensity I 0 127 The value of the Bytes is never bigger than 254 FEh Byte value 255 FFh is invalid and appears when the FiFo is empty Proto...

Page 22: ...segment marked in grey colour Type the password MELSENSOR all capital letters without and hit ENTER or press the lower left button Send and wait for the second prompt from the Scanner stating that th...

Page 23: ...D Auswertung 36 2 017 Working Data 018 MAC 00 08 DC 2B 10 6F 019 IP 192 168 123 224 3000 020 SubNetz 255 255 255 0 021 GateWay 192 168 123 1 022 023 TCP Connecting 024 0x0A 025 On the RS 232 interface...

Page 24: ...eed for the update procedure o Flashm16 exe executable updater o M2d_eth_1 10 6 firmware binary o Start_1 10 6 bat batch file startBackup is an optional report generator Before you rewrite the firmwar...

Page 25: ...wer up of scanner Check if the IP is free Power down the scanner to see if another device has taken the IP Try M2D iVision exe Ping the IP Cmd ping xxx xxx xxx xxx When the scanner is down no other de...

Page 26: ...76543210 76543210 76543210 0xxxxxxx 1xxxxxxx 0xxxxxxx 1xxxxxxx Software Examples 1 Switch on Off FPGA LED Lo Byte Hi Byte 0x0B 0x80 LED on 0x0B 0x81 LED off 0x0B register address decimal 11 0x80 comm...

Page 27: ...values are stored until next reset command 0x1F Reset Ethernet in memory 4 examples of accessing registers functions and data These examples have been taken from the M2Dmini c For use as a complete pa...

Page 28: ...f ioPort 2 M2DWrite write to M2D Register anz 0 registerNr command e g 0x1C reset FIFO value not used 1 write value to registerNr 2 write value to registerNR registerNr 1 shift value to fit low high r...

Page 29: ...le 1 val ByteFromM2 inf if val 1 return 1 timeout if val 0 synCnt else if synCnt 8 ifdef M2D_DEBUG if synCnt 8 ifdef __RT__ printk n d n synCnt else printf n d n synCnt endif endif sync info 4 byte in...

Page 30: ...if v1 1 return 1 v2 ByteFromM2 inf if v2 1 return 1 v3 ByteFromM2 inf if v3 1 return 1 x i v0 v1 0x60 2 v3 0x07 9 z i v2 v1 0x1F 7 v3 v3 0xF8 intensity i v3 128 v3 127 1 v3 127 1 else not linear for i...

Page 31: ...urn 0 ok 1 fail inf sync 3 status int M2DStatus M2DInfo inf int num int i res result int res M2DStatus sens 3 result 1 M2DWrite inf 0x11 num 1 select status register M2DWrite inf 0x1C 0 0 clear FIFO f...

Page 32: ...0 break if hw opt1 8 0 hw amb 10 f hw mb 10 f hw sbAmb 10 f hw abEmb 10 f res MwDStatusInt inf 48 2 hw maxZ if res 0 break res MwDStatusInt inf 50 2 hw maxX if res 0 break res MwDStatusInt inf 2 1 hw...

Page 33: ...ferUARTTx 2 scanner 0x07 uiBufferUARTTx 3 Scanner_data scan uiBufferUARTTx 0xFF uiBufferUARTTx scanner 31 0x80 scanner 17 Temperatur abfragen For y 0 y 31 y scanner y 0x80 Scanner_data scan y scanner...

Page 34: ...ubnet mask 3rd octet 23 0 Subnet mask 4th octet 24 192 IP address 1st octet 25 168 IP address 2nd octet 26 123 IP address 3rd octet 27 224 IP address 4th octet 28 PORT LOWORD 0xB8 29 PORT HIWORD 0x0B...

Page 35: ...gEEPROMData 37 0x7F 7 ulTemp unsigned long ucRegEEPROMData 38 0x7F 14 ulTemp unsigned long ucRegEEPROMData 39 0x7F 21 P Po or rt ts s Ports are a part of the IP address definition When setting the wor...

Page 36: ...le e C C u us si in ng g W Wi in nS So oc ck k a an nd d S Sc ca an nn ne er r f fu un nc ct ti io on ns s receiving block size should be modulo 2 048 the Scanner sends blocks in size of 2 048 Bytes d...

Page 37: ...he recv function it is nessesary to have an existing connection to the scanner this means to have a valid socket create Data Buffer this Data Buffer has already a command to set the Scanner in Single...

Page 38: ...atoi 3000 0x00FF chTemp 30 atoi 3000 0xFF00 8 Note the UDP transmission protocol has been implemented in a new project of the MEL EthernetScanner demo software Typical TCP functions have been dropped...

Page 39: ...s Seitenzahlen ge ndert 2007 3 6 2 2 Register 6 7 Default Wert 950 12 3 2007 3 6 2 2 nderungsliste im Handbuch hinzugef gt 12 3 2007 3 6 2 2 Erdungskonzept Seite 10 hinzugef gt 12 5 2007 3 6 3 Firmwar...

Reviews: