Using the JavaScript Environment

Using the JavaScript Environment

JavaScript formatting enables post-processing inspection results, changing job status or FTP path, and sending manipulated results to different communication channels (HID, Serial, CDC, TCP). It also allows you to handle external events such as incoming TCP or serial port data or GPIO port state changes.
Aurora Focus provides an execution environment based on the ECMAScript 2024 standard. For additional information, go to tc39.es/ecma262/2024/. Minor environmental restrictions are present.
Using the JavaScript features available in Aurora Focus is similar to those found in web browsers, such as Chrome or Edge, and standalone JavaScript environments. In most cases, it is possible to rely on online tutorials and the help of AI assistants without any specific code customization.
The JavaScript runtime in Aurora Focus provides the following features:
  • Just-in-Time Compilation - the script is optimized during execution, generating efficient machine code after several iterations, as if written in C or C++.
  • Dedicated Scripting Environment - separation of the scripting environment from the vision runtime environment ensures that problems with the scripting environment do not cause significant problems with job execution. This ensures that scripting problems do not break the acquisition environment.