LOCAL AREA NETWORK

These drivers allows computer nodes running RTES and WinRTES to communicate peer to peer on an network (LAN, Intranet, Internet).
Use RNET over NETBIOS or NETBEUI
Use UNET over IP/UDP using QNET or XNET on the RTES side, Windows Network on the WinRTES side.

Any RTES may request from any other RTES on the network the current values or status of groups of registers.
In addition, RNET/UNET also allows RTES to respond to GUI commands (used by WinRTES)

RTES-RTES peer to peer communication.
Transmission of data between RTES nodes is done by blocks or clusters. A block defines a series of registers. The clusters are defined in the PORTn.CNF file of the requesting RTES. Any RTES on the network may request data from another RTES.

"I" clusters request binary data. An even number is transmitted as a 0 and an odd number as a 1. When used as binary data, only the integer part of a number is considered. Negative numbers are changed to 0.

"G" clusters request floating point numbers.

Cluster are defined by 6 parameters:

FIRST, QTY, NODE, POS, ALERT, ENABLE

FIRST

the index of the first register of the block at the requesting RTES.

QTY

the number of registers to transfer, starting at and including the first register. The maximum number of register values that may be transferred is 16 per block.

NODE

the node id of the RNET in the computer that the values will be coming from (source).

POS

the index of the first RTES variable at the source computer.

ALERT

the index of the register to be set in case a communication error or time-out occurs when this particular block is transferred

ENABLE

the index of the register that will control transmission, or 0 if transmission is continuous (host side only). See "C" parameter in Definitions

RTES variables :
The parameter used in FIRST and POS is coded as follows to indicate which type of variable is used:

0-9999         R registers
10000-19999    I registers
20000-29999    O registers
30000-39999    A registers (converted value)
40000-49999    Y registers (converted value)
50000-59999    A registers (raw value)
60000-69999    Y registers (raw value)

You may define up to 255 blocks of each type.

Other parameters in PORTn.CNF

Parameter

Key letter

Description

Default value

Adapter number

A

A value of 0 associates this driver with XNET. A value of 1 associates this driver with the second copy of XNET (loaded as XNET 1).

A=0

Station ID

N

Assigns a unique station ID from 1 to 255, on the network.
In NetBIOS (RNET), this number is used to compose a unique NetBIOS name for this station. The number is converted to 2-digit hex notation and appended to "BIOSNET_", so that N=1 produces BIOSNET_01.
In UDP (RNET), this number references the IP of this station in the configuration files of the other UNET members on the network.

N=1

Station list

S

The value of S indicates how many stations are on the UDP network. Each station is then defined by a set of 4 numbers : the 1st number is the ID of the station and the other 4 numbers are the IP address where the station is located.

S=0

Example

Example configuration file.
The driver will use port1 : the parameters will be in PORT1.CNF
N=5       ;node id
T=1000    ;time out constant
G=3       ;will receive 3 groups of register values.
16,16,10,16,1,0     ;R0017 to R0031 will receive the values of
                    ;R0017 to R0031 from node 10. R0002 will
		    ;annunciate time outs. Communication will be
		    ;continuous.
32,16,12,16,2,0     ;R0033 to R0048 will receive the values of
		    ;R0017 to R0031 from node 12. R0003 will
		    ;annunciate time outs. Communication will be
		    ;continuous.
48,16,14,16,3,0     ;R0049 to R0064 will receive the values of
		    ;R0017 to R0031 from node 14. R0004 will
		    ;annunciate time outs. Communication will be
		    ;continuous.
I=1       ;will receive 1 group of register status (0 or 1)
256,8,20,0,4,0      ;R0257 to R0272 will receive the status of
		    ;R0001 to R0016 from node 20. R0005 will
		    ;annunciate time outs. Communication will be
                    ;continuous.
S=4       ;this unit will get data from 4 nodes (UNET)
10 192,100,100,10
12 192,100,100,12
14 192,100,100,14
20 192,100,100,20

GUI Commands
RNET/UNET allows to interface RTES with WinRTES or other user program. The messages imbedded in the NetBIOS/UDP frames have the following format:

[FROM][TO][LEN][SEQ][CMD][----- data -----]

[FROM]one byte node address of the originator of the message
[TO]one byte node address of the destination . Node address 0 (null) is reserved for broadcast messages
[LEN]one byte message length to follow. This is the byte count of the whole message -3, or the byte count of all the bytes after [LEN}
[SEQ]one byte message sequence, echoed in the response for error checking
[CMD]one byte command letter or function code
data the body of the message as detailed for each function code.
Note that word-long arguments/values are coded least significant byte first and 2-word-long values are coded least significant word first.

RTES responds to a GUI command using the same format. The CMD byte is either
A (hex 41) when the received message has been correctly executed. This is followed by the data as applicable
N (hex ) when the received message could not be executed. This is followed by a 1 byte error code

The defined error codes are:

01 Unknown command
02 Point not found
03 Syntax error
04 SYSTEM ERROR
05 Already exists
06 Constant too large
07 Mismatched brackets
08 Table full
09 No rule defined
0A Too many arguments
0B Too many delay operators
0C No display
0D Invalid point name
0E Page not found
0F Argument missing
10 Display write protected
11 Printer queue full
12 Cannot fit in the page
13 Point under other control
14 Item not found
15 Format error
16 Function disabled while printing
17 Line number not valid
18 Active task
19 Delay op. not allowed
1A Binary or no variable selected
1B Expression too long
23 Not authorized
25 DOS failed. Check hardware

