DataMan
®
Communications
and Programming Guide
2020 August 13Revision: 6.1.9.1
Страница 1: ...DataMan Communications and Programming Guide 2020August13 Revision 6 1 9 1...
Страница 2: ...y means electronic or mechanical for any purpose nor transferred to any other media or language without the written permission of Cognex Corporation Copyright 2020 Cognex Corporation All Rights Reserv...
Страница 3: ...k 6 Connecting Your DataMan Intelligent Base Station to the Network 10 Direct Connection to Your Computer 11 Connecting Your Reader Across Subnets 16 Troubleshooting a Network Connection 17 DataMan Ap...
Страница 4: ...a hazard that could cause death serious personal injury or electrical shock CAUTION This symbol indicates a hazard that could result in property damage Note This symbol indicates additional informatio...
Страница 5: ...ol Commands DMCC API The DataMan reader connected to a network can be triggered to acquire images by several methods l using the DataMan Setup Tool l trigger bits l through a DMCC command l manipulati...
Страница 6: ...ends the following connection sequence in case of using a PoE injector 1 Connect the PoE injector to the Ethernet network both ends of the patch cable 2 Connect the power cord AC 230V 110V to the PoE...
Страница 7: ...ataMan reader via the wireless network as well For this you need to use the Wi Fi slide in with the device Ad hoc Connection The default factory settings for the wireless configuration of the device a...
Страница 8: ...ss connection a Authentication only Open Mode can be selected b Encryption method WEP 40 and WEP 104 You can enter a passphrase for these methods Infrastructure Mode You can set Wireless Infrastructur...
Страница 9: ...d to encrypt the communication between the Wi Fi Access Point and the reader The following certificates are required l Client s certificate This must be different for each reader It may be publicly ac...
Страница 10: ...unencrypted private key and certificate files are allowed l The Client s private key and certificate must contain exactly one section the CA s certificate can contain one or more certificates l Make...
Страница 11: ...or power supply at the same time 2 Connect your base station to your PC with an Ethernet cable 3 The base station becomes visible as connected through Ethernet and it routes data through the wireless...
Страница 12: ...use and the settings will be copied in the Use Static IP Address window Note Remember to update the IP address of your DataMan device The IP address that is copied belongs to your PC A triangle with a...
Страница 13: ...an Setup Tool s Connect page This will force the DataMan Setup Tool to scan for DataMan devices connected to the PC or connected to the same network Configuring the PC to Reside on the Same Subnet as...
Страница 14: ...settings can be changed Perform the following steps to configure your PC examples here are of Windows XP 1 In the Start Menu start typing Control Panel and open it 2 Click Network and Internet 3 Clic...
Страница 15: ...et Properties window that pops up select Internet Protocol Version 4 TCP IPv4 and click Properties 6 Under the General tab select the Use the following IP address option and enter an IP address and Su...
Страница 16: ...button on the DataMan Setup Tool s Connect page The DataMan Setup Tool scans for DataMan devices connected to the PC or connected to the same network Connecting Your Reader Across Subnets The followi...
Страница 17: ...network configuration the DataMan Setup Tool may not be able to communicate with the reader and it will not appear in the list of Network devices If you know the IP address of the reader use the Add...
Страница 18: ...Tool to assign a different port number as necessary Note Use a third party client such as PuTTY to make changes to the Telnet client provided by Windows to communicate with the DataMan Command Syntax...
Страница 19: ...ll be sent from the reader Invalid commands are ignored without feedback Command responses are sent in space delimited ASCII text without a header or footer Extended 1 The reader responds with a heade...
Страница 20: ...ach file corresponds to the platform it belongs to PC CF There are two components for each platform one is the DataMan SDK core itself Cognex DataMan SDK the other is for discovering available devices...
Страница 21: ...ill appear in the intellisense From this point on you can choose to discover devices either via Ethernet or via serial communication RS232 USB or you can choose to do both 4 Discovering devices via Et...
Страница 22: ...es Here is an example where you subscribe for the events of read string and image arrival mySystem XmlResultArrived new XmlResultArrivedHandler OnXmlResultArrived mySystem ImageArrived new ImageArrive...
Страница 23: ...for SendCommand which is the command string itself There are also two optional parameters one for overriding the default timeout for the command and another for passing additional bytes with the comm...
Страница 24: ...ult components If a result is complete a ComplexResultArrived event is fired If a result is not complete but it times out time out value can be set via the ResultTimeOut property or the ResultCollecto...
Страница 25: ...CC commands in scripting it is now possible to evaluate a DMCC command line as full command string It is not required to split the DMCC command into the type correct command arguments Note l The data...
Страница 26: ...string argument is required var res dmccGet DEVICE NAME The dmccSend function can be used in a similar way but without splitting the command and type correct arguments var res dmccSend GET DEVICE NAM...
Страница 27: ...e currently supported keys key combinations l ALT A to ALT Z l CTRL A to CTRL Z l CTRL F1 to CTRL F12 l SHIFT F1 to SHIFT F12 l F1 to F12 l ALT F1 to ALT F12 l PageUp PageDown Home End Arrow up down l...
Страница 28: ...a string argument into base64 encoding The encoded result is returned as a string object Parameter Type Description inputString string Input string to encode into base64 Error Management Scripting err...
Страница 29: ...aderProperties ReaderProperties Input the reader properties not tied to the actual decode result output Output Output the object which needs to be updated to modify the output string or raise events T...
Страница 30: ...ing in 0 100 For symbologies that use Reed Solomon error correction e g DataMatrix QR Code AztecCode MaxiCode DotCode PDF417 certain 4 state postal codes it reports the UEC unused error correction For...
Страница 31: ...exposure is used illEnabled boolean True if internal illumination is enabled illIntensity integer The internal illumination intensity extillEnabled boolean True if external illumination is enabled ex...
Страница 32: ...ta check string A Pass Fail assessment determined by the specific application standard selected TruCheckCodeword Property Type Description codeword integer Outputs the codewords associated with the pa...
Страница 33: ...to the selected application standard applicationStdNotation string The notes associated with the application standard data parsing asciiArray array of integers The ASCII values for the symbol average...
Страница 34: ...ttern in QR code minimumReflectance TruCheckMetric The minimum reflectance minRefl value Modulation TruCheckMetricGradeOnly The modulation MOD value modulationArray TruCheckMetricGradeOnly The array o...
Страница 35: ...ion table below dod_uid DoD Validation The details of the DoD Validation property type are listed in the DoD Validation table below GS1Validation GS1 validation details Property Type Description AI00...
Страница 36: ...ure trade item Single monetary area AI393n string Amount payable for a variable measure trade item and ISO currency code AI394n string Percentage discount of a coupon AI400 string Customer s purchase...
Страница 37: ...004 string Global Individual Asset Identifier GIAI AI8005 string Price per unit of measure AI8006 string Identification of the components of a trade item AI8007 string International Bank Account Numbe...
Страница 38: ...the quality of all measured parameters Property Type 1D Standards 2D Standards Description singleScanInt Metric 1D Readability The single scan integrity raw member is set to 1 Single scan integrity i...
Страница 39: ...ndicate poor lighting a code which is difficult to read due to similarities between the print and the background or that a printer is performing poorly cellContrast Metric AIM DPM ISO IEC TR 29158 Dat...
Страница 40: ...uniformity is a measure of the difference in spacing of grid cells along each axis In the best case this value will be zero indicating that centers of the grid cells are evenly spaced in all directio...
Страница 41: ...ow growth As a result a print growth close to zero is desirable A high or low print growth usually indicates problems with the printing process for a code For instance a dot peen marker may be wearing...
Страница 42: ...ead due to similarities between the print and the background or that a printer is performing poorly fixedPatternDamage Metric ISO IEC 15415 DataMatrix QR AIM DPM ISO IEC TR 29158 DataMatrix QR The fix...
Страница 43: ...ected positions Poor grid non uniformity usually indicates a printing process which is not consistent in its placement of the cells extremeReflectance Metric ISO IEC 15415 DataMatrix QR The extreme re...
Страница 44: ...hotspot too much light or that a too high exposure time is being used Print quality troubles like a printer depositing less ink than intended may also be indicated by the minimum reflectance grade edg...
Страница 45: ...or dark grayscale levels in the symbol ie noise horizontalMarkGrowth Metric SEMI T10 DataMatrix Horizontal Mark Growth is the tracking of the tendency to over or under mark the symbol that is a horizo...
Страница 46: ...Pattern Defects is the ratio of incorrect pixels to total pixels in the finder pattern overallGrade Metric ISO IEC 15416 ISO IEC 15415 DataMatrix QR AIM DPM ISO IEC TR 29158 DataMatrix QR SEMI T10 Ov...
Страница 47: ...ity Metric ISO IEC 15416 ISO IEC 15415 DataMatrix QR Contrast Uniformity is an optional parameter that is used for measuring localized contrast variations It does not affect the overall grade reflecta...
Страница 48: ...MCC Trigger Describes the details of the initiating trigger event Property Type Description type integer These are the available trigger types l single l presentation l manual l burst l self l continu...
Страница 49: ...ype string The name of the output property is the same as the target protocol name If no target specific output is assigned the result falls back to the default result taken from the output content pr...
Страница 50: ...Result decodeResults readerProperties output if decodeResults 0 decoded save decoded result to variable var mymsg decodeResults 0 content output to telnet channel a different result output Telnet teln...
Страница 51: ...that is being written Pop up messages usually appear when typing special characters for example period opening or closing brackets and so on These messages can also be used manually with the Ctrl Spac...
Страница 52: ...nippet Ctrl k and then press x Snippets The editor provides a selection of preset code fragments as examples You can insert these snippets by right clicking in the editor using the toolbar or using th...
Страница 53: ...de to send messages back to the other system something that is not supported in basic scripting Advantage The script engine uses the same context for function execution and object creation This allows...
Страница 54: ...se keep the value in buffer o onTimer The timer value expired o onUnexpectedData The recieved data is not matching the requirements The boolean return value determines if the data should be removed fr...
Страница 55: ...r If encoder ticks should be used instead of distance set the value of the parameter Resolution mm to 1 n distance double The encoder distance in which the onEncoder method will be called The methods...
Страница 56: ...dmccCommand TRIGGER true this setTimer 1 0 function replace_crlf input_str return input_str replace r g r replace n g n return onConnect function peerName my_name peerName we may ignore the connection...
Страница 57: ...String time today new Date msg today getSeconds 1000 today getMilliseconds else msg unknown command replace_crlf inputString num_send this send my_name msg r n return inputString length onUnexpectedDa...
Страница 58: ...ction CommHandler var beat_timer 10 0 beat timer in sec var peer_name return onConnect function peerName peer_name peerName this resetHeartBeat initial timer this expectFramed 0 0 128 some pattern unl...
Страница 59: ...tarting Jan 1 1970 as output by date s command Prepend output with real time timestamp communication script var time_offset 0 function CommHandler var peer_name return onConnect function peerName peer...
Страница 60: ...col_etx x03 termination VT Parameter to be converted into script configuration constant values Communication Interfaces COM1 Protocol var vt_param_comif_com1_protocol 1 Communication Protocols CMF400...
Страница 61: ...Timer _onSync function _onSync if cmf400_status CMF400_PROTOCOL_STATUS SYNCRONIZING this send cmf400_protocol_stx cmf400_gateway_init cmf400_protocol_etx this setTimer 1 0 onTimer _onSync function _on...
Страница 62: ..._ profibus_node_number 3 msg M zero_prefix vt_param_ profibus_mode 3 msg cmf400_protocol_etx this send msg this onTimer _configTimedOut this setTimer 10 0 if data cmf400_gateway_error cmf400_status CM...
Страница 63: ...ion CommHandler private properties and methods var num_trigger 0 var my_name var num_send 99 function privFunc public properties and methods return onConnect function peerName my_name peerName num_sen...
Страница 64: ...1 dmccSet SYMBOL POSTNET 1 function CommHandler var tray 0000 var speed 0 var package_id_expr new RegExp I 0 9 9 var package_idtray_expr new RegExp I 0 9 9 T 0 9 4 var config_msg_expr new RegExp CS 0...
Страница 65: ...decodeResults onDisconnect function bConnected false onExpectedData function input var input input replace n g switch input charAt 0 toUpperCase case B dmccCommand TRIGGER true break case E dmccComman...
Страница 66: ...se not used break return true onUnexpectedData function input return true The data formatting formats the result based on global variables set by the communication handler var packageID 000000000 rese...
Страница 67: ...if decodeResults i decoded continue switch decodeResults i symbology name case Interleaved 2 of 5 b throw away 6 digit I2of5 ending in 9 if mode b decodeResults i content length 6 decodeResults i con...
Страница 68: ...e_base64 my_decode_results i content break case POSTNET case PLANET case XYZ OneCode case Interleaved 2 of 5 default msg my_decode_results i content packageID 000000000 reset the package id output Tel...
Страница 69: ...nputString r n return true onUnexpectedData function inputString return true onTimer function inputString Data formatting delegates output to communication handler objects var comm_handler new Array 0...
Страница 70: ...name Wait For Content CHECKSUM value 1 name Header Received var errorCodes undef_index 0x31 multi_index 0x32 index_in_use 0x33 telegram_error 0x34 trigger_overrun 0x40 buffer_overflow 0x41 var filler...
Страница 71: ...ksum data this sendTelegram type system_id content data index null invalidate the used index sendErrorTelegram function errcode var errtel type F content system_id String fromCharCode errcode this sen...
Страница 72: ...med x02 x03 203 this setTimer heartbeat_time_s index null comm_handler push this all_index new Array return true onDisconnect function var index comm_handler indexOf this comm_handler splice index 1 o...
Страница 73: ...nt Available events identifier are defined in a constant object named Callback Optional arguments can be used to configure the event e g to filter the sensitivity A handle is returned that must be use...
Страница 74: ...0 signal and the switch button l onInput1 reacting on input1 signal l onTrigger reacting on trigger events function CommHandler return onConnect function peerName this peer peerName this input1 regist...
Страница 75: ...COM1 inputs 0 call onTrigger start trigger with index 10 NO READ call onTrigger end trigger with index 10 call onInput0 for COM1 inputs 4096 call onTrigger start trigger with index 11 call onInput0 fo...
Страница 76: ...Copyright 2020 Cognex Corporation All Rights Reserved...