Welcome

>> For Asix 8 users

www.asix.com.pl

AsComm

Doc. Nr ENH8016

Version: 2016-01-19


AsComm program

1. AsComm Program

1.1. AsComm Program Functions

The AsComm program is designed to manage and to monitor connections performed by the Asix system modules. The connections are established by means of serial interfaces or modems (e.g. switched lines). Main components managed by the AsComm program are „Client" and „Resource". The client is the Asix system module using AsComm program functions. The client is identified by its name. The resource is a communication interface like serial port or modem. By means of the AsComm program, the "clients" may use the "resources" to establish connections. Many clients may use a resource. One of the AsComm program tasks is enabling to share an individual interface between many clients. The way of allocating the resources and of executing the other functions is determined by an appropriate parameterization of the initialization file.

This AsComm program description does not include a modem configuration.

1.2. Allocating Resources

A given resource may be allocated to a client when the client demands such an allocation and other conditions, determined by allocation parameters included in the initialization file, are met. These parameters may specify a time, at which a resource is allocated to the client, a period of allocation time, etc. Allocation of a given resource sometimes requires additional actions - for example in the case of communication via switched telephone lines.

1.3. Sharing Resources

The resources are allocated to the clients on their demand. For conflict resolution of an access to the resource a priority rule is used. Each client may have an assigned number, which determines its priority. If in the moment of a demand reception, the resource is already used by another client with a lower priority, then the AsComm program passes a given resource to the client with a higher priority. Resource passing sometimes requires the termination of existing connection. Depending on the parameterization, the termination of existing connection may be preceded by a time delay. The delay may also precede an establishment of a new connection.

2. User Interface

2.1. Main Window

The main window of the program is showed below.

The main window consists of three subwindows:

- client window

- resource window

- message window

The client window shows a list of clients as well as resources connected to them. A client name is preceded by a mark determining the state of its connection:

- client is not connected

- disconnection is going on

- client demands a new connection

- connection is being established

- client is connected

The resource window contains the list of all resources managed by the AsComm program.

In the message window, the messages informing about events in the AsComm program are displayed.

Selection and double-clicking on an item in the client window or selection of the item Details in the main window menu causes a client information window to open.

Selection and double-clicking an item in the resource window or selection of the item Details in the main window menu causes a resource information window to open.

Selection of the item History causes an events history window to open.

2.2. Client Information Window

The client information window is showed below.

The client information window contains the following information:

· time of client installation and deleting

· resource, which the client uses

· client priority

· actual connection state

· number of connections established until now

· number of unsuccessful attempts to establish connection

· average duration time of connection

· total duration time of all connections

· parameters determining the way of establishing a connection

The client information window is provided with Change button, which causes a parameters changing window of establishing connections to open:

Beside of parameters of establishing connections this window contains a check box Disconnect if necessary. Checked checkbox will cause the disconnection, if from the newly entered parameters comes from, that connection should not be established at a given moment. If the checkbox is not checked then a change of parameters does not cause the existing connection to be disconnected. New parameters are valid until program end or next change. After having restarted the AsComm program, the parameters included in the initialization file are restored.

2.3. Resource Information Window

A resource information window contains basic information about a resource:

The window contains among others:

· time of resource installation and time of its deleting

· name of the client, who has established a connection by means of this resource

· number of connections successfully established until now

· average duration time of connection

· total duration time of all connections

· parameters determining the way of establishing connections

The Change button of client information window is used to modify the parameters for establishing the connections:

2.4. History Window

The window contains a list of important events in AsComm program operation. The object name (client, resource), to which the event relates, its description and time of its occurrence is given.

3. AsComm Program Parameterization

From Asix5 AsComm parameters are declared in XML application configuration file with use of

Architect program:

Architect > Fields and Computers > Miscellaneous module

AsComm program parameters are placed in the initialization file of Asix application. General parameters are placed in the [ASCOMM] section. Parameters concerning a resource are placed in a section with the same name as the resource name. Parameters concerning the way of establishing a connection on behalf of the client and other parameters related to the client are placed in a section with the same name as the client name.

The parameters, which contain the time, may be entered as numbers without unit or strings of numeric values terminated with a one-character unit code:

d – day

h – hour

g – hour

m – minute

s – second

ms – millisecond

If the unit is not given then it is assumed that it is a second. For example: 1g 20m 30s 4ms.

General parameters

Name

Description

Default value

Exit_Lock

Forbids the operator to close the AsComm program. If the parameter is not present in the [AsComm] section then a parameter with the same name from [START] section is taken into consideration.

Allowable values: Yes, No or password are required for program shutdown (parameters Password_Coding and Active_Time of [PASSWORDS] section are valid)

No

Modify_Lock

Forbids to make changes during program operation

Allowable values: Yes, No or password are required for parameters modification (parameters Password_Coding and Active_Time of [PASSWORDS] section are valid)

No

Max_history_window

Specifies the maximal number of elements of events history window

5000

Max_history

Specifies the maximal number of elements of events history

5000

Minimize

Determines if the main program window should be opened in minimized form

Allowable values: Yes, No

Yes

No_close

If Yes is given then the AsComm program does not ends even if the application, which uses it (Asix), has ended its work.

The AsComm program will not be closed too when during its operation it was used in not minimized form.

Allowable values: Yes, No

No

Log

Specifies a file name, to which diagnostic information will be written

N/A

Parameters determining the way of access to resource

Parameters determining the way of access to resource are placed in a section of the same name as the client name:

