![Euresys Coaxlink Series Скачать руководство пользователя страница 40](http://html1.mh-extra.com/html/euresys/coaxlink-series/coaxlink-series_programmers-manual_2436137040.webp)
40
// attributes(f)
console.log('- attributes(\'LineFormat\')');
var attrs = port.attributes('LineFormat');
for (var n in attrs) {
console.log('
- ' + n + ': ' + attrs[n]);
}
// attributes(f)
var fmt = port.get('LineFormat');
console.log('- attributes(\'LineFormat\', \'' + fmt + '\')');
var attrs = port.attributes('LineFormat', fmt);
for (var n in attrs) {
console.log('
- ' + n + ': ' + attrs[n]);
}
// optional suffixes to integer or float feature names
if (port.available('DividerToolSelector') &&
port.available('DividerToolSelector', 'DIV1')) {
var feature = 'DividerToolDivisionFactor[DIV1]';
var suffixes = ['.Min', '.Max', '.Inc', '.Value'];
console.log('- Accessing ' + su ' of ' + feature);
for (var suffix of suffixes) {
console.log( '
- ' + ': ' + port.get(f suffix));
}
}
}
// Camera ports (RemotePort) also have the following functions:
//
brRead(addr)
| read bootstrap register (32-bit big endian)
//
brWrite(addr,v) | write value to bootstrap register (32-bit big endian)
if (grabbers.length) {
var port = grabbers[0].RemotePort;
if (port) {
console.log('Playing with', port.tag);
var brStandard = 0x00000000;
var brRevision = 0x00000004;
var standard = port.brRead(brStandard);
var revision = port.brRead(brRevision);
if (0xc0a79ae5 === standard) {
console.log('Bootstrap register "Standard" is OK (0xc0a79ae5)');
} else {
console.log('Bootstrap register "Standard" is ' + standard);
}
console.log('Bootstrap register "Revision" is ' + revision);
}
}
6.4. doc/module1.js
// This file describes the special 'module' variable of Euresys GenApi Script.
// It can be executed by running 'gentl script coaxlink://doc/module1.js'. It
// is also dynamically loaded by the coaxlink://doc/builtins.js script.
// 'module' is a special per-module variable. It cannot be declared with var.
// It always exists, and contains a few items:
console.log('Started execution of "' + module.fi '"');
console.log('This script is located in directory "' + module. '"');
// Modules can export values via module.exports (which is initialized as an
// empty object):
module.exports = { description: 'Example of Euresys GenApi Script module'
, plus2: function(x) {
Coaxlink
Programmer Guide
6. Euresys GenApi scripts