Skip to Main Content
Cognex Support Hub
Logo

How to Use Oled Display in a DataMan 8700 via Scripting

This article will explain how to use the OLED display of a DataMan 8700 reader via scripting.

02/17/2026

Details

In this article we will see how to use DMCC commands inside a script to show the desired data on a DataMan 8700 OLED display.

Here is the script:

 

// Script to use DM8700 OLED
function onResult (decodeResults, readerProperties, output)
{    
   dmccSet("OLED.READ-ALERT-TIMEOUT",5);
   dmccSet("OLED.ENABLE-RESULT-SCROLLING",0);
   "UI.SEND-ALERT", 5, 2, "ERROR";
   
   if (decodeResults[0].decoded)
       
   {

 var A = decodeResults[0].content.substr(0,6)
       var B = decodeResults[0].content;
        
       output.content = A + "/r/n" + B;
   }    
}

In this script we can see the 3 main commands for the OLED display:

dmccSet("OLED.READ-ALERT-TIMEOUT",5);

This command defines how long the OLED displays the read result.Value can be 0, so infinite, or a vaule from 1 to 10000 (in seconds);


dmccSet("OLED.ENABLE-RESULT-SCROLLING",0);
 

This command enables or disables automatic scrolling of the result text on the reader screen. If you disable the command, the reader does not scroll the text, even if the text does not fit into the screen.

"UI.SEND-ALERT", 5, 2, "ERROR";

This command allows you to display a custom message on the OLED display, according to various parameter:

First value is timeout, so the time for the message to be visible on the OLED display, in seconds.

Second number is the alert type, according to this list:

0: ok, message in a green box
1: warning, message in a yellow box
2: error, message in a red box
3: info, message in a blue box

third parameter is the message to be show.

Related Resources