Vision OPLCs Modems


Add to my manuals
107 Pages

advertisement

Vision OPLCs Modems | Manualzz

Vision OPLCs and Modems

3/2010

The information in this document reflects products at the date of printing.

Unitronics reserves the right, subject to all applicable laws, at any time, at its sole discretion, and without notice, to discontinue or change the features, designs, materials and other specifications of its products, and to either permanently or temporarily withdraw any of the forgoing from the market.

All information in this document is provided "as is" without warranty of any kind, either expressed or implied, including but not limited to any implied warranties of merchantability, fitness for a particular purpose, or non-infringement. Unitronics assumes no responsibility for errors or omissions in the information presented in this document. In no event shall Unitronics be liable for any special, incidental, indirect or consequential damages of any kind, or any damages whatsoever arising out of or in connection with the use or performance of this information.

The tradenames, trademarks, logos and service marks presented in this document, including their design, are the property of Unitronics (1989) (R"G) Ltd. or other third parties and you are not permitted to use them without the prior written consent of Unitronics or such third party as may own them.

Table of Contents

About Modems and Unitronics OPLCs ................................................................ 7

Before you begin: Modem Tips....................................................................... 7

Modem Connection and Pinouts ..................................................................... 9

Connecting a Controller to a Modem ............................................................... 9

Modem to Controller Interface (DCE to DTE) ................................................... 9

Using Modem Kits ...................................................................................... 10

Using a Unitronics Adapter .......................................................................... 11

Constructing Adapters ................................................................................ 11

PC-Side Modems (Modem Services) ................................................................ 13

Initializing a PC-side Modem (Prepare Modem) .............................................. 13

Modem Service Options .............................................................................. 14

How to use the PC modem to access a PLC ................................................... 15

PLC-side Modems ......................................................................................... 17

How to enable a controller to communicate via landline or GSM/GPRS modem .. 17

How to enable a PLC to dial a remote modem (Ladder) ................................... 20

Landline modems ................................................................................... 20

How to terminate the link--Hang-up ............................................................. 21

Last Call, CLIP: Identifying Callers .................................................................. 23

The process ............................................................................................... 23

The application .......................................................................................... 24

Preventing unauthorized calls ...................................................................... 24

Dial & Hang-up ............................................................................................ 27

Dialing from the Controller's Keypad ............................................................... 29

Initializing the COM port .......................................................................... 29

Building the Cursor ................................................................................. 30

Entering numbers: 'Convert' to ASCII ....................................................... 31

Placing entered numbers in the Phone Number vector ................................. 32

Dial and Hang-up ................................................................................... 33

Accessing a Networked PLC via PC .................................................................. 35

Accessing a Networked Controller via Modem ................................................ 35

Modems: Setting Up ................................................................................... 35

Online Test Mode & Remote Access........................................................... 37

COM Port/Modem Status, System Operands, & Error Messages .......................... 39

Modem Troubleshooting ................................................................................ 43

Cable Pin-out ......................................................................................... 45

Data Flow Direction ................................................................................ 45

RS-232 signal information ....................................................................... 45

Modem Troubleshooting Table ..................................................................... 46

Using Hyperterminal to check PC-PLC direct communications ............................. 49

Using Hyperterminal for COM Troubleshooting.................................................. 53

Modem Connections ................................................................................... 53

v

Vision OPLCs and Modems

Cable Pin-out ......................................................................................... 53

Data Flow Direction ................................................................................ 53

RS-232 signal information ....................................................................... 53

Using Hyperterminal ................................................................................... 53

Modem Commands..................................................................................... 56

Initializing the modem to SMS mode via Hyperterminal .................................. 57

When a controller sends an SMS text message .............................................. 57

'The Sniffer'--Viewing communication strings ................................................ 58

GPRS ............................................................................................................ 1

Using GPRS ................................................................................................. 2

Downloading OS via GPRS............................................................................. 3

FB Operations .............................................................................................. 3

Examples .................................................................................................... 3

GPRS Configuration ........................................................................................ 5

GPRS Register to Network ............................................................................... 7

GPRS Run ...................................................................................................... 9

Start Call, End Call ....................................................................................... 11

Start Call .................................................................................................. 11

End Call .................................................................................................... 11

Listen to Remote Device, Stop Listening to Remote Device ................................ 13

Listen ....................................................................................................... 13

Stop Listening ........................................................................................... 13

Unregister from Network ............................................................................... 15

Check Signal Quality ..................................................................................... 17

GPRS Operands & Status Messages ................................................................ 19

Using SMS Messaging ..................................................................................... 1

FB Operations .............................................................................................. 1

How to Configure, Receive, and Send Messages ............................................... 1

Examples .................................................................................................... 4

SMS: Configuration ......................................................................................... 5

Creating SMS Messages & Variables ............................................................... 5

Message Properties ...................................................................................... 7

Phone Book ................................................................................................. 8

SMS Configuration and the Program Scan ........................................................ 11

SMS: Scan ................................................................................................... 13

SMS: Send .................................................................................................. 15

SMS Variables .............................................................................................. 19

SMS: Check GSM Signal Quality ..................................................................... 21

Sending SMS messages from a GSM cell phone ................................................ 23

Writing SMS messages in your cell phone ..................................................... 23

Sending the message to the PLC .................................................................. 23

Checking that the PLC has received the SMS message .................................... 23

Index .......................................................................................................... 25

vi

via the RS232 COM port. Unitronics

M/GPRS modems odems that have been tested by Unitronics and are supported for use with Vision, Jazz, and M90/91

PLCs. te data using:

VisiLogic's Communication Protocol FB, which enables Vision controllers to communicate data with most external serial devices, such as bar rs, via their proprietary protocols.

ontrollers to ar-code readers

SMS messages. The SMS FB enables text messa be sent and received via GSM modems.

variable data, to

GPRS cellular network, to transmit IP packets of data

.

You can use a PC modem to access a remote, modem perform any task, just as you would if the PLC were directly connected to your PC.

For example, you can: o access a remote, modem-linked Unitronics PLC ou would if the PLC were directly connected to your PC. em connection.

Run Online test mode. ormation Mode to troubleshoot problems in remote ons.

ms in remote from controllers via Remote Access or Unitronics' ies.

Unitronics'

Before

you can use modems in your application,

Services to initialize both the

ribed beginning on page 13.

st use Modem

ze both the PC and PLC-side modems.

This process is described beginning on page

you must use Modem ms.

Notes •

The PC-modem cable is not the same type of cable used to connect between the controller and the modem. Ensure that ed to connect e cable used to to the modem provides connection point modem's pins. cable is not the same type of cable used to connect ntroller and the modem. Ensure that the cable used to connect the PC to the modem provides connection point

If calls are routed via a switchboard, note that the switchboard settings may interfere with communications. Consult with your switchboard provider. ed via a switchboard, note that the switchboard settings ith communications. Consult with your switchboard

If, within the modem initialization strings, the parameter S7 is too short to permit the PLC's modem to answer, an error will result.

For example, if this parameter is set as S7=30, the PC modem will wait for 3 seconds to receive an answer from the PLC t answer before the 3 seconds have elapsed, the S7=30 parameter is exceeded, and the PC modem return dem. If the PLC apsed, the S7=30 e No Carrier error.

7

Vision OPLCs and Modems

• d Vision Division

rs in this division can only support a single modem. You ect a modem to any COM port. However, note that SB uccess and SB 185 TX Failed indicate message sion status odem.

regardless

Enhanced Vision Division

Controllers in this division can support a ngle modem. You can connect a modem to any COM port. However, note that SB

184 TX Success and SB 185 TX Failed indicate message transmission status to the modem.

of the actual COM port connected r, note that SB message

OM port connected rs in this division can support a modem on each COM h port is linked to a Succeed and Fail SB:

COM1: SB 184 and SB 185, COM2: SB186 and SB 187, COM3: SB

SB 189.

on each COM

B:

SB 187, COM3: SB

When working with V570 and V290 (color):

Set the baud rate in both Modem Services and in COM Init to

57600. In addition, run the Prepare PLC Modem procedure with the baud rate set to 57600.

Com Init: rate set to 57600.

gnore Break n COM Init to procedure with

- Time Out Reply: set to a minimum of 6 seconds.

Modems: bility issue: Sony Ericsson Modems.

Unitronics products are compatible

47 R5xxxx and higher

M29 R6xxxx and higher ot guarantee compatibility with other models, such as

Sony Ericsson Modem model GM29 R4xxxx.

Sony Ericsson

Model GM29 R6xxxx and higher

Unitronics cannot guarantee compatibility with other models, such as

Modem model GM29 R4xxxx.

models, such as

8

odem.

Note •

The programming cable is a

Vision all-in-one kits.

4-wire cable

included with the

kits

PLC programming cable, as shown in the figure above. m that is compatible with Unitronics controllers and e Products section of the Unitronics web site contains kit descriptions and specifications.

the figure above. ntrollers and b site contains kit

Other modems

C programming cable to connect the PLC to a modem er modem adapters from Unitronics.

D-type to D-type connector cable to connect the programming cable to the modem's serial port, according to the pin provided below. onnect the o the pin-outs

The next figure shows the interface between the Data Communications Equipment

(DCE; the modem) and the Data Terminal Equipment (DTE; the con tion of data flow. Note that: tions Equipment ontroller or PC). the PLC e modem

9

Vision OPLCs and Modems

Note •

Modems must be initialized via the

procedure. This procedure:

SR signal ON

Sets the appropriate PLC bps, 8 bit, no parity, 1 stop bit

epare Modem

propriate PLC-modem communication param are: 19200 bps, 8 bit, no parity, 1 stop bit parameters. These nd RTS signals causes the modem to be always ready to ata.

e always ready to

Using Modem Kits

Kits contain all of the elements you need to connect a controller to a modem using the appropriate PLC programming cable, as shown in the first figure at the beginning of this section. ents you need to connect a controller to a modem using mming cable, as shown in the first figure at the

Note that you must remove the PC adapter from the PLC programming cable and replace it with the modem adapter supplied in the kit.

e modem onics controllers, you must initialize the modem via the

repare PLC Modem topic.

e modem via the dem adapters supplied with the kits and their pin onsult your Unitronics distributor.

d their pin-outs.

Adapter signals

DSR (out) +

RTS (in)

GND

RXD (out)

TXD (in)

GND

DCD (out)

Note •

5

2

3

5

1

D-Type 9

6+7

pin, male

2

3

4

5

6

RJ11

1

5

4

3

2

1

RJ11

6

Controller signals

DSR (in)

GND

RXD (in)

TXD (out)

GND

DTR (out) pectively.

10

Modem Connection and Pinouts

Sony Ericsson GM29 and Enfora GSM/GPRS modems

Modem Adapter MJ10-22-CS72

Adapter signals D-Type 9 pin, male

DSR (out) 6

GND

RXD (out)

5

2

TXD (in)

GND

DCD (out) +

RTS (in)

3

5

1+7

4

5

6

2

3

RJ11

1

3

2

1

5

4

PLC Serial Port / Port Module

RJ11 Controller signals

6 DSR (in)

GND

RXD (in)

TXD (out)

GND

DTR (out)

Note •

The cable connects RJ11 pins 2,3,4,5 to pins 5,4,3,2 respectively.

Wavecom GSM/GPRS modems

Modem Adapter MJ10-22-CS79

Adapter signals

DCD (out)

D-Type 15 pin, male

1

GND

RXD (out)

TXD (in)

GND

DSR (out) +

RTS (in)

9

6

2

9

7+12

4

5

6

2

3

RJ11

1

3

2

1

5

4

PLC Serial Port / Port Module

RJ11

6

Controller signals

DSR (in)

GND

RXD (in)

TXD (out)

GND

DTR (out)

Note •

The cable connects RJ11 pins 2,3,4,5 to pins 5,4,3,2 respectively.

Wavecom modem kits do not contain the PC to modem cable, MJ10-22-

CS32, that is required for the Wavecom Prepare Modem procedure. This cable is available by separate order.

Using a Unitronics Adapter

If you are using a modem from an independent source, you can order one of the modem adapters described in the preceding section from Unitronics, and use this adapter to connect your modem to the PLC via the PLC programming cable.

Constructing Adapters

You can construct a D-type modem adapter yourself, using the appropriate pin-outs shown in the preceding section.

You can also construct a cable with 2 male D-type connectors, and then use it to connect a modem's serial port directly to the PC adapter on the PLC programming cable as shown in the next figure.

The tables below give the pin-outs of the programming cables, and show you an example of the pin connection you can use to construct a cable with 2 male D-type connectors to connect a PLC to a standard landline modem.

11

Vision OPLCs and Modems

Vision 4-wire Programming Cable

PC -side

Adapter MJ10-22-CS25

PC signals

D-Type 9 pin, female

DTR (out) 4

GND 5

TXD (out) 3

RXD (in) 2

GND

DSR (in)

5

6

RJ11

5

6

3

4

1

2

2

1

4

3

6

5

PLC-side

Programming port

RJ11 Controller signals

DSR (in)

GND

RXD (in)

TXD (out)

GND

DTR (out)

Unused

Unused

Note •

The 4-wire programming cable supplied with the controller connects RJ11 pins 2,3,4,5 to pins 5,4,3,2 respectively.

Example

: D-type modem adapter cable to connect a Vision controller to a standard landline modem

Modem-side

(D-type 9-pin, male)

DSR (out) +

RTS (in)

6+7

PLC-side

(D-type 9-pin, male)

GND

RXD (out)

TXD (in)

GND

3

5

5

2

2

5

5

3

GND

RXD (in)

TXD (out)

GND

12

Modem Services enables you to initialize modems for both PC and PLC. Once you ccess a remote, d perform any task, just as you would if the PLC were

PC. For example, you can:

PLC. Once you have configured a PC-side modem, you can use a PC modem to access a remote, modem-linked controller and perform any task, just as you would if the PLC were directly connected to your PC if the PLC were

Download, upload, and edit the controller program via the modem connection.

Information Mode to troubleshoot problems in remote cations.

lems in remote to/from controllers via Remote Access or Unitronics' tilities.

or Unitronics'

Before integrating modems into your applications, check the section

Cautions.

1.

Connect the modem to a PC, using a

pinout, either supplied in the modem kit or supplied by the modem manufacturer

.

to a PC, using a

cable comprising the full RS232 plied in the modem kit or supplied by the modem

Note that using a cable that does not comprise the cause the process to fail.

RS232 pinout will

2.

Open Modem Services from the Connection menu.

3.

Select and enter the modem parameters: a.

Modem Services, select a tab; the Modem Type selection options.

m Type selection b.

Select the PC modem type; accordingly. Selecting TAPI displays the settings of telephony devices odem Options.

c.

If required, you can edit other parameters:

Com Port, baud rate, Time Out, and Time boxes

4.

establishes communication with the modem and ini button; the PC t.

13

Vision OPLCs and Modems

Modem Service Options

In addition to modem initialization, Modem Services offer other options:

Option Description

Dial & Hang-

Up

Dial Mode

To dial:

• Click the Number to Dial field; the Favorites list opens.

Enter or highlight the desired number.

• Close Favorites, and click Dial.

• To break the data link, click Hang-Up.

Selecting Auto enables the modem to adapt to the signal provided by the telephony service operator.

SMS Options

This option is available if you have selected a GSM modem.

• Select the destination number.

• Enter the SMS text, then click Send SMS.

• Note that an SMS can be used to cause the PLC to call the PC.

Wait for

Incoming Call

Places the PC modem in auto-answer mode.

Prepare PLC

Modem

Use this option to initialize a PLC-side modem. Full instructions are in the topic

PLC-side Modems.

14

PC-Side Modems

How to use the PC modem to access a PLC

1.

Prepare and connect the PLC-side modem as described in the topic PLC-side

Modems, in the section 'How to enable a controller to communicate via

landline or GSM/GPRS modems.

2.

Dial the PLC to establish the communication link: a.

Favorites (Telephony). You can keep a list of frequently-used numbers in Favorites. b.

Click a line to enter or select a number and description. c.

To access outside lines, enter the access number required, a comma, and then the phone number.

Click Dial to establish the data link, then enter OnLine mode.

You can now perform any task that can be performed via a direct PC-PLC connection.

Note that when the modem is connected, the Modem Connected icon appears on screen.

15

Before integrating modems into your applications, check the section

Cautions.

How to enable a controller to communicate via landline or GSM/GPRS modem oller to communicate via landline or GSM/GPRS

Preparing the modem as described below initializes it so that it is compatible with

Unitronics PLCs.

1.

Connect the modem to a PC, using a

pinout, either supplied in the modem kit or supplied by the modem manufacturer

.

to a PC, using a

cable comprising the full RS232 plied in the modem kit or supplied by the modem

RS232 pinout will

2.

Prepare the PLC modem.

a.

Connect the modem to a PC, using the manufacturer.

b.

on>Modem Services, and select the modem type. If can edit other parameters: odem type. If

Com Port, Baud Rate, Time Out, and Time boxes.

Enhanced Vision Division:

Recommended Baud Rate is 57600.

3.

Click the Prepare PLC pens.

4.

If required, edit initialization commands by clicking in the field and entering text.

5.

are set, click the Init Modem button; the PC establishes the modem and initializes it.

he PC establishes

17

Vision OPLCs and Modems

6.

Initialize the PLC port using a COM Init FB, located on the COM menu.

18

PLC-side Modems

Parameter

Name

Com Port

Baud Rate

Purpose

Select the physically linked Com Port.

Set the baud rate in COM Init to 57600:

When working with V570 and V290 (color)

When working with V120/230/260/280/290 (monochrome) together with modems

Enfora orTC65

In all other cases, 9600 is suitable.

RS232 Time

Out

This is the time that the PLC will wait for the modem to reply.

Flow Control

Ignore break

This is generally left OFF.

When working with V570 and V290 (color), select Ignore Break

Modem

Settings

Modem Type

Click to select the desired modem.

Initialization strings

Click to edit if required.

Dial Type

Time Out

Reply

Set to Tone by default.

When working with V570 and V290 (color), set a

minimum

of

6

seconds.

PIN Code

Clear SIM

If your provider requires a PIN code, enter a constant number or link to MI.

Select this to clear the SIM card when COM Init is activated.

Notes

8

8

8

COM Init is generally performed once in a program. It is usually a powerup task, however a one-shot transitional contact may also be used.

The initialization commands must match the commands used to initialize the PLC modem.

You can cause the modem to delay between initialization commands by typing WAIT, followed by the number of seconds; up to nine seconds is supported.

19

Vision OPLCs and Modems

8

8

8

Communications cannot flow through the port during initialization.

The PLC cannot answer incoming calls when it is in bootstrap mode.

The Answer Settings parameter, by default, enables the modem to answer incoming calls. This enables you to download an OS to the PLC via modem.

However, you can enable the PLC to answer instead. To do this, locate the initialization string ATS0=

1

and enter 0( ATS0=

0

).

When ATS0=0, an OS cannot be downloaded.

1.

Build a Ladder program containing the correct conditions and elements.

Note •

8

Communications cannot flow through the port during initialization. To avoid conflicts in your program, use COM Port initialization SBs 80-85

.

COM Init may take approximately a minute to complete.

2.

Download the application to the PLC.

3.

Connect the modem to the PLC.

After the modem is enabled and successfully initialized by the PLC (SBs 80, 82, 84 turn ON), the controller can either be accessed via modem or can dial a remote modem to establish a data link.

How to enable a PLC to dial a remote modem (Ladder)

Landline modems

Note

8

In the conditions used to activate the Dial function, include the appropriate

Modem Initialized System Bit: SB 80, SB 82, or SB 84.

20

PLC-side Modems

For more information regarding Ladder conditions and other details, refer to the topic Dial and Hang-up.

GSM modems

Note

8

SMS operations can conflict with applications that use the modem for other data communication processes. To prevent conflicts, use the Modem Busy

(GSM) MB, and use an MB to indicate when the modem is in use by another data communications process.

For more information on SMS messaging, refer to the SMS topics.

How to terminate the link--Hang-up

This enables you to use Ladder conditions to break the connection.

Note

8

Before activating Hang-up, check whether the connection exists, via the appropriate Modem Connection Status System Bit: SB 86, SB 87, or SB 88

21

modems. tion is located on the COM> COM Port> me dentify the caller number of an incoming call. Last Call uses the CLIP (Calling Line Identification and Presentation) feature offered by GSM

CLIP is supported by:

Enhanced Vision: from O/S 42

Standard Vision: from O/S 500-19

VisiLogic versions

5.15 and later, which contain the

CLIP command: AT

+ CLIP=1.

Using the Last Call function to write the number of an incoming call to a register n the Data Table event Illegal Calls

(CLIP).vlp.

The process

The PLC must be connected t

1.

Device modem calls a PLC modem.

2.

PLC Modem sends the CLIP command to the

PLC, containing the Caller Number and Call

3.

d to a GSM modem.

a PLC modem. e CLIP command to the

Caller Number and Call

Type (local or international) to the PLC.

PLC retains the data, and turns ON SB89

CLIP - Caller Number is here.

Note that SB89 must be reset by the user.

4.

The Last Call function stores the caller number into a vector. In the Ladder application, a Data Tables Find Row function searches for a matching number in the Data

Table. If no such number exists, the application can break activating COM Init.

r is here.

be reset by the user. n stores the caller

. In the Ladder ables Find Row function ing number in the Data mber exists, the k the connection by

23

Vision OPLCs and Modems

The application

Notes

8

8

0/260/280/290 (monochrome): the call is actually ed.

ll is actually

If the call number is unidentifiable (meaning set by the caller as private or anonymous), no numbe

=128.

n below causes the following events when the PLC's a remote modem: hen the PLC's

The Last Call Received element copies the caller number into a vector of MIs starting at MI10 e.

SB 89 is not reset, you will not be able to write new CLIP data

OR

-1,

MI21, will contain er as private or at MI 10 vating COM Init.

24

Last Call (CLIP): Identifying Callers

25

Dial & Hang-up

These functions are located on the Com menu. Via the Ladder application, they enable a PLC connected to a modem to establish or terminate a data link to another remote modem.

Before you dial, you must enable the Vision controller to communicate via modem.

Dial

This enables you to use Ladder conditions to dial a modem.

Notes

8

8

In the conditions used to activate Dial, include the appropriate Modem

Initialized SB: 80, 82, or 84

SMS operations can conflict with applications that use the modem for other data communication processes. To prevent conflicts, use the Modem

Busy (GSM) MB, and use an MB to indicate when the modem is in use by another data communications process.

Hang-up

This enables you to use Ladder conditions to break the connection.

Note

8

Before activating Hang-up, check connection status via a Modem

Connection SB: 86, 87, or 88.

27

controller's keypad. This explanati the Help menu, click Examples, and then select be dialed from the tion that is pplication, open

n Keypad

.

About the Application

Note

8

Displays a blinking cursor on number by pressing keys on the Vision keypad.

entering a phone

'Converts' the entered numbers to ASCII, then saves them, as they are entered, into a vector of registers that starts at MI each register.

copies the

low byte consecutive

011. Transpose res it into the

Phone Number rom MI

1013 and store all 4 bytes into MI 1001 and 1002.

Displays the numbers as they are entered, via the HMI v able Display ASCII

MI 1001.

by the modem as er has finished n value is stored number.

Finally, the number us dialed via a Dial FB. The FB dials the number contained in the vector of registers starting with MI 1 vector. us dialed via a Dial FB. The FB dials the number or of registers starting with MI 1001, Phone Number amiliar with the

Ladder

Initializing the COM port

The application is based on the Wavecom GSM modem. The Vision connection is via COM 2.

The net shown below is the first net of the main program module. initialized, SB 82 Modem Initialized: COM 2 turns ON; this condition activates the broutine, Enter Phone Number.

When COM 2 is on activates the

29

Vision OPLCs and Modems

Building the Cursor

The ASCII values for 'underscore' and 'blank space' are alternately stored into MI

1008 at .5 second intervals. The current value is copied into the Phone Entry vector starting at MI 1011, via a Vector: Fill Offset FB.

The offset value is provided by a counter that increments after every number entered. The offset values ensures that the cursor value is included as the last character in that vector.

Every time a value is entered, Vector: Transpose copies the low bytes of the Phone

Entry vector, which contains the ASCII values, to the Phone Number vector starting at MI 1001.

30

Dialing from the controller's keypad

Entering numbers: 'Convert' to ASCII

When a key is pressed, its value is automatically stored into SI 6. In this application, whenever keys 0 to 9 are pressed, the value stored in SI 6 is

'converted' to an ASCII value by adding the constant value 8. The ASCII value can then be displayed. For example, if Key#4 is pressed, the value in SI 6 will be 44

(HEX 2C). Adding 8 'converts' the value to 52 (HEX 34), which is the ASCII value for 4. 4 can then be displayed on the screen.

Note

8

MI 1010 is incremented whenever a legal value is entered. The incrementing value acts as a pointer, correctly placing entered numbers in the Phone Number vector.

31

Vision OPLCs and Modems

Placing entered numbers in the Phone Number vector

Using the incrementing value of MI 1010 as a pointer, the Fill Vector function places each 'converted' number into the correct register in the Phone Entry vector, starting at MI 1011.

Via the Transpose function, the low byte of each register in the Phone Entry is copied into the Phone Number vector as shown in the figure below.

32

Dialing from the controller's keypad

Dial and Hang-up

The Dial function is linked to the Phone Number vector starting with MI1001. This vector is also displayed on the controller's screen.

Note

8

Since the Enter key is pressed when the user has finished entering the number, SB

53 is used as one of the Dial conditions, as is SB 82 Modem Initialized.

SB 87 Modem connected is used to activate the Hangup function, and to display text on the controller screen.

HMI Display

This application contains 1 display with 3 variables.

Disconnected\Connected: Binary Text variable

33

Vision OPLCs and Modems

Show the phone number: Display ASCII String

This variable is refreshed in the Ladder via MB 1000 Display String on HMI.

Save, Dial, Hangup?

While the number is being entered, the text Save will be displayed. Once the number has been entered, the status of SB 87 Modem connected determines whether Dial or Hangup will be displayed.

34

Accessing a Networked PLC via PC

Use a PC to access controllers within a network either via a direct connection,

TCP/IP connection, GSM or landline modem.

Accessing a Networked Controller via Modem

Note

8

8

In order to ensure successful operations, it is recommended that you use an external PC modem. Internal modems may not support communications.

Both PC and controller must use the same type of modem: either landline or GSM. Internal PC modems must be used in conjunction with the driver provided by the modem's manufacturer.

Modems: Setting Up

PLC-Modem Connection

The Unitronics’ cable provided with modem kits does not provide a standard connection. This connection is adapted to support the fact that Unitronics controllers do not support the control lines. The cable shorts the DSR and the DTR together, which ensures that the terminal is always ready to receive data.

For more information, refer to the topic Modem Connection and Pinouts.

35

Vision OPLCs and Modems

PC Modem Configuration

Open PC Modem Configuration from the

Options menu

.

Note

8

If, within the modem initialization strings, the parameter S7 TimeOut, is to short to permit the PLC's modem to answer, an error will result.

36

ode and use Remote Access session to display the ur PC screen.

display the

To do this, click the Online T button

.

The controller model that is shown on the display is

Configuration. perate the controller keypad and activate touch dels).

