Promotic
WikipediaLinkedInYoutubeTwitterFacebook

PmModem - Deatiled object description

See: Object PmModem
 
Data transfer is carried out in close action with the PmComm object and then for understanding the PmModem object, a knowledge of the PmComm object is required. There must be set the Serial port configurator to "Modem" in the PmComm object.
 
Basic properties of the PmModem object:
- object allows telephonic data transfer between two PCs (e.g. by the PmNET0 protocol) or between PC and the PLC machine by the concrete protocol (see List of communication drivers).
- After establishing the connection, it is possible to transfer the data through the modem by the PmComm object, which means that it is possible to communicate by the communication protocols that are implemented in the PROMOTIC system. But problems can occur at some protocols for example as a result of the requirement to control special signals (RTS, DTR) or the structure of the data frame (e.g. the parity bit is not used for the parity bits check). For these protocols contact the MICROSYS, spol. s r.o..
- The modem can be controlled by properties and methods of the PmModem object.
- It is possible to have more modems connected to one PC, these are then differentiated by their address defined in the Modem address configurator on the Modem page.
- It is possible to change the communication protocol dynamically. For example, a number is dialed and a communication is proceeding with PLC1. After this another number is dialed and a communication is proceeding with PLC2, whereas PLC1 and PLC2 comes from various suppliers (they have diverse protocols).
- State, processing and modem errors can be watched in the INFO system.
 
Modem states:
- IDLE (0): Modem performs no activity. In this state a phone can be used (it if is connected to the modem) or the Call or WaitForCall method can be called.
- CALLING (1): Modem is just dialing a number. The modem catches in this state by calling the Call method. The state is changed after the connection is reached (change to the CONNECTED state) or after calling the HangUp method or after the timeout expires (change to the IDLE state).
- CONNECTED (2): Modem is connected to the other party. In this state it is possible to transfer the data by the PmComm object. This state changes after calling the HangUp method or after hang-up of the other party (change to the IDLE state).
- WAITING FOR CALL (3): Modem is waiting for calling from the other party. This state changes after the connection is achieved (change to the CONNECTED state) or after calling the HangUp method (change to the IDLE state).
- other values: Other values (greater than 20) represent temporary states that can occur, for example, in the process of the transition from the CONNECTED state into the IDLE state, etc.
 
The data transfer over the modem is allowed by the following walkthroughs:
1. MASTER communication (i.e. the case when a telephone number must be dialed)
a) the PmModem object dials the number (by the Call method)
b) after establishing the connection, the object gets in touch with the PmComm object and it begins to transfer data messages defined by the PmCommMsg object through this object. The connection to the PmComm object is carried out by the modem itself if the path to the PmComm object is defined in the PmModem object. It is possible to implement the data transfer beginning by the algorithm of this object by calling the PmCommMsg.Run method.
c) after the transfer of the required messages, the PmModem object hangs up (by the HangUp method).
2. SLAVE communication (i.e. the case when the modem is listening to somebody's calling)
a) the PmModem object waits for calling (by the WaitForCall method)
b) after establishing the connection, the object gets in touch with the PmComm object and it begins to transfer messages defined by the PmCommMsg object through this object (the message should be of the Slave type - the PmCommMsg.Run method is not called)
c) after the transfer of the required messages, the Master party hangs up, which also causes hang-up of the PmModem object.
 
The most used solution for the communication using modems is the case of MASTER communication that allows the communication through the modem for example with PLC machines (these are normally in the SLAVE state).

An example application about using modem, see Example of the communication through fone modem (PmModem object).

© MICROSYS, spol. s r. o.Tavičská 845/21 703 00 Ostrava-Vítkovice