560
OPUS Projektor Manual
JavaScript
Return value:
·
true if the operation was successful
·
false if the operation was not successful (shouldn't really occur)
·
undefined if the variable wasn't found
Note that the function works both for variables belonging to the PClient as well as external
variables, so use with care.
RS232 JavaScript Functions
7.4.1
RS232 JavaScript Functions
Support for the RS 232 interface is provided by a JavaScript interface - there are no
dedicated variables involved.
The approach requires instantiating an 'RS232Handler' object which represents one RS 232
interface.
Currently this uses the one port provided on the device.
If more than one port should exist in the future, then one instance per port would have to be
created.
Once the object is created, all function calls have to be done for this object.
Note that this interface was designed mainly for serial printers - that's why the 'read'
functionality is rather limited for now.
RS232Handler - constructor to get an RS232 instance
The constructor has no parameters - it creates an instance but does not open any interface.
If this handler should be used as long as the PClient is running, it should be created e.g. in a
project init script and assigned to a global variable.
Prototype:
var myRS232 = new RS232Handler();
Example:
// Generate a global RS232 handler
myRS232_handler = new RS232Handler();
RS232Handler.init - open interface and set baud rate
This method opens the RS232 interface with an optionally specified baud rate and a wait time
for the RS232 read function.
If called without parameters or with unsupported values, the RS 232 interface is initialized with
115200 bit/s and 100 ms wait time.
it is always initialized to use:
8 data bits
No parity
1 stop bit
these settings can NOT be changed at the moment.
560