te touch-screen

Use your PC keyboard to operate the controller keypad (numeric ke function keys <F1> to <F8>). Note that the Vision <ESC> key is <E> on the ne mode.

cursor.

37

COM Port/Modem Status, System Operands, & Error

Messages

You can check the status of the System Bits and Integers either via ON-line Test

Mode or Information Mode.

COM Port/Modem initialization, SBs 80-85

Each port is linked to 2 SBs indicating COM Port/Modem initialization status following COM Init.

Both SBs are initialized to OFF by the OS, at Power-up and at the beginning of COM Init process. When

COM Init is complete, one is ON, the other OFF.

#

Description

SB 80 Modem Initialized: COM Port 1

Example: COM Port 1

SB 80

SB

81

SB 82 Modem Initialized: COM Port 2

0 0

SB 84 Modem Initialized: COM Port 3

0

1

1

0

After Power-up, before COM Init

Modem Initialization attempt failed,

Modem is not initialized

Modem Initialization attempt succeeded, Modem is initialized.

SB 85

COM Port/Modem Initialization Failed:

COM Port 3

1 1

Not possible

Modem connection status, SB 86-88

Each port is linked to an SB indicating modem connection status. These can be used in conjunction with SBs 132-137, which indicate indicating whether incoming or outgoing data is flowing through the port, to troubleshoot problems as shown in the Help topic Modem Troubleshooting.

