Modem connection to a driver

Modem connection to a driver

Previous chapter Next chapter Display all Display all Hide all Hide all
© Ing. Punzenberger COPA-DATA GmbH. For any questions regarding the documentation please contact: documentation@copadata.com

This description explains the use and the configuration of the modem connection implemented in the driver kit as a standard. The aspects of programming are not explained in detail here, refer to the driver kit documentation for this information.

Driver specific settings and requirements can be found in the documentation of the according driver.

It is also assumed, that the reader is familiar with the control system.

The modem connection described here is not available under Windows CE 2.x.

Other topics in this chapter

General

Configuration

Runtime

Error search


General

Modem connection to a driver -> General

The following requirements have to be fulfilled, so that the modem connection can be used with a driver.

The driver has to support the connection to the PLC vie modem. Whether the driver supports a connection vie modem, can be seen in the

configuration dialog Com. If the checkbox Modem connection is available, the driver can connect to the PLC via modem.

The connection to the modem is realized via the Windows interface TAPI (Telephony Applivation Program Interface). So a TAPI modem has to be configured.

On the opposite side a modem operation also has to exist.


Configuration

Modem connection to a driver -> Configuration

Other topics in this chapter

Modem

Rufeinstellungen

Drivers

Variables


Modem

Modem connection to a driver -> Configuration -> Modem

The modem is configured in the Control Panel/Modems. This has to be done before the driver configuration. Refer to the documentation of the modem or your operating system for the general configuration of your modem.

Here you only will find the description of the requirements for the modem connection.


Rufeinstellungen

Modem connection to a driver -> Configuration -> Rufeinstellungen

Previous chapter Next chapter Display all Display all Hide all Hide all
© Ing. Punzenberger COPA-DATA GmbH. For any questions regarding the documentation please contact: documentation@copadata.com

Im Konfigurationsdialog Eigenschaften von xxx

ist auf zwei Einstellungen besonders zu achten.

Other topics in this chapter

Cancel dialing

Disconnect after idle time

Log file


Cancel dialing

Modem connection to a driver -> Configuration -> Rufeinstellungen -> Cancel dialing

Previous chapter Next chapter Display all Display all Hide all Hide all
© Ing. Punzenberger COPA-DATA GmbH. For any questions regarding the documentation please contact: documentation@copadata.com

This value has to be higher than the time for the connection establishment.

The setting has to be activated.


Disconnect after idle time

Modem connection to a driver -> Configuration -> Rufeinstellungen -> Disconnect after idle time

Previous chapter Next chapter Display all Display all Hide all Hide all
© Ing. Punzenberger COPA-DATA GmbH. For any questions regarding the documentation please contact: documentation@copadata.com

This value has to be higher than that configured for inactivity.

The setting has to be activated.


Log file

Modem connection to a driver -> Configuration -> Rufeinstellungen -> Log file

Previous chapter Next chapter Display all Display all Hide all Hide all
© Ing. Punzenberger COPA-DATA GmbH. For any questions regarding the documentation please contact: documentation@copadata.com

In the extended settings

there is a checkbox for recording a log file. If it is activated, all data exchanged with the modem are recorded in a log file. The file is in the Windows directory (e.g. C:\WINNT) and has the name of the modem, for which logging is activated. For example: ModemLog_Sportster 28800-33600 External.txt. This file is useful to find errors. Because of the quickly growing size logging should only be activated for a short time.


Drivers

Modem connection to a driver -> Configuration -> Drivers

After the checkbox Modem connection has been activated, the dialog changes its appearance and displays the fields for the modem configuration.

Other topics in this chapter

Modem

Telephone number

HW address

Inactive(s)

Time between calls

Automatic connection


Modem

Modem connection to a driver -> Configuration -> Drivers -> Modem

Previous chapter Next chapter Display all Display all Hide all Hide all
© Ing. Punzenberger COPA-DATA GmbH. For any questions regarding the documentation please contact: documentation@copadata.com

Select the desired TAPI modem here.


Telephone number

