EasyManua.ls Logo

Topcon OPUS A6G2 - Page 563

Topcon OPUS A6G2
800 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
563
OPUS Projektor Manual
JavaScript
var myBaudrate = myRS232.getBaudrate();
The method returns 0 if the port is not initialized yet.
Note that this method can't actually read the current baud rate. It returns the saved value of the
last baud rate that has been set successfully with the .init method.
RS232Handler.getPort - read the name of the RS232 interface currently used
This method returns a string containing the path and device file currently opened by this
instance.
This mainly exists for debugging.
Prototype:
var port = myRS232.getPort();
Example:
// Retrieve the filepath and device name of the RS232 port
var myPort = myRS232.getPort();
print("RS 232 port used : '" + myPort + "'.");
RS232Handler.writeFromBuffer - write a string or an array of numbers to the serial
port
This method writes a string or number array to the serial port.
This only works if the RS232Handler instance has been created and initialized before.
It accepts a character string as well as an array of numbers as buffer to be sent via serial
interface.
Strings will be converted to UTF-8 format used everywhere in PClient if
'RS232Handler.encoding' is not modified.
As a second parameter, one can provide the number of bytes to send from the buffer i.e. this
allows to use a buffer which could contain more than one wants to send currently.
If an array of numbers is provided, the size is limited to the size of the array - even if a greater
number is provided in 'bytesToSend'.
If a string is provided, the size is considered to be characters. Depending on the desired
encoding the number of bytes sent can differ.
If the buffer is provided as string, the 'encoding' property of 'RS232Handler' is used to convert
the string before sending (see examples).
Prototype:
var errorCode = RS232Handler.writeFromBuffer(<String or number
array>, optional number charactersToSend);
Examples:
// Since UTF-8 is used for character encoding in PClient the
special characters are sent as two or more bytes by default
// which in the following example can result in unprintable
characters.
// Special characters in this example are sent as two bytes
each (for default UTF-8).

Table of Contents