GPRS (General Packet Radio Service)
See also: Networking and Communications
Topic Menu
GPRS Overview
Home > Program > GPRS > GPRS Configuration
GPRS network can be used to establish communication between OCS and any other communicating devices having unique IP address and port configuration.
GPRS can be used to establish connectivity with:
-
Remote server for exchanging register data.
-
Cscape for downloading / uploading and debugging the application using redirector software.
-
GSM network for sending / receiving configured SMS messages.
-
It can be used for peer to peer communication.
-
GPRS service must be enabled in SIM.
-
Static SIM with VPN functionality is required.
-
Auto dial blocks of modem are required on both server and client.
Return to the Top: GPRS (General Packet Radio Service)
GPRS Configuration
Horner OCS firmware is designed to initialize GSM modem to establish GPRS connectivity. This configuration needs to be done for connectivity with remote server as well as for connectivity with Cscape.
-
Open the GPRS Configuration by selecting Program > Messaging > GPRS from the Home Menu.
-
Select Enable GPRS Configuration check box.
-
Configure GPRS as per the information obtained by the Network Service Provider.
The following dialog will appear:
GPRS Access Point Configuration:
The GPRS Access Point Configuration is mandatory and the fields are to be filled according to the information obtained by the Network Service Provider.
GPRS Packet Assembler/Disassembler Configuration Configuration:
-
Client Mode: In this mode OCS behaves as client and connects to specified server (Server IP/Port address to be specified in modem ladder block input).
-
Server Mode: In this mode OCS behaves as server and accepts connection requests from specified client. Client IP address to be specified in modem ladder block input.
-
NOTE: For connectivity with Cscape, Server mode should be selected.For added security, IP address for Cscape connectivity can also be specified. Enter the IP address for CsCAN connectivity directly in CsCAN Source IP Addr or select Get Source IP Address from Register checkbox and specify a %R Retentive 16-bit registers. register Address (32bit).
-
NOTE: If the CsCAN Source IP Addr is 0.0.0.0, connection from any address will be accepted.
-
NOTE: Server mode of operation is supported only in case of SIM with static IP address.
-
-
CsCAN Source Port: When modem is configured in server mode, the incoming connection request from any client will be accepted only via this port address.
-
Block Size: GPRS packet size in number of bytes.
-
Timeout Period: Transmission of GPRS packet to destination address will take place either on reaching Packet Size (block size) or occurrence of timeout.
-
Forward Character: Transmission of GPRS packet will take place on reception of character configured in this window. This value to be entered is the Hex A base-16 numbering system which uses the symbols 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F for numeral. value of ASCII ASCII - American Standard Code for Information Interchange - ASCII-coded characters are single-byte values in the range of 0 (zero) to 127. Codes in the range 128 to 255 are not defined by the ASCII standard, but rather by the equipment manufacturer. character.
-
For example: If ’0D’ is configured, the GPRS packet is transmitted when Line Feed character is received.
-
-
Send Forward Character: If this checkbox is enabled, forward character will be sent together with GPRS packet.
Additional ladder program must be written to establish connection with remote server/client over GPRS service. On the device, change the default programming port to GSM from the system menu, serial port option.
i.e. OCS ’System Menu > Set Serial Ports > Dflt Pgm Port >GSM’ for MJ1.
Select default programming port as GPRS in OCS system menu option (Shown above).
Return to the Top: GPRS (General Packet Radio Service)
GPRS Communication Blocks
Open Port
For peer to peer communication over GSM/GPRS, communication blocks are required to be configured as follows: Project Toolbox > Serial Operations > Open Serial Port. Follow the above steps will create an Open Port, also called a Function Block. Drag it to the grid.
Double click function block, and the following dialog box appears:
In case of internal GSM modem, the mode should be specified GSM Quad. Follow the configuration shown above. The protocol can be selected from the drop down as CsCAN, Generic or Modbus. For Modbus, Slave or Master block should be used.
Return to the Top: GPRS (General Packet Radio Service)
Modem Control Block
NOTE: To use modem control block, the comm port must be opened first using Open Port block.
Auto Dial Modem Option for GPRS
Modem Control block with ’Auto Dial’ option is used to connect to remote server/client using GPRS service.
IP Address IP Address - Internet Protocol - This is the address of a device on an Ethernet or Wi-Fi network. Horner controllers currently use IPv4 standards with addresses consisting of 4 numbers, or octets, separated by decimal points. and Port number needs to be entered in edit box for ‘Number (IP / Port Address)’. A register reference can also be provided here. If register reference is used, the IP and port details need to be provided at the mentioned register location.
Support for IP and Port address entry in Binary format and automatic detection of Client or server mode based upon IP/Port address entry.
-
For entry in binary format, data should start with string “IPBN” followed by IP and Port address in binary format.
-
For entry in string format, data should end with a null termination Null Termination - To place a NULL character (character code 0) at the end of ASCII data. Some functions require NULL Termination to be able to determine the end point of the ASCII data since that data may vary in length from one time to the next. or space.
-
For automatic switching between client and server mode, if the port number is mentioned as 0, server mode connection would be made else client mode connection would be made.
EXAMPLE
If register reference %R100 is entered for IP/Port address.
Contents of %R100 in String Format:
Client Mode: %R100 = “10.111.64.2/10001” (Register %R100 to %R108 are used)
Server Mode: %R100 = “192.168.5.2” (Register %R100 to %R105 are used)
Contents of %R100 in Binary Format:
Client Mode:
%R100 = “IPBN”
%R102 = 10.111.64.2 (IP address in Binary Format)
%R104 = 10001 (Port address in Binary Format)
(Register R100 to R104 are used)
Server Mode:
%R100 = “IPBN”
%R102 = 192.168.5.2 (IP address in Binary Format)
%R104 = 0 (Zero, to indicate no Port Address)
(Register R100 to R104 are used)
Select type of protocol UDP UDP - User Datagram Protocol - An alternative communications protocol to Transmission Control Protocol (TCP) used primarily for establishing low-latency and loss-tolerating connections between applications on the internet. or TCP TCP - Transmission Control Protocol - A standard that defines how to establish and maintain a network conversation through which application programs can exchange data. over IP.
Configure the status register to show the status of the connection. The [status values] are mentioned below.
If modem ladder block input is enabled, then modem tries to establish connection with remote server in client mode or waits for connection request from client in server mode.
Project Toolbox > Serial Operations > Serial Modem Control
Double click on the function block, and the following dialog box appears:
Auto Answer Modem Option
Modem Control block with ’Auto Answer’ option is used for receiving connection request from remote server or device. Number of rings after which connection request is to be accepted is entered in text box provided. Configure the status register to show the status of the connection. See Modem Status Register Value Definitions
Initialize Modem Option
Modem Control block with ’Initialize Modem’ option is used for execution of modem specific AT commands. Modem specific AT command to be executed is to be entered in ’Init String’ text box provided in control. If AT command execution is successful, then Modem Control block output is enabled else the output is disabled. The status register is updated depending upon the response from modem. The response from modem is stored in consecutive register locations starting from ’status register+1’ address.
Example: Modem control block with ’Initialize Modem’ option is used to get balance left from service provider. The service provider balance request string is entered in ’Init String’ box together with CUSD AT command. As shown below in screen shot. The response from service provider is stored in consecutive register locations starting from ’Status Address + 1’.
NOTE: The command to be sent for balance enquiry is: +CUSD = 1,”*111#”,15 where ”*111#” is string to request left balance in SIM and may vary depending on the service provider.
Return to the Top: GPRS (General Packet Radio Service)
Modem Status Register Value Definitions
NOTE: At any given time, the modem can service only one of the modes i.e. connectivity with Cscape, data exchange or SMS.
-
SMS transmission and reception (whenever enabled) will be slow when modem is active.
-
Status of ’6’ indicates mode is waiting for connection request from specified client and it is applicable in case of GPRS server mode.
-
When modem returns status ’Connected’, then TX, RX or other communication ladder block can be used to exchange data with destination server according to protocol.
-
Disabling Modem Control ladder block input will disconnect GPRS service. Status register value changes to 65534 (0xFFFE i.e. indicates waiting for modem response for disconnect command) and then to 65535 (0xFFFF).
-
SMS functionality will work based upon Data Transmission SettingsSMS Communications window while GSM/GPRS connection is active.
-
Connecting to GPRS network and establishing connection with remote server might take around 3-4minutes.
-
Disconnecting connection with remote server might take 10-20 seconds.
-
If continuous error response is seen in status register or 0xFFFE response is seen while connecting to the modem as default programming port, then check:
-
SIM card is properly inserted in the modem.
-
SIM is enabled for given service (i.e. GPRS or GSM data call).
-
Antenna is connected properly.
-
GPRS configuration parameters in case of GPRS connection.
-
GSM Signal strength at given place.
-
Check VPN connectivity.
-
-
If Default programming port is switched to default serial port option (MJ1) from GSM/GPRS then port might get released after 20-30 sec (i.e. after complete GSM/GPRS connection drop).
Return to the Top: GPRS (General Packet Radio Service)