Name | Description | Default value
Baud | Transmission speed | 9600
stop_bits | Number of stop bits | 1
Com | Number of serial port | N/A
Disconnection_Time | Time of terminating a connection | 500 ms
Word_Length | Word length | 8
Accuracy | Accuracy of determining a connection beginning | 5000ms
Interval | Time period of establishing connections for cyclic connections. A new connection is established when the time, which passed from the termination of previous connection, is longer than the time specified by parameter Interval. | N/A
Switched_Line | Determines if a modem connection is used. Allowable values: Yes, No | No
Max_Connection_Time | Determines the maximal duration time of connection. If the parameter Max_Connection_Time is given for the resource too then the smaller one of given values is taken into consideration. | N/A
Min_Inter_Connection_Time | Minimal time interval between connections. If the parameter Min_Connection_Time is given for the resource too then the greater one of given values is taken into consideration. | 0
Min_Connection_Time | Minimal duration time of connection. The parameter permits to determine the minimal duration time of connection required by the client. If many clients use the established connection, the parameter Max_Connection_Time is specified and the remaining time to connection termination is shorter than it is determined by the parameter Min_Connection_Time then the client does not receive the allocation | N/A
Modem | Modem name if a modem connection is used for connections. It is possible to give only the initial part of modem name. | N/A
Number | Telephone number. The parameter is important only when the parameter Switched_Line has a value of „Yes”. | N/A
Parity | Kind of parity check | N
Com | Number of serial port. The port name may be preceded by a string COM i.e. Com = 2 and Com = Com2 are both correct and signify the same port. | N/A
Retries | Number of unsuccessful transmissions | 3
Priority | Client priority | 0
Timeout | Timeout of waiting for answer | N/A
Time_align | Determines the time synchronization for connection established periodically. Allowable values: Yes, No or a value, which determines a time offset in relation to the time, which is a multiple of interval. For instance if the interval is equal to 1h and the parameter Synchronization has a value of 15m then the connections will be established at: 12:15:00, 01:15:00 etc.. | N/A

One should notice that a client using a connection may determine itself the transmission parameters such as speed, stop bits, parity, timeout etc. The settings, concerning the transmission, determined directly by the client have priority over the settings specified by the above entries.

Resource Parameters

Resource parameters are placed in a section with the same name as the resource name:

Name | Description | Default value
Max_Connection_Time | If the parameter Max_Connection_Time is given for the client too then the smaller one is taken into consideration. | N/A
Min_Inter_Connection_Time | Minimal time interval between connections. If the parameter Min_Inter_Connection_Time is given for the client too then the greater one is taken into consideration. The parameter may be useful in case of sharing a line switched by a modem or other devices (for instance telephone), enabling these devices to use the switched line. | 0

4. AsComm Program Installation and Uninstallation

In order to install the AsComm program you should copy it to selected directory and run it with /Regserver command line parameter:

AsComm /regserver

Application programs using the AsComm program must have access to the library AsCommcl.dll

In order to uninstall the program you should perform the command:

AsComm /unregserver

5. Interoperability of MODBUS Driver with AsComm Program

The MODBUS driver ver. 1.9.1 or higher is designed for the interoperability with AsComm program.

The MODBUS driver parameterization is described in the documentation of the Asix system drivers: CommunicationDrivers.hlp.

If the channel declaration is as follows:

Channel name: logical_name

Channel driver: Modbus

Device identifier: 4

Port: COM3

the name of client will be ‘MODBUS:3’

To establish the communication with AsComm it is important to set up the Switched line parameter:

Architect > Fields and Computers > Current data module > declared channel parameters > AsComm server client tab

If the modem is connected to an other port than COMn, then you should give the number of this port by means of the parameter Define modem by port > port or specify the modem name by means of the parameter Define modem by name. You should also give a telephone number and define other parameters required. If MODBUS driver has to communicate with many controllers by means of the same modem, then one should define suitable number of channels assuming the parameter port as a virtual transmission channel and specify for each channel an appropriate telephone number.

EXAMPLE

Channel declarations:

Name: Chan1

Driver: MODBUS

Device identifier: 1

Port: COM11

Transmission speed in bauds: 9600

Number of bits In a character: 8

Parity checking: none

Number of stop bits: 1

Maximal number of inputs/outputs: 16

Maximal number o registers: 16

Declaration of ‘Chan1’ as AsComm server client:

Switched line / Use a modem for connection initialization – the parameter set up

Define modem by name: US Robotics

Phone number: 11111111

Name: Chan2

Driver: MODBUS

Device identifier: 1

Port: COM12

Transmission speed in bauds: 9600

Number of bits In a character: 8

Parity checking: none

Number of stop bits: 1

Maximal number of inputs/outputs: 16

Maximal number o registers: 16

Declaration of ‘Chan2’ as AsComm server client:

Switched line / Use a modem for connection initialization – the parameter set up

Define modem by name: US Robotics

Phone number: 22222222

In the example above Chan1 will communicate with a controller placed under the telephone number 11111111, and the Chan2 with a controller placed under the telephone number 22222222. The US Robotics modem will be used. The Define modem by name parameter may be replaced by the parameter Define modem by port, which specifies the number of the serial port to which the modem is connected.

You should notice that the above description of using of the MODBUS driver on switched lines does not include any modem parameterization. The modem parameterization depends on type of used modems. During tests a modem „Zyxel OMNI 288S” (on the slave side) and a modem „Pentagram Shadow 56K” on the Asix system side were used. The following parameterization of modems was performed:

· the modem on the slave side was set in the mode „Auto answer” and respond to a remote call after having received one ring signal;

· the modem on the slave side was set so that the transmission between the modem and the slave may always be performed at speed of 9600 bps;

· the modem on the slave side was set so that the modulation V32 9600 may always be used;

· the maximum transmission speed between the Asix system and the modem was limited to 9600 bps (modem settings in Windows system);

· on the Asix system side the hardware compression was switched off (modem settings in Windows system);

· transmission parameters of the MODBUS driver were set to 9600,8,none,1.