Modem connection to a driver -> Configuration -> Drivers -> Telephone number

Previous chapter Next chapter Display all Display all Hide all Hide all
© Ing. Punzenberger COPA-DATA GmbH. For any questions regarding the documentation please contact: documentation@copadata.com

The telephone number for the connection. If no number is entered, there will not be an automatic connection establishment.


HW address

Modem connection to a driver -> Configuration -> Drivers -> HW address

Previous chapter Next chapter Display all Display all Hide all Hide all
© Ing. Punzenberger COPA-DATA GmbH. For any questions regarding the documentation please contact: documentation@copadata.com

The hardware address for the telephone number. Only variables for the defined hardware address are polled. If -1 is entered here, all addresses are polled.


Inactive(s)

Modem connection to a driver -> Configuration -> Drivers -> Inactive(s)

Previous chapter Next chapter Display all Display all Hide all Hide all
© Ing. Punzenberger COPA-DATA GmbH. For any questions regarding the documentation please contact: documentation@copadata.com

The connection is closed, if there is no answer from the station within this time [s].

Default: 30s


Time between calls

Modem connection to a driver -> Configuration -> Drivers -> Time between calls

Previous chapter Next chapter Display all Display all Hide all Hide all
© Ing. Punzenberger COPA-DATA GmbH. For any questions regarding the documentation please contact: documentation@copadata.com

The modem waits this time [s] between two calls.

Default: 60 s


Automatic connection

Modem connection to a driver -> Configuration -> Drivers -> Automatic connection

Previous chapter Next chapter Display all Display all Hide all Hide all
© Ing. Punzenberger COPA-DATA GmbH. For any questions regarding the documentation please contact: documentation@copadata.com

If this setting is activated an a telephone number is defined, the connection establishment is started immediately on starting the Runtime.


Variables

Modem connection to a driver -> Configuration -> Variables

In the control system the assignment to a station is defined in the bus address.

At a certain point of time a modem can only be used once, and can only have connection to one station. So only the variables of the connected station are read. The other variables haver the status disturbed (INVALID bit active). Only if the hardware address of the station is -1, all variables with all bus addresses are read from this station.


Runtime

Modem connection to a driver -> Runtime

The behavior of the modem connection during Runtime depends on the currently active configuration. On starting the Runtime the settings are taken from the driver configuration, they can however be changed during Runtime. These changes are realized with the according driver variables.

Other topics in this chapter

Driver variables

Establishing a connection

Connection stopped


Driver variables

Modem connection to a driver -> Runtime -> Driver variables

For the modem connection there are a number of driver variables, which are devided in two groups.

The name, the type and the offset of the driver variables are those from the variable import file DRVVAR.DBF.

Here only the driver variables concerning the modem connection are dealt with.

Other topics in this chapter

Options

Status information


Options

Modem connection to a driver -> Runtime -> Driver variables -> Options

Previous chapter Next chapter Display all Display all Hide all Hide all
© Ing. Punzenberger COPA-DATA GmbH. For any questions regarding the documentation please contact: documentation@copadata.com

This group contains driver variables, which display the current configuration or allow to change the configuration.

ModemActive

1, if the modem is active for the driver

Device

Name of the modem. In the Runtime another modem can be entered. But you have to care, that you enter a defined TAPI modem. A changes setting has to be activated with ApplyModem.

ReconnectInRead

If 1, the modem is automatically reconnected for reading Reading here means reading from the interface. If Autoconnect is active, this setting is not regarded.

PhoneNumber

Current telephone number If the current telephone number is empty, there will never be an outgoing connection establishment, no matter what the settings for Autoconnect or ReconnectInRead are. The telephone number is deleted on an incoming, accepted call.

ModemHwAdr

Hardware address of current telephone number Only variables with the bus address set here are read. On an incoming, accepted call this value is set to -2, until the calling station identifies itself. After the identification the bus address of the calling station is displayed. A value -1 defines, that there should be a communication with all bus addresses of this connection.

Autoconnect

1, if the modem connection should be established automatically for reading/writing Reading/writing here means the interface.