# Description

SB 86 Modem Connection Status: COM

Port 1

SB 87 Modem Connection Status: COM

Port 2

Turns ON when: Turns OFF when:

PLC receives

'Connect' string from modem

Hang-up

PLC receives string 'No

Carrier'

PLC receives break signal

Reset by:

OS, at

Power-up

SB 88 Modem Connection Status: COM

Port 3

COM Ports, SBs 132-137

Each port is linked to 2 SBs indicating when incoming or outgoing data is flowing through the port. To troubleshoot problems, use these in conjunction with the Modem Connection Status SBs 86-88, as shown in the topic Modem Troubleshooting.

# Description Turns ON when: Turns OFF when:

SB 132 COM Port 1, Data Transmission During data send When data is not being sent

SB 133 COM Port 2, Data Transmission

Reset by:

OS

SB 134 COM Port 3, Data Transmission

SB 135 COM Port 1, Data Receive During data reception

SB 136 COM Port 2, Data Receive

When data is not being received

OS

39

Vision OPLCs and Modems

SB 137 COM Port 3, Data Receive

SMS message transmission status, SBs 184-185

Operands that are linked by the user to SMS FBs may be found in the topic SMS Operands.

SB Description Turns ON when: Turns OFF when:

184 SMS: Transmission Succeeded Transmission succeeds Transmission begins

