Modems

In order to carry out modem-based communication tasks in your program, configure the modem, place an Initialize Modem element in your Ladder application, and monitor the status of the modem using the members of the modem's struct.

Modems may be connected to the controller to the HMI panel's USB port via a USB to Serial Adapter.

Configuring a Modem

  1. Click Modems in the Solution Explorer.

  2. Click Add Modem.

  3. Click the fields to edit Modem parameters Modem Name, Type, and Signal Quality Refresh rate fields.

  4. Assign a Communication Channel.
    The parameter Port defines the communication channel between controller and modem. You can select a channel that is physically located on a communication module, or the Panel USB Port.

  5. To enable the modem to accept incoming SMS messages and add them to the SMS Received Queue, you must check the Receive SMS option.

  6. To filter the phone numbers from which incoming message may be received, click Authorized Numbers and add permissible phone numbers to the list.  

Checking SMS Received adds the message to the queue. However, the only way for the controller to receive the message is via the Receive SMS ladder function

 

When you add the modem, the program creates a struct that you can use in your program.

Name

Data Type

Definition

Success

Bit

ON=Modem Initialized Successfully

Fail

Bit

ON=Modem Initialization Failed

Status

UINT32

Code

 Message

0 = No Errors

1 = Function Started

2 = Function in Progress

-1 = General initialization error

-2 = Pin code Error

-3 = Baud Rate Error

-4 = Signal Quality Error

-5 = Router name error

-6 = Save router parameter error

-7 = Modem GPRS error

-9 = Router General Error

-10 = Router signal quality error

-11 = Router session ID error

-12 = Router network type error

-13 = Router GPS error

-14 = Router mobile traffic error

-17 = Router Model Name error

-99 = Modem/Router not connected

-100 = Modem/Router powered off                   

Signal Quality

UINT8

Written here by the controller

Modem Name

ASCII

Entered by user when defining the modem.

PIN Code

ASCII

Entered by user when defining the modem.

GPRS APN

ASCII

Entered by user when defining the modem.

GPRS User

ASCII

Entered by user when defining the modem.

GPRS Password

ASCII

Entered by user when defining the modem.

GPRS IP

ASCII

Entered by user when defining the modem.

SMS Received Queue

UINT8

 

This is the number of SMS messages that are in the modem queue, that have not been transferrer to the controller.
Note that the only way for the controller to accept the message is via the Receive SMS ladder function.

 

 

Related Topics

Initialize Modem

Configuring a Router

SMS: Creating Messages

SMS: Sending via Ladder

LF: Receive SMS

LF: Initialize Router Modem

Buffers

Parse