If the connection breaks, with value 1 the station is again dialed with the number entered in PhoneNumber. The bus address goes to disturbed, if the new dialing fails. As long as Autoconnect is 1 and PhoneNumber contains a number, the connection establishment is tried.

RxIdleTime

Modem is disconnected, if no data are received for this time (in ms) The Control Panel/Modems has a similar setting, which however only checks, if any data are transferred via the modem.

WriteTimeout

Max time for writing for a modem connection

PhoneNumberSet

Telephone number, to which a connection should be tried with the next ApplyModem. If the telephone number is empty, no new connection is established.

ModemHwAdrSet

Hardware address belonging to PhoneNumberSet.

ApplyModem

If the value 1 is written, the current contents of the driver variables Device, PhonenumberSet and ModemHWAdrSet is assigned. A currently active connection is disconnected in any case.

RingCountSet

Number of rings to be waited, before the call is accepted. Whether incoming calls are accepted, always depends on the driver. Not all drivers support incoming calls. Refer to the driver documentation for details.

ReCallIdleTime

Waiting time between calls

ConnectTimeout

Time for establishing connection The connection has to be established within this time, otherweise the attempt is cancelled as unsuccessful.


Status information

Modem connection to a driver -> Runtime -> Driver variables -> Status information

Previous chapter Next chapter Display all Display all Hide all Hide all
© Ing. Punzenberger COPA-DATA GmbH. For any questions regarding the documentation please contact: documentation@copadata.com
LineStateIdle | 1, if the modem connection is idle. This status becomes active, if before at least once a connection has existed.
LineStateOffering | 1, if a call comes in.
LineStateAccepted | 1, if the call has been accepted.
LineStateConnected | 1, if a connection has been established. If during an existing connection another station is dialed, the connect status stays active, although for the new dialing the current connection is closed.
LineStateProceeding | 1, if dialing has been executed.
LineStateDisconnected | 1, if the connection is closed. This status only is active, if no connection has been established.
ModemStatus | Current modem status Contains all information of LineStatexxxx as a whole.


Establishing a connection

Modem connection to a driver -> Runtime -> Establishing a connection

Previous chapter Next chapter Display all Display all Hide all Hide all
© Ing. Punzenberger COPA-DATA GmbH. For any questions regarding the documentation please contact: documentation@copadata.com

The dialing can be triggered in several ways.

Other topics in this chapter

Auto connect at Runtime start

Auto connect at connection failure

Driver command Connect modem

ApplyModem


Auto connect at Runtime start

Modem connection to a driver -> Runtime -> Establishing a connection -> Auto connect at Runtime start

Previous chapter Next chapter Display all Display all Hide all Hide all
© Ing. Punzenberger COPA-DATA GmbH. For any questions regarding the documentation please contact: documentation@copadata.com

If the Runtime is started and Autoconnect is configured, the connection to the defined station is established immediately. If this is successful, all variables of the connected station are read without being disturbed.

This connection is established even, if no variables of the station have to be read. If this is not desired, it can be avoided with a little trick. Deactivate Autoconnect in the driver configuration. Telephone number and HW address however have to be configured. Set the driver variable Autoconnect to 1 in the AUTOSTART script. Now the connection is automatically established, when data are needed. The same is true for writing.


Auto connect at connection failure

Modem connection to a driver -> Runtime -> Establishing a connection -> Auto connect at connection failure

Previous chapter Next chapter Display all Display all Hide all Hide all
© Ing. Punzenberger COPA-DATA GmbH. For any questions regarding the documentation please contact: documentation@copadata.com

For the automatic reconnect on a failure the following points have to be fulfilled.

Driver variable Phonenumber is not empty.

Driver variable ModemHWAdr is not -2.

Variables of the station should be read or written.

Driver variable Autoconnect is 1 or driver variable ReconnectInRead is 1.


Driver command Connect modem

Modem connection to a driver -> Runtime -> Establishing a connection -> Driver command Connect modem