185 SMS: Transmission Failed Transmission fails

COM Port: Port/Modem Status, Error codes, SIs 80-85

Transmission begins

Each COM Port is linked to 2 SIs; their values and messages are indicated below.

SI 80 Modem Status:

COM 1

Error (SI 81,83,85,) Status ( SI 80, 82, 84)

SI 81 Error Code: COM

1

SI 82 Modem Status:

COM 2

Value

0

Message

No error

Value

0

Message

Modem Idle

1 TimeOut exceeded: no reply 1 Initialization in

Progress

SI 83 Error Code: COM

2

SI 84 Modem Status:

COM 3

SI 85 Error Code: COM

3

2

3

Reply Error

Wrong PIN number

2

3

Initialization OK

Initialization Failed

4 Registration failed 4 Modem Connected

5 PUK number needed 5 Hang-up in progress

10

11

12

15

COM Busy

Reply Busy

6 Dial in progress

Reply No Dial

Attempted Initialization during active break signal. Note that a port

cannot

be initialized while the break signal is active

16

17

18

19

20

Error in reply to PIN number

Check: CREG failed

Check: CREG timeout

Check: slots timeout

Check: Format timeout

40

COM Port/Modem Status, System Operands, & Error Messages

GSM Cellular Modem, GSM Signal Quality, SI 185

SI Description

185 GSM Signal Quality

Value

The value is written during COM Init of the GSM modem. The value is updated whenever the user uses the GSM Signal

Quality FB.

A value of -1(FFFF)signifies a modem error. This may be due to a weak signal; try repositioning the antenna. If this has no effect, check the modem.

SDW: Last Received SMS

SDW Description

13 Phone number of last received SMS (last 9 digits)

Information on SMS messaging status and messages may be found in the topic SMS

Operands.

41

Modem Troubleshooting

Note that Vision PLCs have a built-in communications 'sniffer'. This is accessible in

Information Mode, under System.

Touch screen models: select Serial or Ethernet, then click Monitor. Note the button that allows you to toggle between Hex and ASCII.

Non-touch screen models: Select Communication, then select Serial or Ethernet>

COM Buffer. Use F2 to toggle between Hex and ASCII. In addition, press Enter, and then the Down key to toggle between Tx and Rx.

Modem Commands

Note

8

+++

AT

AT&F

ATZ

The modem must reply with either OK or READY to each command entered. If the modem fails to answer, the command has not been processed.

Escape Sequence. This causes the modem to close connections and go back to command mode

This command means Attention; and is used to begin a session

Restores factory default settings

Resets the modem. This command may take time to implement, so the response from the modem may be delayed

V1 Enable Verbose (long) response

Q0 Respond

&S1

&C1

ATS0=1

&W

Since the DSR can be permanently set to ON, connecting it to the RTS causes the terminal always be ready to transmit\receive data

DSR OFF in command and test modes

Give the user a signal for the DCD

Auto-Answer after 1 ring

Burn the configuration into the modem’s non-volatile memory

PC-side modem, error messages

This deals with errors that may result from the PC's modem

Message Cause

COM Port not open, or modem does not exist

The PC was unable to access the PC port.

The port may:

-Already be in use.

-Be damaged.

Modem not connected

Modem not initialized

The PC receives no reply from the modem following the 'AT' command.

Check that:

-The modem is connected to the same PC port you have defined in PCmodem Configuration.

-The PC-modem cable is in proper order.

The modem was not successfully initialized, or

The modem answered, but did not approve all strings.

43

Vision OPLCs and Modems

Check the topic: Using Hyperterminal for Modem Troubleshooting

The messages below describe the modem 's status if the PC dial attempt (ATD+ number) fails. Any one of these errors aborts the Dial process.

Modem Busy

Modem Error

No Dial Tone

No Carrier

Note

8

This can occur if, within the modem initialization strings, the parameter

S7 TimeOut, is to short to permit the PLC's modem to answer.

For example, if this parameter is set as S7=30, the PC modem will wait for 3 seconds to receive an answer from the PLC's modem. If, however, the PLC program's COM Init FB Answer Settings are set to 'Answer after 6 rings,' the

PLC modem will not be able to answer before the 3 seconds have elapsed. In this case, the TimeOut parameter is exceeded, and the PC modem will return the No Carrier error.

Dial time-out exceeded

No reply was received from the modem within the defined time.

The messages below only relate to unsuccessful GSM modem initialization.

GSM SIM card blocked

GSM SIM card does not exist

Illegal GSM PIN code

GSM Network not found

CDMA Network not found

SMS message too long

Time-out exceeded

A message containing only English characters may contain up to 160 characters.

A message containing non-English characters may contain up to 70 characters.

PLC modems

These errors may result from problems in the PLC-side modem

Message Possible cause Recommended action

Modem Busy Modem is engaged, or is being initialized

Check that the line is free.

Use the

SBs: Modem Initialization Status

listed above to check the COM port status; communications cannot f low through the port during initialization. For more information check the topic COM Port Init.

Handshake between modems complete

('CONNECT'),

PLC does not reply

Modem adapter cable

Check the PLC-to-modem connection and pin-out, particularly that the DSR is connected to the RTS on the modem side.

Problem SI Value (80,

82, 84)

Possible Cause & Recommended Action

44

Modem Troubleshooting

Modem fails to initialize

(SB 81, 83, 85 ON)

3 PLC-to-modem cable:

Make sure that the cable is securely connected. Check the modem connection and pin-out of the PLC-tomodem adapter cables. Note that if you use cables comprising this pin-out, you must set the parameter

Flow Control to N (none) in the COM Port Init FB.

Incompatible communication settings.

Most modems automatically match the parameters of incoming data: baud rate, data bits, parity & stop bits.

You may need to manually change your modem's communication settings.

0 You may have selected the wrong type of modem in the

COM Port Init FB.

A complete list of error messages for SI 80, 92, 84, as well as other System Operands containing modem error is given in the topic COM Port/Modem Status, System Operands, & Error Messages.

Modem Connection

Cable Pin-out

