Instruction Manual optoNCDT 1402 RS232 Options .23 .24 .25 .26 .27 .28 .29 Intelligent laser optical displacement measurement MICRO-EPSILON MESSTECHNIK GmbH & Co. KG Königbacher Strasse 15 94496 Ortenburg / Germany Tel. +49 (0) 8542 / 168-0 Fax +49 (0) 8542 / 168-90 e-mail [email protected] www.micro-epsilon.com Certified acc. to DIN EN ISO 9001: 2008 Software-V1.003 Contents 1.Safety......................................................................................................................................... 7 1.1 Symbols Used.................................................................................................................................................. 7 1.2Warnings........................................................................................................................................................... 7 1.3 Notes on CE Identification................................................................................................................................ 8 1.4 Proper Use........................................................................................................................................................ 8 1.5 Proper Environment.......................................................................................................................................... 9 2. Laser Class ............................................................................................................................... 9 3. Functional Principle, Technical Data...................................................................................... 11 3.1 Functional Principle ....................................................................................................................................... 11 3.2Functions........................................................................................................................................................ 11 3.2.1 Fitting the Measurement Range.................................................................................................... 11 3.2.2 Exposure Control........................................................................................................................... 12 3.2.3 Peak Select.................................................................................................................................... 12 3.2.4 Software Trigger, Time-based Measurement Value Output.......................................................... 12 3.2.5 Error Behavior................................................................................................................................ 12 3.2.6Averaging....................................................................................................................................... 12 3.2.7 Sensor Emulation (Compatibility)................................................................................................. 12 3.2.8 Command Compatibility............................................................................................................... 12 3.2.9 Video Signal.................................................................................................................................. 13 3.2.10 Programmable Search Threshold................................................................................................. 13 3.3 Technical Data ILD 1402-x RS232.................................................................................................................. 14 3.4 Indicator Elements ILD 1402-x RS232............................................................................................................ 15 4.Delivery ................................................................................................................................... 16 4.1 Scope of Delivery............................................................................................................................................ 16 4.2Storage .......................................................................................................................................................... 16 5. 5.1 5.2 Installation and Mounting....................................................................................................... 17 Sensor Mounting ILD 1402-x ......................................................................................................................... 17 Pin Assignment ILD1402-x RS232.................................................................................................................. 18 5.2.1 Cable Requirements...................................................................................................................... 18 5.2.2 Switching off the Laser.................................................................................................................. 19 5.2.3 Error Output ILD1402-x RS232...................................................................................................... 19 optoNCDT 1402 RS232 6.Operation ................................................................................................................................ 20 6.1 Getting Ready for Operation ......................................................................................................................... 20 6.2 Output Scaling................................................................................................................................................ 21 6.3Average .......................................................................................................................................................... 23 6.3.1 Averaging Number N .................................................................................................................... 23 6.3.2 Moving Average (Default Setting) ................................................................................................ 23 6.3.3Median .......................................................................................................................................... 24 6.4 Measurement Rate and Output Rate ............................................................................................................. 24 6.5Timing ............................................................................................................................................................ 26 7. 7.1 7.2 7.3 8. 8.1 8.2 8.3 Measurement Value Output.................................................................................................... 27 Current Output................................................................................................................................................ 27 Digital Value Output ....................................................................................................................................... 28 7.2.1 Data Protocol ILD1401.................................................................................................................. 28 7.2.2 Data Protocol ILD1402.................................................................................................................. 29 Digital Error Codes......................................................................................................................................... 29 Serial Interface RS232........................................................................................................... 30 Interface Parameter........................................................................................................................................ 30 Data Format for Measurement Values and Error Codes ............................................................................... 30 8.2.1 Binary Format ............................................................................................................................... 30 8.2.2 ASCII Format ............................................................................................................................... 31 8.2.3 Request the Data Protocol............................................................................................................ 31 Data Protocol ILD1401.................................................................................................................................... 32 8.3.1 Setup of the Commands .............................................................................................................. 32 8.3.2 Overview of Commands................................................................................................................ 33 8.3.3 Reading the Sensor Parameters, INFO......................................................................................... 34 8.3.4 Reading the Software Version, VERSION..................................................................................... 35 8.3.5 Average On/Off, MEDIAN.............................................................................................................. 35 8.3.6 Digital or Analog Data Output, OUTPUTCHANNEL...................................................................... 36 8.3.7 Sensor Behavior in Error Case, SAVELASTMV............................................................................. 37 8.3.8 Reset Sensor, BOOT..................................................................................................................... 37 8.3.9 Changing Data Protocol, SET_CIMODE_1402 ............................................................................ 38 8.3.10 Request Data Protocol, GET_CI_MODE....................................................................................... 39 optoNCDT 1402 RS232 8.4 Data Protocol ILD1402.................................................................................................................................... 40 8.4.1 Setup of the Commands............................................................................................................... 40 8.4.2 Communication without Error....................................................................................................... 41 8.4.3 Communication with Error............................................................................................................ 41 8.4.4Overview........................................................................................................................................ 42 8.4.5 Reading the Sensor Parameters, GET_INFO................................................................................ 43 8.4.6 Reading the Sensor Settings, GET_SETTINGS............................................................................ 45 8.4.7 Average Type and Average Number, SET_AV ............................................................................. 48 8.4.8 Stopping the Measurement Value Output, DAT_OUT_OFF......................................................... 49 8.4.9 Starting the Measurement Value Output, DAT_OUT_ON............................................................. 50 8.4.10 Digital or Analog Data Output, SET_OUTPUT_CHANNEL .......................................................... 50 8.4.11 Characteristics for Digital or Analog Data Output, SET_OUTPUTMODE .................................... 51 8.4.12 Set Output Time, SET_OUTPUTTIME_MS ................................................................................... 52 8.4.13 Error Output (Analog output), SET_ANALOG_ERROR_HANDLER ............................................. 53 8.4.14 Set Baud Rate, SET_BAUDRATE ................................................................................................. 54 8.4.15 Set Measurement Rate, SET_SCANRATE ................................................................................... 55 8.4.16 Peak Detection with Video Signal, SET_PEAKSEARCHING ....................................................... 56 8.4.17 Search Threshold, SET_THRESHOLD.......................................................................................... 57 8.4.18 Switching off the Laser (External), LASER_OFF........................................................................... 58 8.4.19 Change Data Format, ASCII_OUTPUT.......................................................................................... 59 8.4.20 Reset Sensor, RESET_BOOT........................................................................................................ 60 8.4.21 Set Default Setting, SET_DEFAULT .............................................................................................. 60 8.4.22 Save Settings in RAM or FLASH, SET_SAVE_SETTINGS_MODE............................................... 62 8.4.23 Scaling Values for the Analog Output, SET_TEACH_VALUE....................................................... 63 8.4.24 Reset Scaling Values for the Analog Output, RESET_TEACH_VALUE........................................ 64 8.4.25 Changing Data Protocol, SET_CIMODE_1401............................................................................. 64 8.4.26 Request Data Protocol, GET_CI_MODE....................................................................................... 65 optoNCDT 1402 RS232 9. 9.1 9.2 Instructions for Operating ..................................................................................................... 66 9.3 9.4 Reflection Factor of the Target Surface.......................................................................................................... 66 Error Influences.............................................................................................................................................. 66 9.2.1 Light from other Sources .............................................................................................................. 66 9.2.2 Color Differences........................................................................................................................... 67 9.2.3 Temperature Influences ................................................................................................................ 67 9.2.4 Mechanical Vibrations .................................................................................................................. 67 9.2.5 Movement Blurs............................................................................................................................. 67 9.2.6 Surface Roughness....................................................................................................................... 67 9.2.7 Angle Influences ........................................................................................................................... 67 Optimizing the Measuring Accuracy.............................................................................................................. 68 Cleaning the Protective Glasses.................................................................................................................... 69 10. Default Setting......................................................................................................................... 70 11. ILD1402 Tool............................................................................................................................ 71 12. Software Support with MEDAQLib......................................................................................... 72 13.Warranty .................................................................................................................................. 73 14. Service, Repair ....................................................................................................................... 73 15. Decommissioning, Disposal .................................................................................................. 74 16. Free Space for Optics............................................................................................................. 75 17. Available Cables...................................................................................................................... 76 18. Input /Output Circuit............................................................................................................... 77 optoNCDT 1402 RS232 Safety 1. Safety Knowledge of the operating instructions is a prerequisite for sensor operation. 1.1 Symbols Used The following symbols are used in this instruction manual: Indicates a hazardous situation which, if not avoided, may result in minor or moderate injury. Indicates a situation which, if not avoided, may lead to property damage. Indicates an user action. i 1.2 Indicates an user tip. Warnings Avoid unnecessary laser exposure to the human body -- Turn off the sensor for cleaning and maintenance. -- Turn off the sensor for system maintenance and repair if the sensor is integrated into a system. Caution - use of controls or adjustments or performance of procedures other than those specified may cause harm. Connect the power supply and the display/output device in accordance with the safety regulations for electrical equipment. >> Danger of injury, damage to or destruction of the sensor The power supply may not exceed the specified limits. >> Danger of injury, damage to or destruction of the sensor Avoid shock and vibration to the sensor.Damage to or destruction of the sensor Avoid continuous exposure to fluids. >> Damage to or destruction of the sensor optoNCDT 1402 RS232 Page 7 Safety Avoid contact with aggressive materials (washing agent, penetrating liquids or similar). >> Damage to or destruction of the sensor 1.3 Notes on CE Identification The following applies to the optoNCDT 1402: -- EU directive 2004/108/EC -- EU directive 2011/65/EC, “RoHS” category 9 Products which carry the CE mark satisfy the requirements of the quoted EU directives and the European standards (EN) listed therein. The EC declaration of conformity is kept available according to EC regulation, article 10 by the authorities responsible at MICRO-EPSILON Messtechnik GmbH & Co. KG Königbacher Straße 15 94496 Ortenburg / Germany The measuring system is designed for use in industry and satisfies the requirements. 1.4 Proper Use -- The series optoNCDT 1402 measuring system is designed for use in industrial areas. -- It is used for measuring displacement, distance, position and thickness for in-process quality control and dimensional testing -- The measuring system may only be operated within the limits specified in the technical data, see Chap. 3.3. -- The sensor should only be used in such a way that in case of malfunctions or failure personnel or machinery are not endangered. -- Additional precautions for safety and damage prevention must be taken for safety-related applications. optoNCDT 1402 RS232 Page 8 Safety 1.5 Proper Environment -- Protection class sensor: IP 67 (Only with supply/output cable connected) -- Optical surfaces are excluded from protection class. Contamination of the lenses leads to impairment or failure of the function. -- Operating temperature: 0 to +50 °C (+32 to +122 °F) -- Storage temperature: -20 to +70 °C (-4 to +158 °F) -- Humidity: 5 - 95 % (non-condensing) -- Pressure: atmospheric pressure i 2. The protection class is limited to water (no penetrating liquids or similar)! Laser Class The sensors operate with a semiconductor laser with a wavelength of 670 nm (visible/red). The laser emits a permanent beam. The maximum optical power is ≤ 1 mW. The sensors are classified for Laser Class 2 (II). The laser warning labels for Germany have already been applied. Those for other non German-speaking countries an IEC standard label is included in delivery and the versions applicable to the user’s country must be applied before the equipment is used for the first time. Attach the following warning labels on the sensor housing front side: LASER RADIATION Do not stare into the beam CLASS 2 LASER PRODUCT IEC 60825-1: 2007 P≤1mW; =670 nm IEC label optoNCDT 1402 RS232 i Only for USA If both warning labels are disguised in operation mode the user must add additional warning labels. Page 9 Laser Class During operation of the sensor the pertinent regulations acc. to IEC 60825-1: 2007 on „radiation safety of laser equipment“ must be fully observed at all times. The sensor complies with all applicable laws for the manufacturer of laser devices. Do not look directly into the laser beam! Possible injury of the eyes. Close your eyes or turn away promptly if laser radiation strikes your eyes. optoNCDT LASER RADIATION Do not stare into the beam CLASS 2 LASER PRODUCT IEC 60825-1: 2007 P≤1mW; =670 nm Laser spot Fig. 1 True reproduction of the sensor with its actual location of the warning labels Laser operation is indicated by LED. Although the laser output is low looking directly into the laser beam must be avoided. Due to the visible light beam eye protection is ensured by the natural blink reflex. The housing of the optical sensors optoNCDT 1402 may only be opened by the manufacturer, see Chap. 14.. For repair and service purposes the sensors must always be sent to the manufacturer. optoNCDT 1402 RS232 Page 10 Functional Principle, Technical Data 3. Functional Principle, Technical Data 3.1 Functional Principle The sensor uses the principle of optical triangulation, i.e. a visible, modulated point of light is projected onto the target surface. A LED on the sensor indicates: -- In range -- Out of Range (upper and lower range values), poor target (unfit or no object) -- Mid range LASER RADIATION Do not stare into the beam CLASS 2 LASER PRODUCT IEC 60825-1: 2007 P≤1mW; =670 nm SMR The controller calculates the measured value from the CCD-array. An internal closed-loop control enables the sensor to measure against different surfaces. optoNCDT Measuring range The diffuse element of the reflection of the light spot is imaged by a receiver optical element positioned at a certain angle to the optical axis of the laser beam onto a high-sensitivity resolution element (CCD), in dependency on distance. Current output Digital value 3.75 mA 16372 4 mA (SMR) 161 12 mA (MR) 8184 20 mA (EMR) 16207 3.75 mA 16374 Fig. 2 Definition of terms, output signal SMR = Start of measuring range | MR = Midrange | EMR = End of measuring range 3.2 Functions 3.2.1 Fitting the Measurement Range The analog measuring range can be reduced with aid of the “Teach“ function, see Chap. 6.2. This enables you to scale only a part of the measuring range to the full scale current output. Thus the resolution of analog evaluation systems like displays or PLCs will be used better. optoNCDT 1402 RS232 Page 11 Functional Principle, Technical Data 3.2.2 Exposure Control Dark or shining objects to be measured may require a longer exposure time. However, the controller is not capable of providing exposure which is any longer than permitted by the measurement rate. For a longer exposure time, therefore, the measurement rate of the sensor has to be reduced, see Chap. 6.4, by command. 3.2.3 Peak Select For measurements on mirroring or transparent surfaces like glass plates or plastic layers spurious reflections from the front or rear side can be suppressed by command, see Chap. 8.4.16. 3.2.4 Software Trigger, Time-based Measurement Value Output Single measurements can be output via a software trigger. You can also output the measurements in a programmable timing period, see Chap. 8.4.12. 3.2.5 Error Behavior The sensor may replace or hold up to 99 consecutive errors by the last valid value. In addition, all error values at the analog output can be replaced by the last valid value. Details about the behavior of the analog output, see Chap. 8.4.13. 3.2.6 Averaging The sensor enables an averaging of the measured values with the median or moving average, before they are output. This does not reduce the measurement rate. 3.2.7 Sensor Emulation (Compatibility) For a replacement or retrofitting, the ILD1402 can also be operated in the configuration of the previous type ILD1401. This reduces the data word width of 14 to 12 bit and the functions of the ILD1401 are usable only. 3.2.8 Command Compatibility The sensor ILD1402 uses the same commands (Stop, Info, etc.) for the same functions as the type ILD1700. This means that existing programs of the ILD1700 can be easily adapted. More informations, see Chap. 8.4.4. optoNCDT 1402 RS232 Page 12 Functional Principle, Technical Data 3.2.9 Video Signal The sensor can use different peaks in the CCD array for displacement measuring. Intensity This function is auxiliary, if the sensor measures against glass or transparent targets, see Chap. 8.4.16 also. CCD array SMR Displacement 1 Displacement 2 Measuring range Fig. 3 Video signal 3.2.10 Programmable Search Threshold Intensity The sensor can use different thresholds to detect a valid peak in the CCD array for displacement measuring. Highest Higher than Standard Standard Lower than Standard CCD array optoNCDT 1402 RS232 Parameters, see Chap. 8.4.17 (for parameter setting): -- lower than standard -- Standard -- higher than standard -- highest i Changing the threshold from factory default (standard) may influence linearity and resolution. Page 13 Functional Principle, Technical Data 3.3 Technical Data ILD 1402-x RS232 Model ILD 1402-5 1402-10 1402-20 1402-50 1402-100 1402-200 1402-250VT Measurement range mm Start of range Midrange End of range Linearity 5 10 20 50 mm 20 20 30 45 mm 22.5 25 40 70 mm 25 30 50 95 µm 5 ... 9 5 ... 18 7 ... 36 12 ... 90 1402-600 250 400 600 50 60 100 200 200 100 160 225 400 500 150 260 350 600 800 20 ...180 40 ... 360 50 ... 1200 ≤ 0.18 % FSO Averaged over 64 values, µm Resolution 1402-400 200 100 dynamic, µm 1.5 kHz ≤ 0.5 % FSO 0.6 1 2 5 10 13 32 1 ... 3 2 ... 5 5 ... 10 6 ... 25 12 ... 50 13 ... 100 32 ... 300 0.02 ... 0.05 % FSO Measurement rate, programmable: Class 2 (II) acc. to IEC 60825-1: 2007 110 110 210 1100 optoNCDT 1402 RS232 2300 5000 2.6 x 5 mm 2.6 x 5 mm MR, µm 380 650 530 110 130 2200 5000 2.6 x 5 mm 2.6 x 5 mm 650 1200 830 1100 1400 2100 5000 2.6 x 5 mm 2.6 x 5 mm 20 g / 10 Hz ... 1 kHz 15 g / 10 Hz ... 1 kHz IP 67 15 g / 10 Hz ... 1 kHz Shock Storage temperature 1400 EMR, µm Protection class Temperature stability 80 ... 600 1.5 kHz; 1 kHz; 750 Hz; 375 Hz; 50 Hz SMR, µm Operation temperature 80 ... 480 Semiconductor laser 1 mW, 670 nm (red) Laser class Weight, without cable 80 14 bit Light source Vibration 80 0.02 ... 0.12 % FSO digital Spot diameter 120 ... 2000 120 ... 3000 15 g / 6 ms (IEC 60068-2-29) approx. 83 g 0.03 % FSO/°C approx. 130 g 0.08 % FSO/°C 0 ... 50 °C (+32 °F ... +122 °F) -20 °C ... 70 °C (-4 °F ... +158 °F) Page 14 Functional Principle, Technical Data Model ILD 1402-5 1402-10 1402-20 1402-50 1402-100 1402-200 1402-250VT Measurement value output analog digital Supply 1402-400 1402-600 4 ... 20 mA 12 bit (1 ... 5 V with cable PC 1401-3/U) or RS232 11 ... 30 VDC, typical 24 VDC / 50 mA Controller integral signal processor The specified data apply to a white, diffuse reflecting surface (Reference: Ceramic). FSO = Full Scale Output SMR = Start of measuring range MMR = Midrange EMR = End of measuring range ILD1402-250VT: 20 g, especially shock and vibration-resistant design for use on motor vehicles 3.4 Indicator Elements ILD 1402-x RS232 Options 23, 24, 26 LED State Measuring object within measurement range Midrange Error - e.g. poor target or out of range Supply voltage on, Laser turned off Color green yellow red red Options 25, 27, 28, 29 LED State Measuring object within measurement range Midrange Error - e.g. poor target or out of range Laser turned off optoNCDT 1402 RS232 Color green yellow red off Page 15 Delivery 4. Delivery 4.1 Scope of Delivery 1 Sensor optoNCDT1402 RS232 1 Assembly instructions 1 7 pin male cable connector 1 CD with driver and demo program Optional accessory, packed separately: -- 1 PC1401-x/I interface and supply cable for current output, one end of the cable has a 7 pin male cable connector, the other end has free leads with ferrules. -- 1 PC1401-x/U interface and supply cable for voltage output (250 Ohm load, U out = 1 … 5 V), one end of the cable has a 7 pin male cable connector, the other end has free leads with ferrules. A full list of all available cables, see Chap. 17. Check for completeness and shipping damage immediately after unpacking. In case of damage or missing parts, please contact the manufacturer or supplier. 4.2 Storage Storage temperature:-20 up to +70 °C (-4 to +158 °F) Humidity : optoNCDT 1402 RS232 5 - 95 % (non-condensing) Page 16 Installation and Mounting 5. Installation and Mounting The sensor is an optical sensor for measurements with micrometer accuracy. i Make sure it is handled carefully when installing and operating. 5.1 Sensor Mounting ILD 1402-x Mount the sensor via 2 screws M4. 48 (1.89) 12 (.47) 20 (.79) 14 (.55) Mount the sensor in such a way that the laser beam is directed perpendicularly onto the surface of the target. In case of misalignment it is possible that the measurement results will not always be accurate, see Chap. 9.. also. 2 Mounting holes ø4.3/5.8 5 (.20) 50 (1.97) 40 (1.57) Minimum bending radius PC1401-x -- once: 25 mm -- continuous: 38 mm -- cable diameter 5 mm Fig. 4 Dimensional drawing ILD1402-x, dimensions in mm (inches), not to scale optoNCDT 1402 RS232 Laser beam 57 (2.24) 65 (2.56) 16 (.63) 4 (.16) Page 17 Installation and Mounting 5.2 Pin Assignment ILD1402-x RS232 Cable colors PC1401 Pin Designation Characteristics 1 Error output Open collector, Type: NPN, switches to ground, UCE max 30 VDC, ICmax. 100 mA, short-circuit proof green 2 Laser ON/OFF Remote switch yellow 3 RX232 4 TX232 5 Current output 4 ... 20 mA, short- circuit proof 6 Ground (GND) Reference potential for outputs, remote switch for laser on/off and operating voltage brown 7 Operating voltage 11 ... 30 VDC, reverse-connection protection white RS232 blue pink grey 4 3 5 6 2 1 7 7 pin subminiature circular connectors series 712, type: Binder, view on solder pin side, male cable connector R Load = 250 Ohm results U OUT 1 ... 5 V with U B > 11 V R Load = 500 Ohm results U OUT 2 ... 10 V with U B > 17 V 5.2.1 Cable Requirements Voltage output: - Max. length 25 m (82 ft); electromagnetic fields may cause measurement uncertainty in the signal if you work with cables longer then 25 m. MICRO-EPSILON recommends terminating the end of the cable with 100 nF to avoid noise. - Sectional area of wire: 0.25 mm² (AWG 23), cable diameter: 3.5 ... 5 mm (AWG 7 ... 4) - Screened cable, screen connected to the plug body - Connect the screen with the safety earth conductor Power supply: - 11 ... 30 VDC, max. 50 mA Use only VDE conforming and tested power supply units. optoNCDT 1402 RS232 Page 18 Installation and Mounting 5.2.2 Switching off the Laser Connect pin 2 with pin 6 to switch on the laser. If you open this connection -- the laser switches off, -- the error output switches on. +3.3 V (internal) Pin 2 Pin 6 Sensor ILD1402 7-pin connector 5.2.3 Fig. 5 Circuit for laser off Error Output ILD1402-x RS232 The error message is generated by: -- no measuring object or measuring object beyond measuring range -- poor target (reflectivity to small, transparent or mirroring object) or laser off +24 VDC 10 kOhm ILD1402 T max. 100 mA Pin 1 U CE max. = 30 VDC No error: T locked Error: T conductive The error output is low-active and short circuit proof. Fig. 6 External wiring for the error output i optoNCDT 1402 RS232 With a user defined output scaling, see Chap. 6.2, you can use the hysteresis-free error output as a programmable limit switch. Page 19 Operation 6. Operation 6.1 Getting Ready for Operation Install and assemble the optoNCDT 1402 in accordance with the instructions set out, see Chap. 5.1 and connect it with the indicator or monitoring unit and the power supply, having full regard to the connection instructions set out, see Chap. 5.2. The laser diode in the sensor ILD1402-x can only be activated if -- the input “Laser on/off“ (Pin 2) or -- the yellow wire in the PC1401 sensor cable is connected to GND. Once the operating voltage has been switched on the sensor runs through an initialization sequence. If initialization has been finished, the sensor transmits the info string once in ASCII format via the serial interface independent of the selected interface. The initialization including the info string transmission takes up to 5 seconds. Within this period, the sensor neither executes nor replies commands. To be able to produce reproducible measurements the sensor typically requires a start-up time of 15 minutes. Once this has elapsed the sensor will be in measurement mode. Operating Voltage -- Nominal value: 24 VDC (11 ... 30 V, max. 50 mA). -- Use the power supply unit for measurement instruments only, and not for drive units or similar sources of pulse interference at the same time. Switch on the power supply unit, if wiring is done. optoNCDT 1402 RS232 Page 20 Operation 6.2 Output Scaling The “teaching” scales the analog output (4 to 20 mA) for a part of the measuring range. This allows you to optimize the resolution for the analog measurement range. Only the current and error output will be affected by the 2 point calibration. Therefore you define a new start and end for the measurement range. This “teaching” procedure can be performed via the RS232 interface. i With a user defined output scaling you can use the error output, see Chap. 5.2.3, as a programmable limit switch. 20 mA 4 mA 3 mA SMR EMR Measuring range Measuring object Digital value 16372 0 161 16207 Error output 16368 16374 Measuring object within range 20 mA Analog output User defined characteristic 4 mA 3 mA Teach 1 SMR Digital value Error output optoNCDT 1402 RS232 Default characteristic Analog output 16372 16380 3883 Teach 2 11184 EMR 16382 16374 Measuring object within range Page 21 Operation 20 mA Analog output User defined characteristic 4 mA 3 mA Teach 2 SMR Teach 1 EMR Measuring object Digital value 16372 16380 Error output 3883 11184 16382 16374 Measuring object within range Fig. 7 Reverse user defined characteristic The minimum distance of the teach values 1/2 to one other is 10 % of the measurement range. The teaching process requires a valid measuring signal. The teaching process is terminated at „no target“, „target not evaluated“, „to close to the sensor“ - beyond SMR“ or „to far from the sensor - beyond EMR“. optoNCDT 1402 RS232 Page 22 Operation 6.3 Average The optoNCDT 1402 is supplied ex factory with the default setting „moving averaging, number of averaging N = 1“ (no averaging activated). Implemented averaging methods in the sensor: -- Moving average -- Median The purpose of averaging is to: -- Improve the resolution -- Eliminate signal spikes -- “Smooth out“ the signal. Averaging has no effect on linearity. A combination of the two averaging methods is not possible. The averaging is recommended for static measurements or slowly changing measurement values. 6.3.1 Averaging Number N In every measurement cycle (at a measurement rate of 1.5 kHz every 0.66 ms) the internal average is calculated anew. The averaging number N indicates the number of consecutive measurement values to be averaged in the sensor. Averaging does not affect the measurement rate or data rates in digital measurement value output. 6.3.2 Moving Average (Default Setting) The selected number N of successive measurement values (window width) is used to generate the moving average value M gl on the basis of the following formula: N MW (k) M gl = k=1 N MW = Measuring value, N = Averaging number, k = Running index M gl = Averaging value respectively output value Mode: Each new measurement value is added and the first (oldest) measurement value from the averaging process (from the window) taken out again. This results in short transient recovery times for jumps in measurement values. optoNCDT 1402 RS232 Page 23 Operation Example: N = 4 ... 0, 1, 2, 2, 1, 3 ... 1, 2, 2, 1, 3, 4 2, 2, 1, 3 = M gl (n) 4 i 2, 1, 3, 4 = M gl (n+1) 4 Measurement values Output The moving average in the optoNCDT 1402 can only be generated for up to a maximum of 128 values. 6.3.3 Median The median is generated from a pre-selected number of measurement values. To do so, the incoming measurement values (3, 5, 7 or 9 measurement values) are resorted again after every measurement. The average value is then given as the median. In generating the median in the controller, 3, 5, 7 or 9 measurement values are taken into account, i.e. there is never a median of 1. This permits individual interference pulses to be repressed, but the measurement value curve is not smoothed to any great extent. Example: Average from five measurement values ... 0 1 2 4 5 1 3 Sorted measurement values: 1 2 3 4 5 ... 1 2 4 5 1 3 5 6.4 Sorted measurement values: 1 3 4 5 5 Median (n) = 3 Median (n+1) = 4 Measurement Rate and Output Rate The measurement rate defines the number of measurements performed by the sensor per second. The measurement rate may be 1.5 kHz, 1.0 kHz, 750 Hz, 375 Hz or 50 Hz. Details of how to change the measurement rate, see Chap. 8.4.15. The output rate gives the actual number of measurement values at the sensor output per second. The maximum output rate can never exceed the measurement rate. optoNCDT 1402 RS232 Page 24 Operation Recommendations: -- Use a high measurement rate for light colored and matt objects to be measured. -- Use a low measurement rate for dark or shiny objects to be measured (e.g. surfaces covered in black lacquer), for better measurement results. Output Current Maximum output rate Measurement rate RS232 Output rate £ Measurement rate; Dependent on the transmission rate (baud rate) and data format (ASCII code). The sensor continues to measure internally but holds back the output until the last measurement value has been issued in full. The next measurement value is the last valid value, with other values between being lost. Fig. 8 Output rates for the output types Calculation of the output rate using the RS232 serial interface: Abbreviations used: Output rate = Measuring rate / n n = Partial factor int = Integral part of ( ) b = Byte/measurement value (binary format b=2, ASCII b=6) MR = Measurement rate [Hz] n = int (b * 10 * MR / BR) + 1 BR = Baud rate [Baud] Example: Measurement rate = 750 Hz, ASCII-Format (b=6), Baud rate = 115200 Baud --> n = int (0.39) + 1 = 1 --> Output rate = 750 Hz / 1 = 750 Hz. optoNCDT 1402 RS232 Page 25 Operation 6.5 Timing The controller operates internally with real time cycles in a pipeline mode: 1. Exposure: Charging the image detector in the receiver (measurement). 2. Reading: Reading out of the imaging device and converting into digital data. 3. Computation: Measurement computation. 4. Controlling. The output through the analog and digital interface starts with the beginning of every new cycle. The analog value and digital switch outputs are updated immediately and the digital output starts with the start bit. Each cycle takes 666 μs at a measuring rate of 1.5 kHz. The measured value N is available after each cycle with a constant lag of four cycles in respect to the real time event. The delay between the input reaction and the signal output is therefore 2 up to 2.7 ms. The processing of the cycles occurs sequentially in time and parallel in space (pipelining, see Fig. 9). This guarantees a true constant real time data stream. Cycle 1. 2. 3. 4. 5. 6. Time max. 5 s 666 µs 1322 µs 1998 µs 2664 µs 3330 µs 3996 µs Exposure N Reading N Computation N Controlling N Output N Exposure N+1 Reading N+1 Computation N+1 Controlling N+1 Initialization Exposure N+2 Reading N+2 Computation N+2 including the output of the Exposure N+3 Reading N+3 info string First exposure after power up of the sensor Exposure N+4 Output N+1 Controlling N+2 ... Computation N+3 ... Reading N+4 ... ... ... Fig. 9 Sensor timing at a measurement rate of 1.5 kHz i The sensor needs time until measuring values are available according to the set averaging number N. optoNCDT 1402 RS232 Page 26 Measurement Value Output 7. Measurement Value Output The optoNCDT 1402 can issue the measurement values either via the analog output or the RS232 serial interface. The two different types of output cannot be used concurrently. When using the cable PC1401-x / U, the voltage output is 1 ... 5 V, see Chap. 5.2. 7.1 Current Output Max. range 4 mA ... 20 mA Output amplification I OUT16 mA = 100 % Measuring range Error value: 3.75 mA (±10 µA) Proceed as follows to set the sensor into operation after a short circuiton the analog output: Switch off the sensors power supply. 20 mA Default characteristic Analog output 4 mA 3 mA SMR EMR Measuring range Measuring object Wait appr. 3 s. Digital value 16372 0 161 16207 16368 Switch on the sensors power supply. 16374 Fig. 10 Current signal output Calculation of measurement value x in mm from analog current Reference value SMR x [mm] = (I OUT - 4 mA)* Reference value MMR: MR [mm] 16 [mA] x [mm] = (I OUT - 4 mA)* MR [mm] 16 [mA] - MR/2 Example: Measuring range = 10 mm, I OUT = 12 mA; Result: x = 5 mm or x = 0 mm optoNCDT 1402 RS232 Page 27 Measurement Value Output 7.2 Digital Value Output 7.2.1 Data Protocol ILD1401 The digital measurement values are issued as unsigned digital values (raw values). Digital value Used for 0 ... 39 SMR back-up 40 ... 4055 Measurement range 4056 ... 4095 EMR back-up Calculation of a measurement value in mm from digital output: Reference value Start of Measuring Range: x [mm] = (digital OUT * 1.02 4096 - 0.01) * MR [mm] Reference value Midrange x [mm] = (digital OUT * 1.02 4096 - 0.51) * MR [mm] Example: MR =10 mm, digital value = 2048, measurement value = 5 mm or 0 mm Note: A digital value can be calculated from a measurement value (millimeter) as follows: digital OUT = optoNCDT 1402 RS232 x [mm] 4096 + 0.01 * MR [mm] 1.02 Page 28 Measurement Value Output 7.2.2 Data Protocol ILD1402 The digital measurement values are issued as unsigned digital values (raw values). Digital value Used for Digital value Used for 0 ... 16367 Value range 16208 ... 16367 EMR back-up (1 %) 0 ... 160 SMR back-up (1 %) 16370 ... 16383 Error codes 161 ... 16207 Measurement range Calculation of a measurement value in mm from digital output: Reference value Start of Measuring Range: x [mm] = (digital OUT * 1.02 16368 - 0.01) * MR [mm] Reference value Midrange x [mm] = (digital OUT * 1.02 16368 - 0.51) * MR [mm] Example: MR =10 mm, digital value = 8184, measurement value = 5 mm or 0 mm Note: A digital value can be calculated from a measurement value (millimeter) as follows: digital OUT = 7.3 x [mm] 16368 + 0.01 * MR [mm] 1.02 Digital Error Codes Digital error codes are issued in the same way as measurement values. Value range for error codes: 16370 ... 16384 (digital OUT) -- 16370 no object detected -- 16372 too close to the sensor -- 16374 too far from the sensor -- 16376 target can not be evaluated -- 16378 external laser off -- 16380 target moves towards the sensor -- 16382 target moves away from sensor -- 16383 internal error optoNCDT 1402 RS232 Page 29 Serial Interface RS232 8. Serial Interface RS232 8.1 Interface Parameter The optoNCDT 1402 comes with a RS232 serial interface to enable the sensor to be operated from a standard computer and measurement values and error codes to be transferred. The sensor can operate with two different data protocols: -- Data protocol ILD1401 -- Data protocol ILD1402 Default settings Baud rate Parity Data bits Start/stop bit Data protocol ILD1401 Data protocol ILD1402 38400 115200 none 8 1 8.2 Data Format for Measurement Values and Error Codes 8.2.1 Binary Format The data word is comprised of two consecutive bytes (H-byte/L-byte). One flag bit in each byte differentiates a high from a low byte. Start 1 7 Bit MSB Stop Start 0 7 Bit LSB Stop Conversion of the binary data format: For conversion purposes the high and low bytes must be identified on the basis of the first bit (flag bit), the flag bits deleted and the remaining 2 x 7 bits compiled into 14 bit data word. Reception: optoNCDT 1402 RS232 H-Byte 1 D13 D12 D11 D10 D9 D8 D7 L-Byte D6 D5 D4 D3 D2 D1 D0 0 Page 30 Serial Interface RS232 Result of conversion 0 i 0 D13 D12 D11 D10 D9 D8 D7 D6 D5 D4 D3 D2 D1 D0 If the sensor operates with the ILD1401 data protocol, the measurement value is a 12 bit word, e.g. the bits D12 and D13 are 0. Replies with a length of 4 Bytes must be swapped according to the following rule: Reception: 0 1 2 3 4 5 6 7 Conversion: 3 2 1 0 7 6 5 4 This rule does not apply to values. 8.2.2 ASCII Format Output of 5 characters (digits) in ASCII code for the digital value + 1 tag „CR“ (= 0x0D), i.e. a total of 6 characters. Digital values with just 3 or 4 digits are preceded by blank characters. Example: Digital value 2099 Transfer: “_2099“ (preceded by 1 blank character) „CR“ ASCII code (Hex.) 0x20 0x32 0x30 0x39 0x39 Characters SP 2 0 9 9 i 0x0D CR ASCII characters can be easily shown using a terminal program. 8.2.3 Request the Data Protocol PC transmits “---R”. Sensor replies “---14CI1“ Sensor operates with the ILD1401 data protocol or “---14CI2“ Sensor operates with the ILD1402 data protocol. optoNCDT 1402 RS232 Page 31 Serial Interface RS232 8.3 Data Protocol ILD1401 8.3.1 Setup of the Commands The commands for the sensor are transmitted in full duplex mode. Each instruction has a head, the ID, the command, the quantity and data if required (parameter, if quantity > 0). The head contains 4 bytes to identify a connection towards the sensor. The ID consists of 2 bytes, the command and quantity) consists of 1 byte. The complete string (without parameter) has a length of 8 bytes. The quantity is a equivalent of the subsequent bytes. Each complete command is returned by the sensor. The answer contains the 2 ID bytes (equivalent to the transmitted ID), the modified command byte, the quantity and response informations. The modified command byte = command OR masked with 0x80 hex if the command was transmitted successful. If an error happens the modified command byte = command OR masked with 0xC0 hex. In the case of an error the quantity is 1 and contains the error code. Byte 1 Byte 2 Byte 3 Head Byte 4 Byte 5 Byte 6 ID Byte 7 Command Byte 8 Quantity Byte 9 Parameter Fig. 11 Set-up of a command in the transmitter Byte 1 Byte 2 ID Byte 3 Command OR masked with 0x80 hex Byte 4 Quantity Byte 5 Parameter Fig. 12 Set-up of a command in the receiver, error-free transmitted Byte 1 Byte 2 ID Byte 3 Command OR masked with 0xC0 hex Byte 4 Byte 5 Quantity = 1 Error code Fig. 13 Set-up of a command in the receiver, faulty transmission optoNCDT 1402 RS232 Page 32 Serial Interface RS232 Error code Description Bytes Command error 1 Faulty number of parameters 1 Time out 1 8.3.2 Overview of Commands Value 2 3 4 Information commands 0x0900 Chap. 8.3.4 VERSION Shows the software version 0x0C00 Chap. 8.3.3 INFO Shows the sensor data Chap. 8.3.5 MEDIAN Median filter over 3 values, on/off OUTPUTCHANNEL Output analog / digital SAVELASTMV Behavior of the analog output in case of errors BOOT Reboots the sensor Filter 0x1001 Measurement value output 0x0E01 Chap. 8.3.6 Error output (analog output) 0x0F01 Chap. 8.3.7 Reset 0x0100 Chap. 8.3.8 Switch data protocol ILD1401 / ILD1402 optoNCDT 1402 RS232 0x1100 Chap. 8.3.9 SET_CIMODE_1402 0x2D2D2D52 h Chap. 8.3.10 GET_CI_MODE Sensor operates with data protocol ILD1402 Requests the command interpreter state of the sensor Page 33 Serial Interface RS232 8.3.3 Reading the Sensor Parameters, INFO Name:INFO Description: Supplies the info string. Format Byte 1 “+” Reply Byte 1 „I“ Byte 2 “+” Byte 3 “+” Byte 4 0x0D Byte 2 „L“ Byte 1 Byte 2 Byte 3 “I“ “L“ 0x8C Info is a readable ASCII string Byte 5 „I“ Byte 6 „L“ Byte 3 0x8C Byte 7 0x0C Byte 4 Quantity 1 Byte 8 0x00 Byte 9 none Byte 5 Info string Byte 4 0x89 Article 4120154 Option 000 Series 1234570 MR 50 SoftVer 1.001 Date 09/01/23 Out Channel analog Anlog Error error value Filter off Command error-free Byte 1 Byte 2 “I“ “L“ Faulty command Byte 3 0xCC Byte 4 0x01 Byte 5 Error code 1) Number of bytes depends on the content of the response. optoNCDT 1402 RS232 Page 34 Serial Interface RS232 8.3.4 Reading the Software Version, VERSION Name:VERSION Description: The sensor transmits the software version. Format Byte 1 “+” Byte 2 “+” Byte 3 “+” Byte 4 0x0D Reply Byte 1 „I“ Byte 2 „L“ Byte 3 0x89 Byte 4 Quantity Command error-free Faulty command 8.3.5 Byte 5 „I“ Byte 6 „L“ Byte 7 0x09 Byte 8 0x00 Byte 9 none Byte 5 Info string Byte 1 Byte 2 Byte 3 Byte 4 “I“ “L“ 0x89 0x07 Version is a readable ASCII string: 1.001 Byte 1 “I“ Byte 2 “L“ Byte 3 0xC9 Byte 4 0x01 Byte 5 Error code Average On/Off, MEDIAN Name:MEDIAN Default setting: Median off Description: Switches between „Averaging on“ and „Averaging off“. The median is generated from a preset number of measurement values. Here the inputted measurement values (3 measurement values) are resorted after each measurement. The average value is then outputted as the median. When the median is generated in the controller only 3 measurement values are taken into account, i.e. a 0 median is not possible. This means that individual interference pulses can be suppressed. The measurement value curve is not smoothed to a great extent. Byte 9 = 0; Median off Byte 9 = 1; Median on optoNCDT 1402 RS232 Page 35 Serial Interface RS232 Format Byte 1 “+” Byte 2 “+” Byte 3 “+” Byte 4 0x0D Byte 5 „I“ Byte 1 Byte 2 „I“ „L“ Command error-free Byte 3 0x90 Byte 4 0x00 Byte 5 none Byte 1 Byte 2 “I“ “L“ Faulty command Byte 4 0x01 Byte 5 Error code Reply 8.3.6 Byte 3 0xD0 Byte 6 „L“ Byte 7 0x10 Byte 8 0x01 Byte 9 Median ON/OFF Digital or Analog Data Output, OUTPUTCHANNEL Name:OUTPUTCHANNEL Description: Selects the output channel (analog / digital) for the sensor. If the digital output is selected the serial interface transmits measured values with a data rate of 1.5 kHz. If the analog output is selected the serial interface transmits the commands and the responses only. Default setting: analog output Byte 9 = 0; analog Byte 9 = 1; digital Format Byte 1 “+” Byte 2 “+” Byte 3 “+” Byte 4 0x0D Byte 5 „I“ Byte 1 Byte 2 „I“ „L“ Command error-free Byte 3 0x8E Byte 4 0x00 Byte 5 none Byte 1 Byte 2 “I“ “L“ Faulty command Byte 4 0x01 Byte 5 Error code Reply optoNCDT 1402 RS232 Byte 3 0xCE Byte 6 „L“ Byte 7 0x0E Byte 8 0x01 Byte 9 Channel Page 36 Serial Interface RS232 8.3.7 Sensor Behavior in Error Case, SAVELASTMV Name:SAVELASTMV Description: Default setting: „Error code“, also 3.75 mA on the analog output Format Switches between „Hold last value“ and „Error code“ of the analog output. Byte 1 “+” Byte 2 “+” Byte 3 “+” Byte 4 0x0D Byte 5 „I“ Byte 1 Byte 2 „I“ „L“ Command error-free Byte 3 0x8F Byte 4 0x00 Byte 5 none Byte 1 Byte 2 “I“ “L“ Faulty command Byte 4 0x01 Byte 5 Error code Reply Byte 3 0xCF Byte 6 „L“ Byte 7 0x0F Byte 8 0x01 Byte 9 Output type Output type Description Output type = „Hold last value“ (in the case of an error the last valid measured value is shown on the analog output) Output type = „Error code“ (in the case of an error a value < 4 mA is output) 8.3.8 Reset Sensor, BOOT Bytes Value 1 0 1 1 Name:BOOT Description: The sensor makes a software reset. The default settings for output and filter are used. -- Current output: error code -- Median off The response is sent before the reset is done. Format Byte 1 Byte 2 Byte 3 Byte 4 “+” “+” “+” 0x0D optoNCDT 1402 RS232 Byte 5 „I“ Byte 6 „L“ Byte 7 0x01 Byte 8 0x00 Byte 9 none Page 37 Serial Interface RS232 Reply Byte 1 Byte 2 „I“ „L“ Command error-free Byte 3 0x81 Byte 4 0x00 Byte 1 Byte 2 “I“ “L“ Faulty command Byte 4 0x01 Byte 5 Error code 8.3.9 Byte 3 0xC1 Byte 5 none Changing Data Protocol, SET_CIMODE_1402 Name:SET_CIMODE_1402 Description: Switches the sensor into the ILD1402 data protocol. The sensor replies with the ILD1401 data protocol, after sending the reply the sensor switches to the mode and maintains a reset. Format Byte 1 “+” Byte 2 “+” Byte 3 “+” Byte 4 0x0D Byte 5 „I“ Byte 1 Byte 2 „I“ „L“ Command error-free Byte 3 0x91 Byte 4 0x00 Byte 5 none Byte 1 Byte 2 “I“ “L“ Faulty command Byte 4 0x01 Byte 5 Error code Reply optoNCDT 1402 RS232 Byte 3 0xD1 Byte 6 „L“ Byte 7 0x11 Byte 8 0x00 Byte 9 none Page 38 Serial Interface RS232 8.3.10 Request Data Protocol, GET_CI_MODE Name:GET_CI_MODE Description: Requests the state of the sensors command interpreter. Format: 31 24 23 „-“ Reply: 31 16 15 „-“ 24 23 „-“ „4“ 8 7 „-“ 16 15 „-“ „C“ 8 7 „-“ „I“ 0 hex 0x2D2D2D52 0 hex 0x2D2D2D31 0x3443493X „R“ „1“ 0x3X Options for X: X = 1, the command interpreter of the sensor operates with the ILD1401 data protocol. X = 2, the command interpreter of the sensor operates with the ILD1402 data protocol. Note: The sensor uses a different protocol! optoNCDT 1402 RS232 Page 39 Serial Interface RS232 8.4 Data Protocol ILD1402 8.4.1 Setup of the Commands The commands for the sensors are comprised of command data which are transmitted in full duplex mode. Each command packet is comprised of a whole number multiple of 32 bit words, see Fig. 14. 1 31 16 15 Header 2 ID 3 4 5 6 24 23 8 7 0 Command (16 Bit) Package length (16 Bit) Data 1 ... Data (n) Contents Start word Sensor identifier, Command header (2 words) e.g. “ILD1“ Command code Data word quantity n+2 1 st Dats worf (4 Bytes) ... th n Data word (4 Bytes) Fig. 14 Structure of a command packet Since most serial interfaces use an 8 bit data format, 4 consecutive bytes are combined into a 32 bit word. Each command packet has a header consisting of two 32 bit words followed by the command and, if required, other data as well. The top two bits (No. 31 and 30) are always “0“ in the transmitted command. optoNCDT 1402 RS232 Page 40 Serial Interface RS232 8.4.2 Communication without Error No start word is transmitted if the sensor replies to a command. The 1st word is then the sensor identifier. The second word is the command with set MSB (Bit 31 = 1, corresponding an OR operation of the command with 0x800) and the new package length is larger according to the quantity of data words to be transmitted. A firm 32 bit word 0x20200D0A forms the conclusion of the answer. The conclusion is not a data word. 8.4.3 Communication with Error If the sensor detects an error during the execution of a command, the second highest bit (bit 30) of the command is also set (the command is OR operated with 0xC000). Additionally a command error code is transferred as data word, see Fig. 15. The resulting package length now amounts to 3 data words. The reply is finished with a 32 bit word 0x20200D0A (2 blank characters + CR + LF). Error Code X Description 1 Command unknown 2 Incorrect parameter value 3 Invalid parameter 4 Time out 5 Command failed 6 Warning for averaging type and averaging number 1 Fig. 15 Command error codes 1), see Chap. 8.4.7 optoNCDT 1402 RS232 Page 41 Serial Interface RS232 8.4.4 Overview Information command 0x20490002 Chap. 8.4.5 GET_INFO 0x204A0002 Chap. 8.4.6 GET_SETTINGS Average 0x207F0004 Chap. 8.4.7 SET_AV Measurement value output 0x20760002 Chap. 8.4.8 DAT_OUT_OFF 0x20770002 Chap. 8.4.9 DAT_OUT_ON 0x20F40003 Chap. 8.4.11 SET_OUTPUTMODE 0x20F50003 Chap. 8.4.12 SET_OUTPUTTIME_MS Switch output settings 0x20900003 Chap. 8.4.10 SET_OUTPUT_CHANNEL Speed 0x20800003 Chap. 8.4.14 SET_BAUDRATE 0x20850003 Chap. 8.4.15 SET_SCANRATE Error output (analog output) 0x20810003 Chap. 8.4.13 SET_ANALOG_ERROR_HANDLER Switching off the laser (external) 0x20870002 Chap. 8.4.18 LASER_ON 0x20860002 Chap. 8.4.18 LASER_OFF Measurement value data format 0x20880003 Chap. 8.4.19 ASCII_OUTPUT Reset 0x20F10002 Chap. 8.4.21 SET_DEFAULT 0x20F00002 Chap. 8.4.20 RESET_BOOT Memory mode 0x20F70003 Chap. 8.4.22 SET_SAVE_SETTINGS_MODE optoNCDT 1402 RS232 Shows sensor data Shows sensor settings Sets average type and value Stops measurement value output Permanent measurement value output Output mode Output time in ms Output: current or RS232 115.2 / 57.6 / 38.4 / 19.2 / 9.6 kBaud Measurement rate: 1.5 kHz; 1.0 kHz; 750 Hz; 375 Hz Behavior of the analog output in the case of an error Switches the laser on Switches the laser off Options: ASCII / Binary Reset to default factory settings Reboot the sensor Volatile / nonvolatile Page 42 Serial Interface RS232 Scaling values 0x20F90004 Chap. 8.4.23 0x20FA0002 Chap. 8.4.24 Search algorithm 0x20FB0003 Chap. 8.4.16 Threshold 0x20FC0003 Chap. 8.4.18 Switch data protocol 0x20F20002 Chap. 8.4.25 0x2D2D2D52 Chap. 8.4.26 8.4.5 SET_TEACH_VALUE RESET_TEACH_VALUE Sets T1 + T2 0 ... 16368 Sets T1 = 0 / T2 = 16368 SET_PEAKSEARCHING First peak, last peak, global maximum SET_THRESHOLD Lower than standard, standard, higher than standard, highest SET_CIMODE_1401 GET_CI_MODE Sensor operates with ILD1401 data protocol Requests the command interpreter state of the sensor Reading the Sensor Parameters, GET_INFO Name:GET_INFO Description: Supplies the info string. This shows all parameters currently stored in the sensor. Format: 31 24 23 16 15 8 7 0 hex „+“ „+“ „+“ 0x0d („CR“) 0x2B2B2B0D „l“ „L“ „D“ „1“ 0x494C4431 0x20 0x49 0x00 0x02 0x20490002 optoNCDT 1402 RS232 Page 43 Serial Interface RS232 Reply: 31 24 23 16 15 8 7 0 hex „l“ 0xA0 „L“ „D“ „1“ 0x494C4431 0x49 0x00 0xxx 0xA04900xx Info string is a readable ASCII character string: ILD 1402: Standard A/N: 4120154 O/N: 000 S/N: 1234570 MR: 50 SoftVer: 1.001.796 BootVer: 1.001.16 Date: 09/01/23 Out Channel: analog | digital Analog Error: last value | error value | error value after cycles xx //xx is 2 up to 99 Filter Type: moving average | median Filter Number: xx //with moving average xx is 1 up to 128, with median xx is 7, 5, 7 or 9 Scanrate: xxHz //xx is 1500 Hz, 1000 Hz, 750 Hz, 375 Hz type of digital output: binary | ascii mode of analog/digital output: continuous | time | trigger output time: xx //xx is time in ms 1 key status: unlock | lock | auto lock mode of save setting: no save | save at each time mode of extern input: as teach in | as output trigger peak searching: global maximum | first peak | last peak Teach value 1: xx //(xx is 1.0 up to 16368.0 Teach value 2: xx //xx is 1.0 up to 16368.0 0x20 0x20 0x0D 0x0A 0x20200D0A | = separates variants from each other // = beginning of a comment 1) Output time is available only, if ”mode of analog/digital output“ is set to ”time” optoNCDT 1402 RS232 Page 44 Serial Interface RS232 8.4.6 Reading the Sensor Settings, GET_SETTINGS Name:GET_SETTINGS Description: Supplies the current sensor settings. Swap the received bytes according, see Chap. 8.2.1. These are as follows: Output channel -- 0 = Current -- 1 = Digital Teach value 1 0.0 … 16368.0 e. g. float: 3027.426 = hexadecimal: 0x453d36d1 Teach value 2 0.0 … 16368.0 e. g. float: 11068.851 = hexadecimal: 0x462cf367 Analog error handler -- 0 = hold last value -- 1 = error output -- 2…99 hold last value for 2…99 images respectively cycles Average type -- 0 = moving average -- 1 = Median Average value -- 1…128 moving average, if average type = 0 -- 3, 5, 7, 9 Median, if average type = 1 optoNCDT 1402 RS232 Measurement rate -- 0 = 1500 Hz -- 1 = 1000 Hz -- 2 = 750 Hz -- 3 = 375 Hz -- 4 = 50 Hz Baud rate -- 0 = 115200 Baud -- 1 = 57600 Baud -- 2 = 38400 Baud -- 3 = 19200 Baud -- 4 = 9600 Baud Digital output type -- 0 = Binary -- 1 = ASCII Analog, digital output mode -- 0 = continuously each measurement, depending on baud rate and the measuring frequency; delay = (Bit quantity / Baud rate) * measuring frequency [Hz] (if delay < 0, delay = delay +1) delay = number of cycles with no serial output -- 1 = time-based, see output time [ms] -- 2 = trigger controlled, see external input mode Output time [ms] 1…65535 Page 45 Serial Interface RS232 Save settings mode -- 0 = transmitted settings are stored in the RAM and are valid until power off -- 1 = transmitted settings are stored in the FLASH and are valid, even after power off/on Peak searching -- 0 = peak with global maximum -- 1 = first peak, direction pixel 0 up to pixel 127, left to right -- 2 = last peak, direction pixel 0 up to pixel 127, left to right Threshold -- 0 = lower than standard -- 1 = standard -- 2 = higher than standard -- 3 = highest Measuring range [mm] -- XXX X = 1 ...65535 Reserved 1 Reserved 2 Reserved 3 Reserved 4 Format: 31 24 23 „+“ „l“ 0x20 optoNCDT 1402 RS232 16 15 „+“ „L“ 0x4A 8 7 „+“ „D“ 0x00 0 0x0d („CR“) „1“ 0x02 hex 0x2B2B2B0D 0x494C4431 0x204A0002 Page 46 Serial Interface RS232 Reply: 31 24 23 „l“ 0xA0 0x00 0xXX 0xXX 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 optoNCDT 1402 RS232 16 15 „L“ „D“ 0x4A 0x00 Output channel 0x00 0x00 Teach value 1 0xXX 0xXX Teach value 2 0xXX 0xXX Analog error handler 0x00 0x00 Average type 0x00 0x00 Average value 0x00 0x00 Measurement rate 0x00 0x00 Baud rate 0x00 0x00 Digital output type 0x00 0x00 Analog digital output mode 0x00 0x00 Output time 0x00 0xXX Save settings mode 0x00 0x00 Peak searching 0x00 0x00 Threshold 0x00 0x00 8 7 „1“ 0x17 0 hex 0x494C4431 0xA04A0017 0x0X 0x0000000X 0xXX 0xXXXXXXXX 0xXX 0xXXXXXXXX 0xXX 0x000000XX 0x0X 0x0000000X 0xXX 0x000000XX 0x0X 0x0000000X 0x0X 0x0000000X 0x0X 0x0000000X 0x0X 0x0000000X 0xXX 0x0000XXXX 0x0X 0x0000000X 0x0X 0x0000000X 0x0X 0x0000000X Page 47 Serial Interface RS232 0x00 0x00 0x00 0x00 0x00 0x20 8.4.7 Measuring range 0x00 0xXX Reserved 1 0x00 0x00 Reserved 2 0x00 0xXX Reserved 3 0x00 0x00 Reserved 4 0x00 0x00 Last data word 0x20 0x0D 0xXX 0x0000XXXX 0x0X 0x00000000 0xXX 0x00000000 0x0X 0x00000000 0x0X 0x00000000 0x0A 0x20200D0A Average Type and Average Number, SET_AV Name:SET_AV Description: Default setting: moving average 1, thus no averaging optoNCDT 1402 RS232 Sets the average type and the average number N. Parameter: -- Average type X = 0 --> Moving average X = 1 --> Median -- Average number XX = 1 ... 128 --> Moving average, if average type = moving average XX = 3, 5, 7, 9 --> Median, if average type = Median Page 48 Serial Interface RS232 Format: 31 24 23 „+“ „l“ 0x20 0x00 0x00 Reply: 31 24 23 „l“ 0xA0 0x20 8.4.8 16 15 „+“ „L“ 0x7F 0x00 0x00 8 7 „+“ „D“ 0x00 0x00 0x00 16 15 „L“ 0x7F 0x20 0 hex 0x2B2B2B0D 0x494C4431 0x207F0004 0x0000000X 0x000000XX 0 hex 0x494C4431 0xA07F0002 0x20200D0A 0x0d („CR“) „1“ 0x04 0x0X 0xXX 8 7 „D“ 0x00 0x0D „1“ 0x02 0x0A Stopping the Measurement Value Output, DAT_OUT_OFF Name:DAT_OUT_OFF Description: Switches off the digital output for the measurement values. This has no effect on communication with the sensor via the digital interface. This command has a higher priority in trigger mode. The command is volatile. Therefore data out is on after power on. Format: 31 24 23 „+“ „l“ 0x20 Reply: 31 24 23 „l“ 0xA0 0x20 optoNCDT 1402 RS232 16 15 „+“ „L“ 0x76 8 7 „+“ „D“ 0x00 16 15 „L“ 0x76 0x20 8 7 „D“ 0x00 0x0D 0 hex 0x2B2B2B0D 0x494C4431 0x20760002 0 hex 0x494C4431 0xA0760002 0x20200D0A 0x0d („CR“) „1“ 0x02 „1“ 0x02 0x0A Page 49 Serial Interface RS232 8.4.9 Starting the Measurement Value Output, DAT_OUT_ON Name:DAT_OUT_ON Description: Switches on the digital data output for the measurement values. The output channel (output type) must also be set to the digital output, otherwise the measurement data cannot be received from the sensor. Format: 31 24 23 „+“ „l“ 0x20 Reply: 31 16 15 „+“ „L“ 0x77 24 23 „l“ 0xA0 0x20 8 7 „+“ „D“ 0x00 16 15 „L“ 0x77 0x20 0 hex 0x2B2B2B0D 0x494C4431 0x20770002 0 hex 0x494C4431 0xA0770002 0x20200D0A 0 hex 0x2B2B2B0D 0x494C4431 0x20900003 0x0000000X 0x0d („CR“) „1“ 0x02 8 7 „D“ 0x00 0x0D „1“ 0x02 0x0A 8.4.10 Digital or Analog Data Output, SET_OUTPUT_CHANNEL Name:SET_OUTPUT_CHANNEL Description: Default setting: analog output Sets the output type for the measurement values. Parameter: -- X = 0 --> Analog output (4 ... 20 mA) -- X = 1 --> Digital output (RS232) Format: 31 24 23 „+“ „l“ 0x20 0x00 optoNCDT 1402 RS232 16 15 „+“ „L“ 0x90 0x00 8 7 „+“ „D“ 0x00 0x00 0x0d („CR“) „1“ 0x03 0x0X Page 50 Serial Interface RS232 Reply: 31 24 23 „l“ 0xA0 0x20 16 15 „L“ 0x90 0x20 8 7 „D“ 0x00 0x0D 0 „1“ 0x02 0x0A hex 0x494C4431 0xA0900002 0x20200D0A 8.4.11 Characteristics for Digital or Analog Data Output, SET_OUTPUTMODE Name:SET_OUTPUTMODE Default setting: continuously Description: Sets the output characteristics. -- X = 0 --> continuously each measurement, depending on baud rate and the measuring frequency; delay = (Bit quantity / Baud rate) * measuring frequency [Hz], if delay < 0, delay = delay +1) delay = number of cycles with no serial output -- X = 1 --> time-based, see Chap. 8.4.12 -- X = 2 --> trigger controlled Format: 31 24 23 „+“ „l“ 0x20 0x00 Reply: 31 24 23 „l“ 0xA0 0x20 optoNCDT 1402 RS232 16 15 „+“ „L“ 0xF4 0x00 8 7 „+“ „D“ 0x00 0x00 16 15 „L“ 0xF4 0x20 8 7 „D“ 0x00 0x0D 0 hex 0x2B2B2B0D 0x494C4431 0x20F40003 0x0000000X 0 hex 0x494C4431 0xA0F40002 0x20200D0A 0x0d („CR“) „1“ 0x03 0x0X „1“ 0x02 0x0A Page 51 Serial Interface RS232 8.4.12 Set Output Time, SET_OUTPUTTIME_MS Name:SET_OUTPUTTIME_MS Description: Default setting: 500 ms Sets the output time for the analog or digital output value to be updated. Will be applicable at time-based measurement value output, see Chap. 8.4.11. Parameter: -- XXXX = 1 … 65535 [ms]. Format: 31 24 23 „+“ „l“ 0x20 0x00 Reply: 31 24 23 „l“ 0xA0 0x20 optoNCDT 1402 RS232 16 15 „+“ „L“ 0xF5 0x00 8 7 „+“ „D“ 0x00 0x00 16 15 „L“ 0xF5 0x20 8 7 „D“ 0x00 0x0D 0 hex 0x2B2B2B0D 0x494C4431 0x20F50003 0x0000000X 0 hex 0x494C4431 0xA0F50002 0x20200D0A 0x0d („CR“) „1“ 0x03 0x0X „1“ 0x02 0x0A Page 52 Serial Interface RS232 8.4.13 Error Output (Analog output), SET_ANALOG_ERROR_HANDLER Name:SET_ANALOG_ERROR_HANDLER Description: Default setting: error value Hold or not hold last measurement value. Parameter: -- X = 0 --> hold last measurement value -- X = 1 --> error value (3.75 mA) -- X = 2 … 99 --> hold last measurement value for 2 … 99 images respectively cycles This command only affects the analog output. If set to X = 0, the last valid measurement value will continue to be issued if an error occurs (no object, invalid object, object outside the measurement range or laser turned off). If set to X = 1, an error signal will be generated for the current output that has an error value of 3.75 mA. If set to X = 2 ... 99, the last valid measurement value will continue to be issued for X measuring cycles before an error signal is generated on the analog output. Format: 31 24 23 16 15 8 7 0 hex „+“ „+“ „+“ 0x0d („CR“) 0x2B2B2B0D „l“ „L“ „D“ „1“ 0x494C4431 0x20 0x81 0x00 0x03 0x20810003 0x00 0x00 0x00 0x0X 0x0000000X Reply: 31 24 23 „l“ 0xA0 0x20 optoNCDT 1402 RS232 16 15 „L“ 0x81 0x20 8 7 „D“ 0x00 0x0D 0 „1“ 0x02 0x0A hex 0x494C4431 0xA0810002 0x20200D0A Page 53 Serial Interface RS232 8.4.14 Set Baud Rate, SET_BAUDRATE Name:SET_BAUDRATE Description: Default setting: 115200 Baud Sets the transmission rate. Parameter: -- X = 0 --> 115200 -- X = 1 --> 57600 -- X = 2 --> 38400 -- X = 3 --> 19200 -- X = 4 --> 9600 The sensor still sends the reply with the old baud rate and only switches to the new baud rate once the reply has been sent. The output rate reduces automatically when the baud rate is changed because individual measurement values are skipped. i Do not forget to change your programs baud rate. Format: 31 24 23 „+“ „l“ 0x20 0x00 Reply: 31 „+“ „L“ 0x80 0x00 24 23 „l“ 0xA0 0x20 optoNCDT 1402 RS232 16 15 8 7 „+“ „D“ 0x00 0x00 16 15 „L“ 0x80 0x20 hex 0x2B2B2B0D 0x494C4431 0x20800003 0x0000000X 0 hex 0x494C4431 0xA0800002 0x20200D0A 0x0d („CR“) „1“ 0x03 0x0X 8 7 „D“ 0x00 0x0D 0 „1“ 0x02 0x0A Page 54 Serial Interface RS232 8.4.15 Set Measurement Rate, SET_SCANRATE Name:SET_SCANRATE Beschreibung: Sets the measurement rate [Hz]. Default setting: 1500 Hz Parameter: -- X = 0 --> 1500 -- X = 1 --> 1000 -- X= 2--> 750 - X = 3 --> 375 - X = 4 --> 50 Procedure: The sensor replies and then reboots. The string of the boot message contains “CI140x“, “CR“ “LF“ and the answer of “GET_INFO“. Format: 31 24 23 „+“ „l“ 0x20 0x00 Reply: 31 24 23 „l“ 0xA0 0x20 optoNCDT 1402 RS232 16 15 „+“ „L“ 0x85 0x00 8 7 „+“ „D“ 0x00 0x00 16 15 „L“ 0x85 0x20 8 7 „D“ 0x00 0x0D 0 hex 0x2B2B2B0D 0x494C4431 0x20850003 0x0000000X 0 hex 0x494C4431 0xA0850002 0x20200D0A 0x0d („CR“) „1“ 0x03 0x0X „1“ 0x02 0x0A Page 55 Serial Interface RS232 8.4.16 Peak Detection with Video Signal, SET_PEAKSEARCHING Name:SET_PEAKSEARCHING Description: Specifies the search algorithm. Parameter: -- X = 0 --> peak with global maximum -- X = 1 --> first peak, direction pixel 0 up to pixel 127, left to right -- X = 2 --> last peak, direction pixel 0 up to pixel 127, left to right Format: 31 24 23 „+“ „l“ 0x20 0x00 Reply: 31 16 15 „+“ „L“ 0xFB 0x00 24 23 „l“ 0xA0 0x20 8 7 „+“ „D“ 0x00 0x00 16 15 „L“ 0xFB 0x20 8 7 „D“ 0x00 0x0D 0 hex 0x2B2B2B0D 0x494C4431 0x20FB0003 0x0000000X 0 hex 0x494C4431 0xA0FB0002 0x20200D0A 0x0d („CR“) „1“ 0x03 0x0X „1“ 0x02 0x0A A peak inside the video signal is limited by overrun and subsequent shortfall the threshold limit. Several valid peaks are evaluated when measuring glass. Measurements on metal surfaces can also produce multiple peaks. Determine the valid peaks in the software tool (video signal). optoNCDT 1402 RS232 Page 56 Serial Interface RS232 8.4.17 Search Threshold, SET_THRESHOLD Name:SET_THRESHOLD Description: Defines the characteristics of the search threshold. Parameter: -- X = 0 --> lower than standard -- X = 1 --> Standard -- X = 2 --> higher than standard -- X = 3 --> highest i Changing the threshold from factory default (standard) may influence linearity and resolution. Modify the sensor only with specific materials as with semitransparent plastics and so educate the sensor recently. Format: 31 24 23 „+“ „l“ 0x20 0x00 Reply: 31 24 23 „l“ 0xA0 0x20 optoNCDT 1402 RS232 16 15 „+“ „L“ 0xFC 0x00 8 7 „+“ „D“ 0x00 0x00 16 15 „L“ 0xFC 0x20 8 7 „D“ 0x00 0x0D 0 hex 0x2B2B2B0D 0x494C4431 0x20FC0003 0x0000000X 0 hex 0x494C4431 0xA0FC0002 0x20200D0A 0x0d („CR“) „1“ 0x03 0x0X „1“ 0x02 0x0A Page 57 Serial Interface RS232 8.4.18 Switching off the Laser (External), LASER_OFF Name:LASER_OFF Description: Switches off the laser. This command is volatile e.g. the laser is on after power on. Format: 31 24 23 „+“ „l“ 0x20 Reply: i 31 „+“ „L“ 0x86 24 23 „l“ 0xA0 0x20 16 15 8 7 „+“ „D“ 0x00 16 15 „L“ 0x86 0x20 0 hex 0x2B2B2B0D 0x494C4431 0x20860002 0 hex 0x494C4431 0xA0860002 0x20200D0A 0x0d („CR“) „1“ 0x02 8 7 „D“ 0x00 0x0D „1“ 0x02 0x0A The command LASER_OFF is volatile. This means that the laser is switched on again if the power supply was switched off or the sensor was rebooted by means of the RESET_BOOT command and pin 2 is connected with GND. Name:LASER_ON Description: Format: Switches on the laser 31 24 23 „+“ „l“ 0x20 Reply: optoNCDT 1402 RS232 i 31 24 23 „l“ 0xA0 0x20 16 15 „+“ „L“ 0x87 8 7 „+“ „D“ 0x00 16 15 „L“ 0x87 0x20 8 7 „D“ 0x00 0x0D 0 hex 0x2B2B2B0D 0x494C4431 0x20870002 0 hex 0x494C4431 0xA0870002 0x20200D0A 0x0d („CR“) „1“ 0x02 „1“ 0x02 0x0A The command LASER_ON is effective only if pin 2 is connected with GND. Page 58 Serial Interface RS232 8.4.19 Change Data Format, ASCII_OUTPUT Name:ASCII_OUTPUT Description: Switches the data format for the measurement value output via the digital interface. The command replies will remain unaffected. Default setting: Binary format Parameter: -- X = 0 --> Binary output (2 Byte) -- X = 1 --> ASCII output (6 Byte) Format: 31 24 23 „+“ „l“ 0x20 0x00 Reply: 31 „+“ „L“ 0x88 0x00 24 23 „l“ 0xA0 0x20 optoNCDT 1402 RS232 16 15 8 7 „+“ „D“ 0x00 0x00 16 15 „L“ 0x88 0x20 hex 0x2B2B2B0D 0x494C4431 0x20880003 0x0000000X 0 hex 0x494C4431 0xA0880002 0x20200D0A 0x0d („CR“) „1“ 0x03 0x0X 8 7 „D“ 0x00 0x0D 0 „1“ 0x02 0x0A Page 59 Serial Interface RS232 8.4.20 Reset Sensor, RESET_BOOT Name:RESET_BOOT Description: Starts the sensor’s initialization phase. Duration about 900 ms. Procedure: The sensor replies and then re-boots. The string of the boot message contains “CI140x“, “CR“ “LF“ and the answer of “GET_INFO“. Format: 31 24 23 16 15 8 7 0 hex „+“ „+“ „+“ 0x0d („CR“) 0x2B2B2B0D „l“ „L“ „D“ „1“ 0x494C4431 0x20 0xF0 0x00 0x02 0x20F00002 Antwort: 31 24 23 „l“ 0xA0 0x20 16 15 „L“ 0xF0 0x20 8 7 „D“ 0x00 0x0D 0 „1“ 0x02 0x0A hex 0x494C4431 0xA0F00002 0x20200D0A 8.4.21 Set Default Setting, SET_DEFAULT Name:SET_DEFAULT Description: Resets the set parameters to the default settings (factory settings). This concerns: -- Data protocol ILD1401 Output channel: 0 --> analog output, Analog error handler: 1 --> in the case of an error: 3.75 mA on the analog output, Filter: 0 = Median off, -- Data protocol ILD1402 Output channel: 0 --> analog output, Teach value 1 --> 0.0 Teach value 2 --> 16368.0 Analog error handler: 1 --> in the case of an error: 3.75 mA on the analog output, Average type: 0 --> moving average, Average value: 1 --> no averaging, optoNCDT 1402 RS232 Page 60 Serial Interface RS232 Measurement rate: 0 --> 1500 Hz, Baud rate: 0 --> 115200 Baud, Digital output type: 0 --> binary, Analog digital output mode: 0 --> continuous, Output time --> 500 ms, Save settings mode: 1 --> transmitted new settings are stored in the FLASH Procedure: The sensor replies and then re-boots. The string of the boot message contains “CI140x“, “CR“ “LF“ and the answer of “GET_INFO“. Format: 31 24 23 „+“ „l“ 0x20 Reply: 31 „+“ „L“ 0xF1 24 23 „l“ 0xA0 0x20 optoNCDT 1402 RS232 16 15 8 7 „+“ „D“ 0x00 16 15 „L“ 0xF1 0x20 hex 0x2B2B2B0D 0x494C4431 0x20F10002 0 hex 0x494C4431 0xA0F10002 0x20200D0A 0x0d („CR“) „1“ 0x02 8 7 „D“ 0x00 0x0D 0 „1“ 0x02 0x0A Page 61 Serial Interface RS232 8.4.22 Save Settings in RAM or FLASH, SET_SAVE_SETTINGS_MODE Name:SET_SAVE_SETTINGS_MODE Description: Default setting: Save in FLASH Saves the transmitted settings into the RAM or the FLASH. Parameter: -- X = 0 --> transmitted new settings are stored in the RAM and valid until power off. -- X = 1 --> transmitted new settings are stored in the FLASH and are thus are generally valid. Format: 31 24 23 „+“ „l“ 0x20 0x00 Reply: 31 „+“ „L“ 0xF7 0x00 24 23 „l“ 0xA0 0x20 optoNCDT 1402 RS232 16 15 8 7 „+“ „D“ 0x00 0x00 16 15 „L“ 0xF7 0x20 hex 0x2B2B2B0D 0x494C4431 0x20F70002 0x0000000X 0 hex 0x494C4431 0xA0F70002 0x20200D0A 0x0d („CR“) „1“ 0x03 0x0X 8 7 „D“ 0x00 0x0D 0 „1“ 0x02 0x0A Page 62 Serial Interface RS232 Default setting: Teach value 1: 0.0 Teach value 2: 16368.0 8.4.23 Scaling Values for the Analog Output, SET_TEACH_VALUE Name:SET_TEACH_VALUE Description: Sets the scaling values. Parameter: -- Teach value 1, XXXXXXXX --> 0.0 up to 16368.0 -- Teach value 2, XXXXXXXX --> 0.0 up to 16368.0 Format: 31 24 23 „+“ „l“ 0x20 0xXX 0xXX Reply: 31 16 15 „+“ „L“ 0xF9 0xXX 0xXX 24 23 „l“ 0xA0 0x20 8 7 „+“ „D“ 0x00 0xXX 0xXX 16 15 „L“ 0xF9 0x20 8 7 „D“ 0x00 0x0D 0 hex 0x2B2B2B0D 0x494C4431 0x20F90004 0xXXXXXXXX 0xXXXXXXXX 0 hex 0x494C4431 0xA0F90002 0x20200D0A 0x0d („CR“) „1“ 0x04 0xXX 0xXX „1“ 0x02 0x0A The teaching process requires a valid measuring signal. The teaching process is terminated at „no target“, „target not evaluated“, „to close to the sensor“ - beyond SMR“ or „to far from the sensor - beyond EMR“. optoNCDT 1402 RS232 Page 63 Serial Interface RS232 8.4.24 Reset Scaling Values for the Analog Output, RESET_TEACH_VALUE Name:RESET_TEACH_VALUE Description: Resets the scaling values. Format: 31 24 23 „+“ „l“ 0x20 Reply: 31 16 15 „+“ „L“ 0xFA 24 23 „l“ 0xA0 0x20 8 7 „+“ „D“ 0x00 16 15 „L“ 0xFA 0x20 0 hex 0x2B2B2B0D 0x494C4431 0x20FA0002 0 hex 0x494C4431 0xA0FA0002 0x20200D0A 0x0d („CR“) „1“ 0x02 8 7 „D“ 0x00 0x0D „1“ 0x02 0x0A 8.4.25 Changing Data Protocol, SET_CIMODE_1401 Name:SET_CIMODE_1401 Description: Switches the sensor into the ILD1401 data protocol. The sensor replies with the ILD1402 data protocol, after sending the reply the sensor switches the data protocol. The following parameters can be changed in the ILD1401 data protocol: -- Digital or analog data output -- Behavior in case of an error -- Averaging The other parameters remain fixed: -- Baud rate: 38400 -- Measurement rate: 1000 Hz -- Type of digital output: binary -- Mode of analog/digital output: continuous -- Mode of save setting: save at each time -- Teach value 1: 0.00 resp. taught value T1 remains -- Teach value 2: 16368.00 resp. taught value T2 remains optoNCDT 1402 RS232 Page 64 Serial Interface RS232 Format: 31 24 23 „+“ „l“ 0x20 Reply: 31 16 15 „+“ „L“ 0xF2 24 23 „l“ 0xA0 0x20 8 7 „+“ „D“ 0x00 16 15 „L“ 0xF2 0x20 0 hex 0x2B2B2B0D 0x494C4431 0x20F20002 0 hex 0x494C4431 0xA0F20002 0x20200D0A 0 hex 0x2D2D2D52 0 hex 0x2D2D2D31 0x3443493X 0x0d („CR“) „1“ 0x02 8 7 „D“ 0x00 0x0D „1“ 0x02 0x0A 8.4.26 Request Data Protocol, GET_CI_MODE Name:GET_CI_MODE Description: Requests the state of the sensors command interpreter. Format: 31 24 23 „-“ Reply: 31 16 15 „-“ 24 23 „-“ „4“ 8 7 „-“ 16 15 „-“ „C“ „R“ 8 7 „-“ „I“ „1“ 0x3X Options for X: X = 1, the command interpreter of the sensor operates with the ILD1401 data protocol. Note: The sensor uses a different protocol! X = 2, the command interpreter of the sensor operates with the ILD1402 data protocol. optoNCDT 1402 RS232 Page 65 Instructions for Operating 9. Instructions for Operating 9.1 Reflection Factor of the Target Surface In principle the sensor evaluates the diffuse part of the reflected laser light, see Fig. 16. Laser beam Laser beam Laser beam 2 Ideal diffuse reflection Direct mirror reflecion Real reflecion Fig. 16 Reflection factor of the target surface A statement concerning a minimum reflectance is difficult to make, because even a small diffuse fraction can be evaluated from highly reflecting surfaces. This is done by determining the intensity of the diffuse reflection from the CCD array signal in real time and subsequent compensation for intensity fluctuations, see Chap. 3.2. Dark or shiny objects being measured, e.g. black rubber, may require longer exposure times. The exposure time is dependent on the measurement rate and can only be increased by reducing the sensor’s measurement rate. 9.2 Error Influences 9.2.1 Light from other Sources Thanks to their integrated optical interference filters the optoNCDT 1402 sensors offer outstanding performance in suppressing light from other sources. However, this does not preclude the possibility of interference from other light sources if the objects being measured are shiny and if lower measurement frequencies are selected. Should this be the case it is recommended that suitable shields be used to screen the other light sources. This applies in particular to measurement work performed in close proximity to welding equipment. Page 66 optoNCDT 1402 RS232 Instructions for Operating 9.2.2 Color Differences Because of intensity compensation, color difference of targets affect the measuring result only slightly. However, such color differences are often combined with different penetration depths of the laser light into the material. Different penetration depths then result in apparent changes of the measuring spot size. Therefore color differences in combination with changes of penetration depth may lead to measuring errors. 9.2.3 Temperature Influences When the sensor is commissioned a warm-up time of at least 20 minutes is required to achieve uniform temperature distribution in the sensor. If measurement is performed in the micron accuracy range, the effect of temperature fluctuations on the sensor holder must be considered. Due to the damping effect of the heat capacity of the sensor sudden temperature changes are only measured with delay. 9.2.4 Mechanical Vibrations If the sensor should be used for resolutions in the μm range, special care must be taken to ensure stable and vibration-free mounting of sensor and target. 9.2.5 Movement Blurs If the objects being measured are fast moving and the measurement rate is low it is possible that movement blurs may result. Always select a high measurement rate for high-speed operations, therefore, in order to prevent errors. 9.2.6 Surface Roughness In case of traversing measurements a surface roughness of 5 μm and more leads to an apparent distance change (also-called surface noise). However, they can be dampened by averaging, see Chap. 6.3. 9.2.7 Angle Influences Tilt angles of the target both around the X and the Y axes of less than 5 ° only have a disturbing effect with surfaces which are highly reflecting. Tilt angles between 5 ° and 15 ° lead to an apparent distance change of appr. 0.12 ... 0.2 % of the measuring range, see Fig. 17. Tilt angles between 15 ° and 30 ° lead to an apparent distance change of appr. 0.5 % of the measuring range. These influences must be considered especially when scanning structured surfaces. In principle the angle behavior in triangulation also depends on the reflectivity of the target. optoNCDT 1402 RS232 Page 67 Instructions for Operating teach in laser on state optoNCDT Angle X-axis % Y-axis % ±5 ° typ. 0.12 typ. 0.12 ±15 ° typ. 0.2 typ. 0.2 ±30 ° typ. 0.5 typ. 0.5 LASER RADIATION Do not stare into the beam CLASS 2 LASER PRODUCT IEC 60825-1: 2007 P≤1mW; =670 nm Y-axis X-axis tilting < triangulation angle Angle Angle Fig. 17 Measurement errors through tilting with diffuse reflection 9.3 Optimizing the Measuring Accuracy Color strips Direction of motion Grinding or rolling marks optoNCDT 1402 RS232 In case of rolled or polished metals that are moved past the sensor the sensor plane must be arranged in the direction of the rolling or grinding marks. The same arrangement must be used for color strips, see Fig. 18. Fig. 18 Sensor arrangement in case of ground or striped surfaces Page 68 Instructions for Operating teach in Correct laser on state optoNCDT LASERSTRAHLUNG NICHT IN DEN STRAHL BLICKEN LASER KLASSE 2 nach DIN EN 60825-1: 2008-05 P 1 mW; = 670 nm Incorrect (shadow) In case of bore holes, blind holes, and edges in the surface of moving targets the sensor must be arranged in such a way that the edges do not obscure the laser spot, see Fig. 19. Fig. 19 Sensor arrangement for holes and ridges 9.4 Cleaning the Protective Glasses A periodically cleaning of the protective housings is recommended. Dry cleaning This requires a suitable optical antistatic brush or blow off the panels with dehumidified, clean and oil free compressed air. Wet cleaning Use a clean, soft, lint-free cloth or lens cleaning paper and pure alcohol (isopropanol) for cleaning the protective housing. Do not use commercial glass cleaner or other cleansing agents. optoNCDT 1402 RS232 Page 69 Default Setting 10. -------------- optoNCDT 1402 RS232 Default Setting Data protocol ILD1402, Binary format Current output with error value (3.75 mA) Measuring rate : 1.5 kHz Interface: 115.2 kBaud, binary format (no ASCII) Moving average avg =1 (no averaging) Teach value 1: 0.0 Teach value 2: 16368.0 Continuous measurement output Output 1. measuring value after switching on: 500 ms Settings saved into FLASH Measuring range: 100 % FSO: I = 20 mA , digital 16207 0 % FSO: I = 4 mA, digital 161 Maximum output (101 % FSO): 20.16 mA / digital 16367 Minimum output (-1 % FSO): 3.84 mA / digital 0 Page 70 ILD1402 Tool 11. ILD1402 Tool The ILD1402 Tool is an application to configure the ILD1402 sensor. In addition it supports a 1 channel data acquisition through RS232. System requirements: -- Windows 2000/Windows XP/Windows Vista/Windows 7 -- Pentium III, 256 MB RAM Install the PC based program. Use the corresponding setup.exe supplied from the attached CD. Follow the advices during the installation. You will find the actual drivers respectively program routines under: www.micro-epsilon.com/link/opto/1402 This program part is evidence of acquisition, calculation and data storage of ILD1402. optoNCDT 1402 RS232 Page 71 Software Support with MEDAQLib 12. Software Support with MEDAQLib The Micro-Epsilon Data Acquisition Library offers you a high level interface library to access optoNCDT laser sensors from your Windows application in combination with PC1401-x/i/RS232 cable (optional accessory) into an existing or a customized PC software. You need no knowledge about the sensor protocol to communicate with the individual sensors. The individual commands and parameters for the sensor to be addressed will be set with abstract functions. MEDAQLib translates the abstract functions in comprehensible instructions for the sensor. MEDAQLib -- is a DLL/LIB usable for C, C++, VB, Delphi and many other Windows programming languages, -- supports functions to talk to the sensor -- hides the details on how to talk to the communication interface (RS232,RS422,USB,TCP) -- hides the details of the sensor protocol -- converts the incoming data to „expected data values“ -- provides a consistent programming interface for all Micro-Epsilon sensors -- provides many programming examples many different programming languages -- the interface is documented in a large *.pdf file You will find the latest MEDAQLib version at: www.micro-epsilon.com/link/software/medaqlib optoNCDT 1402 RS232 Page 72 Warranty 13. Warranty All components of the device have been checked and tested for perfect function in the factory. In the unlikely event that errors should occur despite our thorough quality control, this should be reported immediately to MICRO-EPSILON. The warranty period lasts 12 months following the day of shipment. Defective parts, except wear parts, will be repaired or replaced free of charge within this period if you return the device free of cost to MICRO-EPSILON. This warranty does not apply to damage resulting from abuse of the equipment and devices, from forceful handling or installation of the devices or from repair or modifications performed by third parties. No other claims, except as warranted, are accepted. The terms of the purchasing contract apply in full. MICRO-EPSILON will specifically not be responsible for eventual consequential damages. MICRO-EPSILON always strives to supply the customers with the finest and most advanced equipment. Development and refinement is therefore performed continuously and the right to design changes without prior notice is accordingly reserved. For translations in other languages, the data and statements in the German language operation manual are to be taken as authoritative. 14. Service, Repair In the event of a defect on the sensor or sensor cable: -- If possible, save the current sensor settings in a parameter set, see ILD1402 Tool, menu ?, Help, in order to load the settings back again into the sensor after the repair. -- Please send us the effected parts for repair or exchange. The opening of the sensor is only subjected to the manufacturer. In the case of faults the cause of which is not clearly identifiable, the whole measuring system must be sent back to optoNCDT 1402 RS232 MICRO-EPSILON MESSTECHNIK GmbH & Co. KG Königbacher Straße 15 94496 Ortenburg / Germany Tel. +49 (0) 8542 / 168-0 Fax +49 (0) 8542 / 168-90 e-mail [email protected] www.micro-epsilon.com Page 73 Decommissioning, Disposal 15. Decommissioning, Disposal Disconnect the power supply and output cable on the sensor. Incorrect disposal may cause harm to the environment. Dispose of the device, its components and accessories, as well as the packaging materials in compliance with the applicable country-specific waste treatment and disposal regulations of the region of use. optoNCDT 1402 RS232 Page 74 Free Space for Optics 16. Free Space for Optics 4 57 (2.24) (.16) Dimensions in mm (inches), not to scale 10 (0.40) 20 (0.79) 20 (0.79) 30 20 (0.79) (1.18) 50 (2.00) 45 (1.77) 100 (3.94) 50 200 (7.87) (2.00) 60 (2.36) 100 a j e A B 33.5 ° 35.5 ° 37.1 ° 18.9 (0.74) 13.2 (0.52) 19.1 13.2 (0.75) (0.52) 33.5 ° 32.9 ° 32.4 ° 24.2 18.2 (0.95) (0.72) 28.9 (1.14) 21.1 (0.83) 30.1 21.3 (1.19) (0.84) 6.8 ° 30.8 (1.21) 22.0 7.6 ° 5.5 ° 33.9 (1.33) (1.03) 31.2 ° 27.9 ° 25.8 ° 25.1 ° 19.6 ° 16.9 ° 23.1 ° 14.4 ° 11.3 ° 20.1 ° 9.4 ° 14.7 ° 16 (.63) B ø4 ø6 (.16 dia) (.24 dia) 10 (.39) (0.87) 26.2 250VT (9.84) (3.94) 400 (15.7) 200 (7.87) 9.7 ° 5.3 ° 3.8 ° 41.4 (1.63) 33.7 (1.33) 600 (23.6) 200 (7.87) 9.7 ° 4.3 ° 2.9 ° 41.6 (1.64) 33.7 (1.33) optoNCDT 1402 RS232 A SMR 5 (0.20) SMR MR MR MR = Measuring range SMR = Start of measuring range Page 75 Available Cables 17. Available Cables Type PC1401- 3/I, PC1401-6/I, 3m 6m Interface and supply cable for current output, one end of the cable has a molded M9 female connector, the other end has free leads with ferrules. PC 1401/90-3/I PC 1401/90-6/I PC 1401/90-10/I 3m 6m 10 m like PC1401-x/I, with angled version of the connector PC1401-3/U, PC1401-6/U, PC1401-10/U 3m 6m 10 m Interface und supply cable for voltage output (250 Ohm load, U out = 1 … 5 V), one end of the cable has a molded M9 female connector, the other end has free leads with ferrules. PC 1401/90-3/U PC 1401/90-6/U PC 1401/90-10/U 3m 6m 10 m like PC1401-x/U, with angled version of the connector PC 1401-3/I/RS232 3m Supply and output cable for serial connection RS232 PS2020 optoNCDT 1402 RS232 Cable length Characteristics Power supply, mounting on DIN-rail, input 120/230 VAC, output 24 VDC/2.5 A, H/W/D 124 x 32 x 102 mm Page 76 Input /Output Circuit 18. Input /Output Circuit 7 11... 30 VDC ILD1402 RS232 3 RX232 4 TX232 6 5 Iout C1 100 nF Uout R1 6 +24 V 2 1 Laser on/off 6 10 k Error output R = 250 W: UOUT 1 ... 5 V with UB > 11 V R = 500 W: UOUT 2 ... 10 V with UB > 17 V 1) Components contained in PC 1401-x/U; are required for voltage output. optoNCDT 1402 RS232 Page 77 MICRO-EPSILON MESSTECHNIK GmbH & Co. KG Königbacher Str. 15 · 94496 Ortenburg / Germany Tel. +49 (0) 8542 / 168-0 · Fax +49 (0) 8542 / 168-90 [email protected] · www.micro-epsilon.com X9751202.23-A041026GBR MICRO-EPSILON MESSTECHNIK *X9751202.23-A04*
* Your assessment is very important for improving the work of artificial intelligence, which forms the content of this project
advertisement