Previous chapter Next chapter Display all Display all Hide all Hide all
© Ing. Punzenberger COPA-DATA GmbH. For any questions regarding the documentation please contact: documentation@copadata.com

With this driver command the connection establishment to a station can be triggered by hand. The according telephone number and HW address of the target station have to be entered.

If a connection to the target station already exists, no reconnect is executed. The HW address is always taken. So the HW address of the target station can be changed. The connection is established independently from necessary data exchange.


ApplyModem

Modem connection to a driver -> Runtime -> Establishing a connection -> ApplyModem

Previous chapter Next chapter Display all Display all Hide all Hide all
© Ing. Punzenberger COPA-DATA GmbH. For any questions regarding the documentation please contact: documentation@copadata.com

With setting the driver variable ApplyModem to 1 the currently set values in Device, PhonenumberSet and ModemHWAdrSet are taken. A currently active connection is disconnected in any case. A new connection is only established, if the phone number (PhonenumberSet) is not empty.


Connection stopped

Modem connection to a driver -> Runtime -> Connection stopped

Previous chapter Next chapter Display all Display all Hide all Hide all
© Ing. Punzenberger COPA-DATA GmbH. For any questions regarding the documentation please contact: documentation@copadata.com

The connection is closed because of a number of reasons:

  • On the connection establishment the connection could not be established within the configured time. See also Configuration time for establishment, driver variable ConnectTimeout.
  • No response of the target station has been received within the configured time. See also Configuration Inactivity and driver varieble RxIdleTime.
  • Data have not been transferred for too long a time and TAPI closed the connection. See also Control Panel/Modems/Call settings.
  • The driver command Modem connect has been executed with a phone number different from the current connection.
  • The driver command Modem stopped has been executed. This closes the current connection and deletes the phone number of the station. So also no Autoconnect is executed.
  • The Runtime is closed.


Error search

Modem connection to a driver -> Error search

Because of the higher number of involved components with a connection via modem there is also a higher number of possible errors in engineering.

Other topics in this chapter

PC

SPS


PC

Modem connection to a driver -> Error search -> PC

On the PC side the modem settings are defined with the installation of the according TAPI driver. So the basic commands for the modem functions are known.

If the modem answers calls, but does not dial, it may be necessary to activate the setting Wait for dial tone. This is often necessary in interphone systems.

If with incoming calls the modem answers, synchronizes and immediately rings off, the identification probably failed.

Other topics in this chapter

Modem log

Interface log


Modem log

Modem connection to a driver -> Error search -> PC -> Modem log

Previous chapter Next chapter Display all Display all Hide all Hide all
© Ing. Punzenberger COPA-DATA GmbH. For any questions regarding the documentation please contact: documentation@copadata.com

In order to limit the cause of failure it is possible to activate the checkbox Record log in Control Panel/Modems/Settings/Settings/Extended. With activated logging a log file is generated in the Windows directory, e.g. C:/WINNT. The name of the file depends on the modem, e.g.: ModemLog_Sportster 28800-33600 External.txt. In this file all data are logged, which are exchanged with the modem. Only activate this option for a short time, because the file quickly gets very big.


Interface log

Modem connection to a driver -> Error search -> PC -> Interface log

Previous chapter Next chapter Display all Display all Hide all Hide all
© Ing. Punzenberger COPA-DATA GmbH. For any questions regarding the documentation please contact: documentation@copadata.com

All drivers with modem connection offer the possibility to activate logging of the received and sent data in the driver. By adding the section

[RS232LOG]

LOGCOMx=1

in the project.ini this interface logging is activated. These data are saved in the file LOGFILE.TXT which is stored in the driver directory.

Only activate logging for a short time, because the file quickly gets very big.


SPS

Modem connection to a driver -> Error search -> SPS

Usually programs for the modem connection are needed in the PLC. Refer to the according manufacturer documentation for the programming and configuration of these function components.

The configuration of the modem has to be defined. Refer to the modem documentation for according register documentation.

If the PLC should call the Runtime, the identification necessary for the driver has to be implemented. Refer to the driver documentation for details.