The Unitronics’ cable provided with modem kits does not provide a standard connection. This connection is adapted to support the fact that Unitronics controllers do not support the control lines. The cable shorts the DSR and the DTR together, which ensures that the terminal is always ready to receive data.

For more information, refer to the topic Modem Connection and Pinouts.

Data Flow Direction

Generally, when you transmit data, you send it out. Note, however, that transmitted data (TXD) is input to the DCE. A Receive Data signal (RXD) is input to the DTE, but output from the DCE.

Therefore, the RXD and TXD signals are crossed within the majority of modems.

This means that a straight through "one to one" cable is generally all that is necessary between a modem and a controller or PC serial port.

RS-232 signal information

RXD

Receive Data

TXD

Transmit Data

GND

Signal Ground

RTS

Request To Send

CTS

Clear To Send

DTR

Data Terminal

Read

DSR

Data Set Ready

Input for DTE devices (Receive), output for DCE devices. This is the data channel from the DCE device to the DTE device.

Output for DTE devices (Send), input for DCE devices. This is the data channel from the DTE device to the DCE device.

Signal return for all signal lines.

Terminal is ready to receive data. When the DTE is ready to receive data, the

DTE serial port RTS signal is ON.

Terminal is ready --not related to data transfer.

It is an output for DTE devices and an input for DCE devices. This signal is typically used to show that the port has been activated or "opened".

Detects if the RS232 is actually connected.

45

Vision OPLCs and Modems

Turns ON when the modems connect. DCD

Data Carrier

Detect

RING Turns ON when someone is calling the DTE.

GSM modems

Problem

Wrong PIN number

Failed Registration

PUK number needed

SI Value (81, 83,

85)

Possible Cause & Recommended Action

3 Check the PIN number in the COM Port Init FB; leave it empty if your SIM card has no PIN number.

4

5

GSM modem did not register successfully, for example if no network was found, or if the modem antenna is not functioning.

The SIM card is locked due to too many attempts to enter an incorrect PIN number.

Problem

Cell phone does not receive message

Possible Cause & Recommended Action

Check the cell phone's SIM card; it may be full. You can clear the SIM card using the Clear option in the COM Port Init FB.

PLC modem does not respond to cell phone call

GSM modems generally recognize whether the incoming call is voice or data. If the modem has been set to answer (via the ATS0=x command, where x is set to a value greater than 0), the modem will not answer an incoming cell phone call, since it will be recognized as a voice message.

Note

8

The appropriate Modem:

Initialized SBs [80 (COM 1), SB

82 (COM 2), SB 84 (COM 3)] must turn ON before activating an SMS Config FB using that

COM port; ideally the SBs should be used as an activating condition.

Changing Baud Rate

Note that baud rates for PC and PLC modems can be edited during the Prepare

Modem process.

Modem Troubleshooting Table

Note that in many cases, checking System Operand status can help you in the troubleshooting process.

Problem Possible cause Recommended Action

PLC stays connected when

A modem which is reset, or to which the power supply

Modem Connection and COM Port Transmit/Receive

SBs can be used in conjunction with a timer to

46

Modem Troubleshooting

modem connection fails

VisiLogic is not able to communicate with the PLC:

PLC has initialized a modem. The modem is disconnected, and a PC is plugged into the

COM port. is interrupted, may lose the connection and may not send a 'No Carrier string to the PLC.

In this case, the SB remains ON, as though the data link still exists.

(Note that Modem

Connected SBs, 86-88, turn

ON when the relevant COM port receives the 'Connect' modem string. Receiving a

'No Carrier' string causes the SB to turn OFF.) check if the line is inactive; the timer state is used to trigger Hang-up as shown below.

Once the modem is connected to the PLC, and the modem is initialized, the Modem Initialized SB turns ON.

As long as this SB is ON, the COM port stays initialized to the baud rate required in order to work with the modem. If

VisiLogic attempts to access the PLC via a different baud rate, the attempt will fail.

The Synchronization process (using break signals) is disabled while the SB is ON.

Either:

Reset the PLC, which will reset the Modem

Initialized SB,

-or-

Via Vision Communication PC Settings, set

VisiLogic's baud rate to match the baud rate to which the COM port was initialized to communication with the modem.

47

Using Hyperterminal to check PC-PLC direct communications

If the PC port is defective or in use by another application, you may be unable to access a directly connected controller with your PC.

Via Hyperterminal, you can check the PLC-PC communication connection by sending a simple text command, Get ID. If the connection is in order, the controller replies with its ID; if the connection is faulty, the controller will not reply.

1.

Open Hyperterminal.

2.

Enter a name for the new connection and select an icon, and then click OK.

The Connect To box opens.

3.

Select the PC COM port that connects the PC to the controller, and then click

OK.

49

Vision OPLCs and Modems

4.

The Port Settings box opens as shown below. To enable your PC to communicate with the modem, set the COM port parameters to a BPS of either 9600 or 19200, Data bits=8, Parity=N, Stop bits=1, Flow control=None, and then click OK.

5.

Open the Properties box by clicking on the Properties button, then open ASCII

Setup.

6.

Select the options shown below, and then click OK.

50

Using Hyperterminal to check PC-PLC direct communications

7.

To synchronize the controller's communication settings, enter Info mode.

Navigate to System>RS232>Restore Defaults, and then press the Enter key.

8.

Open Notepad, enter the text

/00IDED

, press Enter, and save the file. This is the Get ID command, where 00 is the 'placeholder' for the controller's Unit

ID number. 00 enables any directly controller to answer, no matter what it's actual ID number is. ED is the command's checksum.

Note

8

Pressing Enter places a Carriage Return command at the end of the text.

Although the Carriage Return is not visible, the command will not be processed without it.

.

9.

Select Send Text file from the Transfer menu, and open the text file

51

Vision OPLCs and Modems

10.If you have configured everything according to the instructions above, and the port is functioning properly, the controller with its ID number. If the port is out of order, the controller will not reply.

In the figure above, the characters in the string that is returned by the controller,

/A00IDR1 B30000E5 may be interpreted as follows:

E5 CR (ETX) A model)

Answer Requested number

M90-R1 OS V3.00 (00) Checksum Not visible

52

RXD

Receive Data

TXD

Transmit Data

GND

Signal Ground

RTS

Request To Send

CTS

Clear To Send

DTR

Data Terminal

Read

DSR

Data Set Ready

DCD

Data Carrier

Detect

RING

Using Hyperterminal for COM Troubleshooting

You can use a standard Windows application called Hyperterminal to perform certain tasks, such as changing a modem’s communication rate.

Note

8

The modem driver does not need to be installed in order to access the modem via

Hyperterminal.

Modem Connections

Cable Pin-out

The Unitronics’ cable provided with modem kits does not provide a standard connection. This connection is adapted to support the fact that Unitronics controllers do not support the control lines. The cable shorts the DSR and the DTR together, which ensures that the terminal is always ready to receive data.

For more information, refer to the topic Modem Connection and Pinouts.

Data Flow Direction

Generally, when you transmit data, you send it out. Note, however, that transmitted data (TXD) is input to the DCE. A Receive Data signal (RXD) is input to the DTE, but output from the DCE.

Therefore, the RXD and TXD signals are crossed within the majority of modems.

This means that a straight through "one to one" cable is generally all that is necessary between a modem and a controller or PC serial port.

RS-232 signal information

Input for DTE devices (Receive), output for DCE devices. This is the data channel from the DCE device to the DTE device.

Output for DTE devices (Send), input for DCE devices. This is the data channel from the DTE device to the DCE device.

Signal return for all signal lines.

Terminal is ready to receive data. When the DTE is ready to receive data, the

DTE serial port RTS signal is ON.

Terminal is ready --not related to data transfer.

It is an output for DTE devices and an input for DCE devices. This signal is typically used in UNIX to show that the port has been activated or "opened".

Detects if the RS232 is actually connected.

Turns ON when the modems connect.

Turns ON when someone is calling the DTE.

Using Hyperterminal

1.

Open Hyperterminal. The program can generally be located by clicking the

Start button in the lower left corner of your screen, then selecting

53

Vision OPLCs and Modems

Programs>Accessories>Communications>Hyperterminal. The New

Connection window opens as shown below.

Note

8

Hyperterminal generally starts by pointing to the internal modem, if one is installed on the PC.

2.

Enter a name for the new connection and select an icon, and then click OK.

The Connect To box opens.

3.

Select a COM port for the modem, and then click OK.

4.

The Port Settings box opens as shown below. To enable your PC to communicate with the modem, set the COM port parameters to a BPS of either 9600 or 19200, Data bits=8, Parity=N, Stop bits=1, Flow control=None, and then click OK.

54

Using Hyperterminal for COM Troubleshooting

5.

Open the modem’s Properties box by clicking on the Properties button, then open ASCII Setup.

6.

Select the options shown below, and then click OK.

55

Vision OPLCs and Modems

Hyperterminal is now connected to your PC via COM 1; the ASCII settings now enable you to enter commands via the PC keyboard and see the replies from the modem within the Hyperterminal window.

To test the connection, type AT; if the connection is valid the modem will respond

'OK'.

Typical initialization strings used with a Siemens M20-type modem are shown below.

Modem Commands

