Skip to Main Content

Sales:

texto

Customize Dataman Barcode Readers with Scripting 

​​Cognex DataMan barcode readers can use JavaScript to customize several important functions, such as data formatting and transferring images to an FTP site. Watch an overview of scripting operations using the DataMan Setup Tool software.​

​​Key Takeaways​ 

DataMan scripting has tons of benefits, including:

  • ​​Custom functions: Scripting enables data formatting, FTP image storage, and communication with external devices.
  • ​Setup tool: Easily initiate and manage scripts using the DataMan Setup Tool.
  • DMCC commands: Control barcode readers with commands like GET, SET, and Reboot.
  • Integration: Simplifies PLC integration and optimizes factory network operations.
  • Sequence steps: Includes image acquisition, processing, validation, scripting, and output for efficient workflows.​ 

Why DataMan Readers Use Javascript

Scripting helps to simplify the integration of programmable logic controllers (PLCs) and DataMan barcode readers into a factory network. Scripts also manage the inputs and outputs of digital data and enable:

  • Data formatting for:
    • Output strings and string comparison
    • Statistics and metrics
    • Input and output states
    • Set or Get parameters  
  • FTP storage (image renaming and transfer of images and data)
  • Communications with external devices, setting a timer and managing encoder input

How to Enable DataMan Scripting

The Setup Tool is used to initiate scripting. There are several steps in this process:

  • Connecting to the DataMan barcode reader
  • Clicking on the Format Data square at the bottom left of the screen
  • Selecting “script-based formatting” and clicking a link to execute the command

Scripting Samples for Data Formatting, FTP Storage and Communications

Three primary DataMan scripts perform basic functions like data formatting, FTP storage and communication:

  1. Data formatting. Examples include comment text, the “onResult” function, “if” conditions, “output.content” and output strings.
  2. FTP storage. Examples include generating image names before FTP transfer, process control metrics (PCM) reports and verification reports.  
  3. Communications. Examples include “onConnect” and “onDisconnect,” “onExpectedData,” (called after receiving a data string from an external device) and “onTimer,” (called after the timer counts to zero).

Sequence

The DataMan image processing sequence involves five steps:

  1. Image acquisition
  2. Processing
  3. Validation
  4. Scripting
  5. Output

Each step is reviewed in detail in the video.

DataMan Control Commands (DMCC)

DMCC is a Cognex protocol for communicating with DataMan barcode readers. Sample commands include:

  • ||> GET TRIGGER.TYPE — returns the value of a parameter setting
  • ||> GET RESULT — returns the last result of a decoded string
  • ||> SET SYMBOL.DATAMATRIX ON — Sets the value of a parameter
  • ||> Reboot — Makes the barcode reader perform an action

All DMCCs are available in the DataMan Setup Tool and accessible by clicking on “Help” in the top right corner of the screen.

DataMan product family with background

DataMan Setup Tool Software

Download
Last Modified on06/16/2025

Related Resources