Send_SMS_NXCIF Library Documentation
The library Send_SMS_NXCIF initializes a standard modem and sends dedicated messages using Hayes commands.

When activated, the function block sends the following initialization sequence:
| Command | Description |
|---|---|
| ATE0 | Echo OFF |
| &D0 | DTR ignored |
| +IPR=9600 | Speed 9600Bps |
| +ICF=3,4 | Format 8,N,1 |
| +IFC=0,0 | No RTS/CTS control |
Then request for the SIM status: AT+CPIN?<Cr><Lf>
If the response contains SIM PIN, it sends the PIN code: AT+CPIN=PINcode<Cr><Lf>
If the response contains READY, the FB requests the signal level: AT+CSQ<Cr><Lf>
The value is output to the variable SignalQuality.
Wiring:

Example with the Westermo GDW-11

Setup

With an option NX1W-CIF, No-Protocol should be selected
The location information of the CIF Node Location Port is obtained with a right click on the CIF Option or CIF Unit in the I/O Map

Input variables:
| Name | Type | Value | Description |
|---|---|---|---|
| Enable | BOOL | ON, OFF | |
| OptionLocationInfo or UnitLocationInfo | _sOPTBOARD_ID or _sNXUNIT_ID | --- | Location information of NXC1W-CIF or NX-CIF Unit |
| PortNo | USINT | 1, 2 | Serial port number |
| PINcode | STRING[5] | --- | PIN code of SIM card |
| Check_Signal | BOOL | ON, OFF | Request to read signal level |
| Tel_Number | STRING[14] | --- | Telephone number |
| Message | STRING[159] | --- | Message to send |
| Send_SMS | BOOL | ON, OFF | Command to send SMS |
Output variables:
| Name | Type | Value | Description |
|---|---|---|---|
| ENO | BOOL | OFF, ON | FB activated |
| Init_Fail | BOOL | OFF, ON | The initialization sequence failed |
| PINcode_Fail | BOOL | OFF, ON | PIN code rejected |
| SignalQuality | STRING[6] | --- | Signal level |
| Send_Fail | BOOL | OFF, ON | Fail sending the SMS |
| Error | BOOL | OFF, ON | Error flag. If ErrorID=0: modem error |
| ErrorID | WORD | 0-FFFF | An instruction execution failed (input error code at support-omron.fr) |
| Msg_Sent | BOOL | OFF, ON | Message sent |
Example of communications between a NX1P and a Westermo (WEST) modem
Initialization:
[10:55:30.355] NX1P: ATE0;&D0;+IPR=9600;+ICF=3,4;+IFC=0,0<Cr><Lf>
[10:55:30.480] WEST: <Cr><Lf>OK<Cr><Lf>
[10:55:30.820] NX1P: AT+CPIN?<Cr><Lf>
[10:55:30.879] WEST: <Cr><Lf>+CPIN: SIM PIN<Cr><Lf>
[10:55:31.285] NX1P: AT+CPIN=0000<Cr><Lf>
[10:55:32.152] WEST: <Cr><Lf>OK<Cr><Lf>
[10:55:33.355] NX1P: AT+CSQ<Cr><Lf>
[10:55:33.414] WEST: <Cr><Lf>+CSQ: 31,0<Cr><Lf><Cr><Lf>OK<Cr><Lf>
Sending My TEST:
[10:59:03.004] NX1P: AT+CMGS="+336xxxxxxxx"<Cr><Lf>
[10:59:03.094] WEST: <Cr><Lf>>
[10:59:04.063] NX1P: My TEST<26>
[10:59:06.539] WEST: <Cr><Lf>+CMGS: 23<Cr><Lf><Cr><Lf>OK<Cr><Lf>
Was this article helpful?
That’s Great!
Thank you for your feedback
Sorry! We couldn't be helpful
Thank you for your feedback
Feedback sent
We appreciate your effort and will try to fix the article