Note

8

The modem must reply with either OK or READY to each command entered. If the modem fails to answer, the command has not been processed.

+++

AT

AT&F

ATZ

Escape Sequence. This causes the modem to close connections and go back to command mode

This command means Attention; and is used to begin a session

Restores factory default settings

Resets the modem. This command may take time to implement, so the response from the modem may be delayed

V1 Enable Verbose (long) response

Q0 Respond always

Since the DSR can be permanently set to ON, connecting it to the RTS causes the terminal always be ready to transmit\receive data

&S1

&C1

DSR OFF in command and test modes

Give the user a signal for the DCD

ATS0=1

&W

Auto-Answer after 1 ring

Burn the configuration into the modem’s non-volatile memory

56

Once the modem is successfully initialized, you can use Hyperterminal to initialize the modem to SMS mode. sfully initialized, you can use Hyperterminal to initialize

Notes Command Description

at+cpin=? at+pin=”xxxx” xxxx at+creg? application? registered with the local cellular provider? th the local cellular

+CREG: 0,1 with its local provider.

+CREG: 0,5

The SIM is in

roaming

mode. at+cmgf=1

Notes

8

8

8

8

Commands including question marks are run for verification

ce

. If the command is not verified during the second attemp ken out of the to be entered.

the SIM must be taken out of the modem and installed nable the SIM to be cleared.

em and installed

The modem must be able to support Text mode. P.D.U. mode is not supported.

It uses the Send command, containing the number to be called: AT+CMGS=

”phone number”.

When the '>' is received, the controller sends the message, ending the line with CTRL_Z

57

Vision OPLCs and Modems

If the message is successfully sent, the controller will receive a message of confirmation,+CMGS:xx. by OK.

If : the message of confirmation is not received within 15 seconds, or

Note

8

It receives the command: +CMTI: “SM” ,xx. controller's memory, 1 to 20.

r in the s received, the controller asks the modem for the text via

MGR=xx em for the text via

The modem replies with +CMGR, including th and concluding with OK.

er, status, text, has been successfully initialized, the relevant bit turns

3 or 84.

If initialization fails, SB 81, 83, 85, or 87 will turn ON.

elevant bit turns

The instructions below show you how to constru ns 'Sniffer'. This trings flowing ode reader.

‘Sniffer’ is connected to the external device.

‘COM’ is connected the PLC.

The completed Sniffer is connected to a PLC communication port, PC and external device.

Note that communication cables are the programming cable provided by

Unitronics.

An adapter.

58

1.

Open the adapter carefully via the 4 snaps in its sides.

2.

Cut the red and green wires as shown below. ires as shown

3.

red wire, and wire.

The soldered point provides the anode.

4. Put isolating material on the soldered points. the soldered

59

Vision OPLCs and Modems

5. Solder both diodes’ cathodes to the red wire.

6. Put isolating material on the solder.

7.

Close the Sniffer.

8.

Label the connectors as shown.

Note

8

In order to run view the strings in Hyperterminal, you must set the program to display

ASCII strings as described above in Using Hyperterminal.

60

GPRS

GPRS is a wireless data transmission service offered by some cellular providers. When a Unitronics' PLC is connected to a GPRS modem, the PLC can establish a data connection with a remote PC connected to the Internet and transmit IP packets of data over the GPRS cellular network.

You can then use your PC to access the PLC via VisiLogic, Remote Access or other communication .dll, as well as log PLC data via the DataXport utility.

The figure below shows GPRS communication elements.

Notes

8

8

8

8

8

8

The PLC must be connected to a GPRS modem. GPRS service must be supplied by the user's cellular service provider.

To enable any GPRS operations to run, the PLC application must include

GPRS Configuration and GPRS Run FBs.

You must prepare both the PLC and PC side modems by carrying out the Prepare PLC-side Modem procedure detailed in the topic PLC-side modems, and the Initialize PC Modem detailed in the topic PC-side modems.

The PLC must initiate the GPRS data link by calling the PC.

A sample application showing how to establish PC-PLC communications is available for both Sony Ericsson and Wavecom modems. This application is intended to be used as a template, for you to simply copy and adapt to your own requirements. Sample applications are located under Help>Examples.

Wavecom modems do not support the End Call function. In order to end a call, use the Unregister from Network function, and then reregister if required.

The Sony Ericsson GT47 GPRS modem must be used in conjunction with an appropriate cable and 5 pin connector.

Not supported by the V120-12 series.

1

GPRS

Using GPRS

The PLC's Ladder application must contain the conditions and elements shown below.

FB Name Purpose

COM Port Init FB

GPRS Configuration

GPRS

Register to Network

Configure this FB to initialize the PLC COM Port connected to the GPRSmodem. Within the COM Init FB, select the GSM modem type, and then the actual GPRS modem type, such as the Sony Ericsson GT47.

COM Port Init

is usually a Power-up task.

Note

8 To learn how to prepare the modem for PLC use, check the topic PLCside Modems.

The Configuration is linked to the serial port initialized via the COM Port

Init FB.

Note

8 The activating conditions should include the appropriate Modem

Initialized SB for the COM Port.

Register must follow the GPRS Configuration. Connect provides the parameters that enable the PLC to connect to the Internet via the cellular network.

GPRS Run

This element enables data communications via GPRS.

Note

8 The activating conditions should include the appropriate Modem Initialized

SB for the COM Port.

2

GPRS

Downloading OS via GPRS

Enhanced Vision controllers using Boot 2.00 and higher support OS download via GPRS modem.

Notes

8

The TC65 does not support OS download.

The modem must be connected to COM2.

Once the download begins, the controller enters Boot mode. Any interruption in communication may result in the controller being 'stuck' in boot mode, without an installed OS. For this reason,

it is it is recommended that someone be next to the PLC during the OS download in order to attend to any potential problems.

FB Operations

GPRS Operations are located on the FBs menu.

G P R S C o n f i g u r a t i o n

G P R S R e g i s t e r t o N e t w o r k

G P R S R u n

S t a r t C a l l

L i s t e n / S t o p L i s t e n i n g R e m o t e D e v i c e

U n r e g i s t e r ( D i s c o n n e c t ) f r o m N e t w o r k

C h e c k S i g n a l Q u a l i t y

G P R S O p e r a n d s & S t a t u s M e s s a g e s

Examples

Sample applications may be found in the VisiLogic Examples folder. This folder contains field-tested VisiLogic (.vlp) sample applications. You can open this folder via the Help Menu.

The folder is typically located at:

C:\ProgramFiles\Unitronics\VisiLogic\Examples\Verx.xx, where x.xx indicates the version of VisiLogic.

3

GPRS Configuration

The GPRS Configuration must be included in all GPRS Ladder applications.

The Configuration is linked to the serial port connected to the GPRS modem and initialized via the COM Port Init FB.

Note

8

The activating conditions should include the appropriate Modem

Initialized SB for the COM Port.

Parameter Type Function

Name

Status

Messages

The name of the Configuration.

Port Number Constant Click the drop-down arrows to view available ports; click the port you want to use.

MI The value of the linked MI indicates GPRS status messages.

Call Status MB This bit turns ON when the remote device has been accessed and the

GPRS connection is established.

5

GPRS Register to Network

This FB provides the parameters that enable the PLC to connect to the Internet via the GPRS cellular network.

Parameter Type Function

Name

Registration

Status

IP Address

APN Server

Dial Number

(optional)

User Name

(optional)

Password

(optional)

MB

MI

Select the name of the GPRS Configuration that Connect will use to connect to the GPRS network.

Turns ON when the PLC is assigned an IP address and registered by the GPRS network.

When the PLC registers on the GPRS network, it is assigned a dynamic IP address.

This is the start of a vector that contains the IP address that is assigned to the modem when the modem registers with the

GPRS network. The vector is 4 MIs long. The low byte of each MI provides the number for an octet within the IP address.

If, for example, the IP address is linked to MI 0, and the low bytes of MI 0 to

MI 3 contain the values 192, 198, 192, 45, the IP address will be

192.198.192. 45.

Constant or

MI

The name of the APN (Access Point Name) Server given by your

GPRS service provider.

Constant or

MI

These parameters are required by some GPRS service providers and GPRS modem manufacturers.

Constant or

MI

Constant or

MI

7

GPRS Run

This element enables data communications via GPRS and must be included in all GPRS applications.

The activating conditions should include the appropriate Modem

Initialized SB for the COM Port.

9

Start Call, End Call

Start Call

This FB provides the Port and IP address of the remote device, enabling the

PLC to call the remote device and establish a data communications link.

Parameter Type Function

Name

Remote

TCP/IP Port

Select the name of the GPRS Configuration that Connect will use to connect to the GPRS network.

Constant or

MI

The access port of the remote device.

IP Address Constant or

MI

The address of the remote device.

End Call

This FB ends the current data communications sessions with a remote device, but does not terminate the connection to the GPRS network.

Note

8

Wavecom modems do not support the End Call function. In order to end a call, use the Unregister from Network FB, and then re-register to the network if required.

11

Listen to Remote Device, Stop Listening to Remote

Device

Listen

This FB provides the Port and IP address of the remote device, enabling the