Messages using broadcast must have a null destination and are received by all RTES nodes on the network. Any commands contained in a broadcast message are executed but are not answered nor acknowledged by RTES.

List of Function Codes

CODE LETTERNAMEDATA FIELDRESPONSE
CGet date and time
None[month] 1 byte
[day] 1 byte
[year] 2 bytes
[hour] 1 byte
[minute] 1 byte
[second] 1 byte
[1/100th] 1 byte
GGet values of variables in list
[Var1] 2 bytes
[Var2] 2 bytes
[Var3] 2 bytes
[Var4] 2 bytes
....
see note 1
[Value1] 4 bytes
[Value2] 4 bytes
[Value3] 4 bytes
[Value4] 4 bytes
....
see note 2
PGet quantities of variables
None [Qty of R variables] 2 bytes
[Qty of I variables] 2 bytes
[Qty of O variables] 2 bytes
[Qty of A variables] 2 bytes
[Qty of Y variables] 2 bytes
SSet values of variables in list
[Var1] 2 bytes
[Value1] 4 bytes
[Var2] 2 bytes
[Value2] 4 bytes
[Var3] 2 bytes
[Value3] 4 bytes
[Var4] 2 bytes
[Value4] 4 bytes
....
see notes 1 and 2
None
VReturn the identifiers for the variable names in a list
[Var1] 2 bytes
[name1] ASCII string
[Separator] 1 bytes - space or comma
[name2] ASCII string
[Separator] 1 bytes - space or comma
[name3] ASCII string
[Separator] 1 bytes - space or comma
[name4] ASCII string
[Separator] 1 bytes - space or comma
....
[id1] 2 bytes
[id2] 2 bytes
[id3] 2 bytes
[id4] 2 bytes
.....
see notes 1
$Execute RTES command
[Command text] ASCII string
Any command listed in the RTES manual may be executed. Additional commands allow read/write access to the database and tasks. See table below.
[Response] ASCII String

Note 1: Identification of RTES variables.
RTES variable identifiers are coded as 16-bit indexes within each type of variables ORed with a mask that identifies the type, as follows:

00100000B	for Y
01000000B	for A
10000000B	for I
10100000B	for O
11000000B	for R
The upper 3 bits of the word are reserved for type identification. A point index cannot exceed 1FFF hex or 8191 decimal

Note 2: Variable values.
Values are sent and received as IEEE 32 bit short real (4 bytes).

The following is the IEEE format for encoding 4-byte real numbers:

   Short Real Number
     31      23      15      7       0
    _________________________________
   |_|_______|_______|_______|_______|
   ^ ^       ^                       ^
   | |       |                       |
   | Exponent|                       |
   |         |Mantissa ------------->|
   |Sign 
The parts of the real numbers are described below:
  1. Sign (0 for positive or 1 for negative) is in the upper bit of the first byte.


  2. Exponent 'excess-128' is in the next 8 bits in sequence.


  3. All except the first-set bit of Mantissa are in the remaining 23 bits of the variable. Because the first significant bit is known to be set, it does not need to be stored.


Additional RTES commands that are used with the '$' function code

COMMANDDESCRIPTIONARGUMENTSRESPONSE
DATAReturn the definition line of a point
Point name or coded point id.
You may use the point name as an ASCII string.
You may identify the point using a numeric decimal as follows:
0 + R register index
10000 + I register index
20000 + O register index
30000 + A register index
40000 + Y register index
The string appearing in the point definition page - without the current value - is returned
TLIInsert a line in a task
Task name, Line number
Both arguments are ASCII string.
None
TLDDelete a line in a task
Task name, Line number
Both arguments are ASCII string.
None
TNCreate a task
Task name
ASCII string.
None
TRGet a line in a task
Task name, Line number
Both arguments are ASCII string.
The ASCII string of the task line
TWSave a line in a task
Task name, Line number, Text
All arguments are ASCII string.
None
TXReturn the status of all the tasks
None [Name1] ASCII string
[space]
[Status1] 1 byte
[space]
[Name2] ASCII string
[space]
[Status2] 1 byte
[space]
[Name3] ASCII string
[space]
[Status3] 1 byte
[space]
[Name4] ASCII string
[space]
[Status4] 1 byte
[space]
.....
Status byte is a ASCII character:
I - inactive
R - running
S - suspended
W - waiting
X - suspended and waiting

NetBIOS naming conventions.
On a NetBIOS/NetBEUI network, nodes are identified by an alpha-numeric name. Each RTES or WinRTES node on the network is assigned a name composed as follows : BIOSNET_xx

xx is the 2 digit hexadecimal representation of the node id defined by the "N=" parameter in the configuration file. In addition, all rtes nodes on the network share the group name BIOSNET_GROUP.

Any other program that communicates with the RTES nodes using RNET, must also adopt a NETBIOS name using the form BIOSNET_xx.

UNET - IP addresses
When using UNET to communicate with other RTES nodes, PORTn.CNF must include a table that associates the node id of the target RTES with the IP's that are assigned to them.
This table is in the following format
S=n ;n=number or remote RTES nodes
id ip1,ip2,ip3,ip4 ;5 numbers for each remote node.

Where id is the node id of the remote station and the next 4 numbers are the IP address assigned to that remote station. (See
QNET/XNET)

Additional reference

This link shows you step by step how to install a DOS client/server that includes NETBIOS.

Click here to view/download the source code of a pascal program that use NETBIOS under the Windows NT

Procedure to install NetBEUI in Windows