PLC to call the remote device and establish a data communications link.

Parameter Type Function

Name Select the name of the GPRS Configuration that Connect will use to connect to the GPRS network.

Remote

TCP/IP Port

Constant or

MI

The port the PLC uses to listen to the remote device.

Stop Listening

This FB ends the current data communications sessions with a remote device, but does not terminate the connection to the GPRS network.

Parameter Type Function

Name Select the name of the GPRS Configuration that Connect will use to connect to the GPRS network.

Note

8

Wavecom modems do not support the End Call function. In order to end a call, use the Unregister from Network FB, and then re-register to the network if required.

13

Unregister from Network

Use this to disconnect the PLC from the GPRS network, including a delay of a second or two to allow the socket time to close when de-registering.

15

Check Signal Quality

The signal quality value is placed in SI 185 GSM Signal Quality.

A value of -1(FFFF)signifies a modem error. This may be due to a weak signal; try repositioning the antenna. If this has no effect, check the modem.

17

GPRS Operands & Status Messages

Operands linked to GPRS FBs should be assigned Power-up Values; bits should be reset, and registers initialized to 0.

GPRS: Configuration FB

Call Status GPRS MB Turns ON when:

Call successfully made

Turns OFF when

Call is terminated

Status Messages

Initialized to 0 when

GPRS: Configuration

is activated.

MI

Value Message

23

24

30

31

40

0

1

2

3

16

20

21

22

No message

GPRS network registration is in progress

Registration Complete: the modem successfully registered with and received an IP address from the

GPRS network

Connected to GPRS network

4

5

Listen Mode: Initialization Begins

Listen Mode: Initialized

6 Listen Mode: Initialization Re-started

10 Start Begins

11 Start Complete

15 End call: Begins

End call: Complete

Unregistration Begins (Not during Call)

Unregistration Begins (During Call)

Unregistration Complete: the modem has successfully disconnected from the GPRS network

50

51

Listen Mode: Close process begins

Listen Mode: Closed

Check Signal Quality: Start

Check Signal Quality: End

Command not supported (When End Call is activated in an application using a Wavecom modem)

Modem reply error

Modem Timeout error

19

GPRS

GPRS: Register to Network

Registration Status MB Turns ON when: Turns OFF when

IP Address

The modem successfully registers with and received an

IP address from the GPRS network

The modem disconnects from the network

MI

This is the start of a vector that contains the IP address that is assigned to the modem when the modem registers with the GPRS network. The vector is 4 MIs long. The low byte of each MI provides the number for an octet within the IP address.

If, for example, the IP address is linked to MI 0, and the low bytes of MI 0 to MI

3 contain the values 192, 198, 192, 45, the IP address will be 192.198.192. 45.

GPRS System Operands

SI Description Value

185 GSM Signal Quality

The value is written during COM Init of the GSM modem. The value is updated whenever the user uses the GSM Signal Quality FB.

A value of -1 (FFFF)signifies a modem error. This may be due to a weak signal; try repositioning the antenna. If this has no effect, check the modem.

SBs 120-125 register the signals that each port receives from the DTR and DSR pins of a serial communication cable.

The DTR SBs 120, 122, and 124 are also used by the OS to control the DTR signal during RS485 serial communications, and during GPRS communications using the Sony Ericsson GPRS modem.

Reset by: SB# Description

SB100 GPRS modem connected

Turns ON when:

Call Remote device begins

GPRS incoming call is answered

SB 120 DTR COM Port 1

(signal output from

PLC)

DTR signal present

Turns OFF when:

End Session succeeds

Disconnect from

Network succeeds

DTR signal absent

OS

OS, may also be reset by user

DSR signal absent OS SB 121 DSR COM Port 1

(signal input to

PLC)

DSR signal present

SB 122 DTR COM Port 2

(signal output from

PLC)

DTR signal present

SB 123 DSR COM Port 2

(signal input to

PLC)

DSR signal present

SB 124 DTR COM Port 3

(signal output from

PLC)

DTR signal present

SB 125 DSR COM Port 3

(signal input to

PLC)

DSR signal present

DTR signal absent

DSR signal absent

DTR signal absent

DSR signal absent

OS, may also be reset by user

OS

OS, may also be reset by user

OS

20

Check Signal Quality

21

Using SMS Messaging

To enable a controller to use SMS messaging, connect it to a modem that supports connection to a cellular network with SMS messaging service.

SMS messaging operations are located on the FBs menu.

To send or receive SMS messages:

1.

Initialize one of the controller's communications ports using a COM Init

FB.

Note

8

Communications cannot flow through the port during initialization. To avoid conflicts in your program, use the Modem Init ialization Status SBs.

8

Before using a modem, prepare it as described in the help topic PLCside Modems.

2.

Place an SMS Configuration FB into your application. Link it to the port initialized via the COM Init FB. The SMS Configuration will use this port to receive and send messages.

The SMS Configuration contains a list of SMS messages and phone numbers.

Note

8

COM Init and SMS Configuration must appear in the application and be activated

before

any SMS operations are activated. If this is not done, the application will not work.

To enable the controller to receive messages, place an SMS Scan FB in your application and link it to a Configuration. When activated, this causes the controller to scan the GSM modem's SIM card for incoming SMS messages

To enable the controller to send SMS messages, place an SMS Send FB in your application and link it to a Configuration. You can then either send one of the messages in that Configuration or create one for that specific Send FB.

In either case, the port defined in the Configuration will be used to send the message.

FB Operations

S M S : C o n f i g u r a t i o n

S M S : S c a n

S M S : S e n d

S M S : C h e c k G S M S i g n a l Q u a l i t y

How to Configure, Receive, and Send Messages

1.

Initialize a COM Port. The initialization status of each port is indicated in

Modem Initialization Status SBs. These SBs can be used to activate an

SMS configuration.

1

SMS Messaging

2.

Select SMS Configuration from the FBs menu and place the function in your application.

Note

8

8

The condition that activates the SMS Configuration must turn ON for a single program scan (positive transition recommended).

Once an SMS Configuration is activated, it can process SMS messages.

However, messages are sent or received

only

when the MB linked to

Modem Busy (GSM) is

OFF

.

This MB turns ON when the modem is processing a message, or is communicating data to another application such as VisiLogic.

8

The appropriate Modem: Initialized SBs [80 (COM 1), SB 82 (COM 2),

SB 84 (COM 3)] must turn ON before activating an SMS Configuration using that COM port; the SBs should be used as an activating condition.

3.

The SMS configuration must be scanned during every program cycle-after the Configuration is activated. One way to ensure this is by placing the configuration in the first subroutine of the main module.

To receive messages, place a Scan FB in your application.

Note

8

An SMS Scan generally uses a direct contact as an activating condition. This enables the configuration to continually 'listen' for incoming messages. When the controller registers that a Scan has been activated, the MB linked to Modem Busy (GSM) turns ON, turning OFF only after the Scan is complete.

2

Using SMS Messaging

4.

You can also write incoming messages to an operand vector, including messages that are not in the Configuration.

1.

Turn SB 199.

2.

Enter the Start of Vector address (MI) in SI 199. You can write to an XI vector by entering a negative value.

If SB 199 is ON, SB 198 will be SET when an SMS message is received, and the message will be stored in operand vector. The length of the message, in bytes, will be stored in SI 198.

To send messages, place a Send FB in your application.

Note

8

8

8

8

When the positive transition contact used to activate the Send FB rises, the MB linked to Modem Busy (GSM) turns ON.

The rest of the logic in the net is processed whether or not the Send operation is completed.

Operands linked to SMS FBs, such as Modem Busy (GSM), should be assigned Power-up Values; bits should be reset, and registers initialized to 0.

When an SMS message is sent, the Modem Busy (GSM) MB remains

ON until the message has cleared the SIM card.

Be careful when using positive transition contacts to activate a Send operation.

When a Send operation is in progress, the modem is busy. If another

Send operation is activated while the modem is busy, the second

Send operation will not be activated and the message will

not

be

3

SMS Messaging

sent--even after the modem is no longer busy.

Examples

Sample applications may be found in the VisiLogic Examples folder. This folder contains field-tested VisiLogic (.vlp) sample applications. You can open this folder via the Help Menu.

The folder is typically located at:

C:\ProgramFiles\Unitronics\VisiLogic\Examples\Verx.xx, where x.xx indicates the version of VisiLogic.

4

SMS: Configuration

An SMS Configuration contains a list of SMS messages with attached variables and a phone book that is unique to that configuration. SMS Configuration is also where you define Message Properties.

Note

8

The appropriate

Modem: Initialized SB

[80 (COM 1), SB 82

(COM 2), SB 84 (COM

3)] must turn ON before the application can activate an SMS

Config FB using that

COM port.

A Modem Initialized SB should be used as an activating condition.

Creating SMS Messages & Variables

A single SMS message can contain both fixed text and up to 10 variables. A message containing only English characters may contain up to 160 characters.

A message containing non-English characters may contain up to 70 characters.

Note

8

When you create messages in a Configuration, VisiLogic does not allow you to begin a message with a fixed text character that is not a numeral (0-9) or a number sign (#). These limitations do not apply to messages that you compose in an SMS Send FB, or to Indirect

Messages. These may begin with variables or with any alphanumeric character.

8

Although the PLC can send Binary Text, Numeric, and List of Texts variables, it can only receive

Numeric variables

..

5

SMS Messaging

Binary Variable plays different text in the SMS variable field according erand.

field according

Number Variable

in which that value is shown, including the placement and leading zeros.

the placement

Use Linearization to show a converted value, su temperature converted to degrees Celsius.

nalog

6

SMS: Configuration

List of Texts: by Pointer

This type of variable contains numbered lines of text. You link the Variable to an operand. The value within that operand 'points' to the number of a line within the list. When the operand value is equal to a particular line number, the text of that line is shown in the Display.

Message Properties

This defines how the PLC deals with a specific SMS message that is

received

by the system. Note that a SMS Scan FB must be placed in the Ladder to enable the PLC to check a specific SMS Configuration for received messages.

7

SMS Messaging

Phone Book

Click on a line to either:

Use a vector of registers to indirectly dial a number. Keypad Entry

Variables can then be linked to this vector, enabling a user to dial a s.

Indirect Vector

Each register byte contains 1 character. Note that the byte actually contains the

ASCII

value of the desired numeral. For example, the ASCII value of 1 is

049. ains 1 character. Note that the byte actually contains desired numeral. For example, the ASCII value of 1 is

8

SMS: Configuration

International Cell Phone Number Format

To work with international phone numbers, use the full GSM format, including the '+' in front of the country code.

Message Index Numbers

The messages in the Configuration are numbered consecutively.

Inserting and deleting messages causes the index numbers to increment and decrement.

If your application contains Send functions that send messages from the Configuration, you must edit the message index number accordingly.

Example

In the following figure, the Send function is set to send the message with Index # 2.

In the next figure, the user inserted a line, causing the index number to increment. However, the user did not edit the Send function, and message Index # is now blank.

9

SMS Messaging

10

The condition that activates the Configuration must be turn ON for a single e transition is recommended)

However, the SMS configuration must be scanned program cycle--after the Configuration is activated. ensure this is by placing the configuration in the first subroutine of the main module.

broutine of the

The net containing the configuration

must

:

Be in a subroutine that is called during ever application. will be activated once (SB82 rises), and then hat follows.

d then

included

Unlike the example above, this Configuration rises), and is then

not included

once (SB 82 s.

11

SMS: Scan

To enable the controller to receive messages, place an SMS Scan FB in your application and link it to a Configuration. When activated, this causes the controller to scan the GSM modem's SIM card for incoming SMS messages.

Before you can receive an SMS, you must initialize a COM port to use a GSM

modem, create an SMS Configuration, and set conditions as explained in Using

SMS Messaging.

Note

8

Communications cannot flow through the port during initialization. To avoid conflicts in your program, use the Modem Init ialization Status

SBs.

8

Although the PLC can send Binary Text, Numeric, and List of Texts variables, it can only receive

Numeric variables

.

8

Use an MB activated by the SMS Configuration FB to activate the

Scan, as shown in Using SMS Messaging

When the PLC receives a message, the Message Properties defined in the SMS configuration for that message define how it will be processed.

13

SMS Messaging

14

SMS: Send

To send an SMS, place an SMS Send operation in your Ladder application.

Before you can send an SMS, you must initialize a COM port to use a GSM

modem, create an SMS Configuration, and set conditions as explained in Using

SMS Messaging.

Note

8

Communications cannot flow through the port during initialization. To avoid conflicts in your program, use the Modem Initialization Status SBs.

8

8

Before using a modem, prepare it as described in the help topic PLCside Modems.

If the SMS Configuration is busy, messages cannot be received.

Avoid conflicts by using a negative contact, linked to the

Configuration's Modem is Busy MB, as an activating condition for

SMS: Send.

Note

8

8

You can send only one SMS message at a time, but you may send it to multiple phone numbers.

The Send Status MB turns on if there are more than one Send operations, and the PLC has not finished processing the first Send before the second Send is activated. In this case, Modem Busy MB of the

SMS: Configuration bit will be ON, causing the

Send Fail Bitmap to contain a value of -1.

15

SMS Messaging

Compose

Message

Opens a blank message field.

Create a message by typing characters and attaching variables.

Select from

Configurati on

Opens the list of messages contained in the linked Configuration.

To select a message to send, click it; the message will be highlighted.

Indirect

Message

Enables a vector of register values to be sent as ASCII characters.

Note

8

Each register byte contains one character.

Note

8

8

When you create messages in a Configuration, VisiLogic does not allow you to begin a message with a fixed text character that is not a numeral (0-9) or a number sign (#). These limitations do not apply to messages that you compose in an SMS Send FB, or to Indirect Messages. These may begin with variables or with any alphanumeric character.

A message containing only English characters may contain up to 160 characters.

A message containing non-English characters may contain up to 70

16

8

8

8

8

SMS: Send

characters.

Phone Indexes is based on the Phone Book in the linked SMS configuration.

Index numbers are 0 to 8, note that 0 is the index of the last number called.

SB 184 SMS: Transmission Succeeded and 185 SMS: Transmission Failed are both reset when any message is sent to any phone number. After the message has been processed, the Relevant SB will turn ON.

You can send messages in ASCII text format by turning ON SB 279: ASCII

Text message format,

If forced display messages are supported by the cell phone receiving the SMS, you can send a forced display message by turning ON SB 280: Force Message

Display on Cell Phone.

17

SMS Variables

Variables can be included in Configuration or Send FB messages. A sin message can contain both fixed text and up to 10 variables. Note that SMS d to HMI variables.

es. A single SMS ote that SMS can only receive end Binary Text, Numeric, and List of Texts variables, it

ric

variables. exts variables, it

Binary Variable field according e last value sent.

Numeric Variable

in which that value is shown, including the placement and leading zeros.

the placement o show a converted value, such as an analog rted to degrees Celsius.

nalog

19

SMS Messaging

List of Texts: by Pointer

This type of variable contains numbered lines of text. You link the Variable to an operand. The value within that operand 'points' to the number of a line within the list. When the operand value is equal to a particular line number, the text of that line is shown in the Display.

20

SMS: Check GSM Signal Quality

The signal quality may be checked at any point after SMS Configuration.

The signal quality value is placed in

SI 185 GSM Signal Quality

.

A value of -1(FFFF)signifies a modem error. This may be due to a weak signal; try repositioning the antenna. If this has no effect, check the modem.

21

Note

8

8

must:

Create and download a project to your PLC that includes an SMS

Configuration, set Message Properties, and define conditions as described in

Messaging.

SMS s as described in d messages that are already part of an SMS he PLC.

SMS thorized Phone Numbers option is selected in the SMS cell phone number must be in the list.

ted in the SMS sure that:

The fixed text in your cell phone is identical to the message in the PLC's SMS

Configuration

in every detail

are case-sensitive. r cell phone is identical to the message in the PLC's SMS

ry detail

: spaces, characters--and note in the PLC's SMS e that characters signs '#' do

not

values with number signs (#) as shown below. These nt as spaces.

n below. These the value.

The figure below shows the same SMS me display, and as it appears in the PLC's SMS Configuration.

n a cell phone age from your cell phone, the value 110 will be written

C.

0 will be written

1.

Enter the number of t

GSM cell phone number, then send the message.

would enter any

You can check if the PLC received your message by using the Acknowledge feature:

23

SMS Messaging

1.

Select 'Acknowledge' in

shown below.

in Message Properties, the

ACK

box is checked as

2.

Use your cell phone to send the message " to the PLC. to send the message "

Holding Temperature:#110#"

3.

The PLC receives this SMS message; AutoAcknowledge causes the PLC to immediately return the message to your cell phone, together with the current variable value. s SMS message; AutoAcknowledge causes the PLC to ssage to your cell phone, together with the current

4.

s SMS message on your cell phone display, together with ue.

play, together with

Note that although the PLC can send SMS messages that and List variables, the PLC can only receive Numeric variables.

e Numeric, Binary,

24

Index

B

Bridge ......................................... 37

C

CANbus ....................................... 37

COM port ..................................... 45

Communications ............. 9, 29, 41, 45

Initialize COM port ..................... 29

Modem ................. 9, 19, 29, 41, 55

Troubleshooting ......................... 41

Controller .................................... 37

Controller network ........................ 37

D

Dial ............................................ 31

Download via network ................... 37

E

Edit programs-via network ............ 37

Errors ......................................... 41

G

GSM ...................................... 19, 21

H

HMI ............................................ 31

M

Modem .................... 9, 15, 19, 45, 55

Modem Error Messages ................. 41

N

Network ...................................... 37

P

PC .............................................. 37

Phone book .................................... 5

Phone numbers .............................. 5

Programming cable ....................... 37

R

Remote Access ............................... 9

S

SMS ........................ 1, 13, 15, 21, 23

T

Troubleshooting ........... 41, 45, 55, 13

W

Wiring ......................................... 19

25

advertisement

Was this manual useful for you? Yes No
Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Related manuals

advertisement

Table of contents