Explainer
Why an alarm bit alone cannot send an SMS from a Q PLC
Short answer
An internal alarm relay such as M100 never sends anything by itself: it only changes state in CPU memory. The message goes out because your program latches a pending request from the rising edge and runs a staged, response-driven serial transaction with the GSM module over the serial communication module's RS-232 port. Fix the modem interface first; add timers around the alarm rung last.

On this page
- Why does an alarm bit alone not send an SMS from a Q PLC?
- Which port on a Q-series PLC reaches a GSM module?
- How do I turn one alarm into exactly one send request?
- What stages does one SMS transaction go through?
- How do I match the serial settings at both ends of the cable?
- How long should each stage wait before timing out?
- How do I prove one alarm produces exactly one message?
- What do I fix first when the message still does not arrive?
- Questions asked
An internal alarm relay such as M100 never sends anything by itself: it changes state in CPU memory and nothing leaves the controller until your program moves that state across a serial link to the GSM module. The message goes out because a pending request, latched from the rising edge of the alarm, drives a staged serial transaction in which every step waits for the response the module documents before the next one starts. That is the whole answer: fix the modem interface first, meaning port, wiring, framing, SIM and destination, and treat the alarm rung as the trigger, not the sender. The sections below walk the chain in the order you meet it on site, from the slot the serial module occupies to the test that proves one alarm produces exactly one text.
Why does an alarm bit alone not send an SMS from a Q PLC? #
It cannot, because M100 is an internal relay inside the CPU: the bit changes state in memory and nothing leaves the controller until your program copies that state into a serial transaction that the GSM module understands and answers.
The recipient's phone sits on a cellular network, and nothing moves between the two until three things exist: an explicit request your program builds, a configured serial path from the PLC to the module, and a transaction the module accepts and answers. That is why the classic symptom, an alarm bit that turns on while no text arrives, is almost never an alarm-logic fault. Rule the alarm side out in a minute: connect with the programming tool, watch M100 while you force the fault, and confirm it changes state. Once it does, every remaining question concerns the communication chain, and the rungs around M100 are only the trigger at the front of it. The sender is the serial sequence behind it.
Which port on a Q-series PLC reaches a GSM module? #
Use the serial communication module in the Q-series base: Mitsubishi documents it as the module that connects an external device to the CPU through RS-232 or RS-485, so the exact model in your slot decides the instructions, ports and settings you can use.
A Q CPU has no path to a modem on its own. The serial communication module exists precisely to attach external devices, and its documentation names measuring instruments and bar-code readers as examples; a GSM modem is one more such device. Before writing a rung, confirm what is actually fitted: open the PLC parameters, check the I/O assignment settings, and verify the communication module is configured in the slot it physically occupies. Then read that hardware's own manual set. The MELSEC-Q/L Serial Communication Module User's Manual (Application) is the volume that defines the serial instructions, their control data and the protocol behavior for these modules. The label Q PLC names a family; the module in the slot names the interface you actually program against.
How do I turn one alarm into exactly one send request? #
Detect the rising edge of M100, latch a pending-request bit from that edge, and let the serial sequence clear the latch when it finishes: one transition into alarm then yields one request, and a bit that stays on for hours cannot re-trigger the send.
Work it as two separate pieces. The detection rung sets a pending-request coil on the transition into alarm; a transition contact is the standard tool for that, and the guide to what each ladder logic symbol does explains how it differs from an ordinary contact. The transaction side clears the pending bit only when a send finishes, successfully or not, and refuses to start while the channel is busy, so exactly one transaction owns the port at a time.
The reason is arithmetic. Suppose this small program scans in 10 ms, an example figure for illustration. A transmit rung driven by the level of M100 issues a request every scan: 1 / 0.010 s = 100 requests per second. With each attempt waiting 10 s for a timeout that will never come, one stuck send piles up 100 x 10 = 1,000 attempts before the first one gives up. Edge detection plus the pending latch is what makes one alarm one request.
Decide now what happens when the alarm clears before the send runs: keep the request and transmit anyway, because the fault did occur, and cancel a pending request only in the earliest stage, before transmission starts. Never cancel in the middle of a transaction.
What stages does one SMS transaction go through? #
Run the transaction as distinct stages: take the pending request, prepare the destination number and message data, transmit the command the module documents, wait for its expected response, then record completion or failure and release the channel for the next request.
In practice that means a small stage machine with five states:
- Accept the pending request and mark the channel busy.
- Build the message: the destination number and the message data itself. If the recipient is meant to read the characters M100, the program must place those characters in the send buffer, because a relay does not carry its own name.
- Transmit the command or data block the module's manual requires, in the order and encoding it shows; some modules settle one message over several exchanges.
- Wait for the expected response and compare it before advancing. A transmit-complete flag only says the PLC finished clocking characters out of its port; it does not say the module accepted anything.
- Record completion or failure, release the channel and clear the pending request.
Keep message construction independent of the trigger: the rungs around M100 decide when a message is sent, and the buffer stage decides what is in it. Adding readable alarm texts later then touches one stage instead of the whole chain.
How do I match the serial settings at both ends of the cable? #
Read every framing field from the module's own documentation (baud rate, data bits, parity, stop bits, flow control) and set the PLC port to the same values, because wrong framing produces unreadable characters while crossed or missing wiring produces silence.
Match both ends field by field, including the electrical side: RS-232 transmit and receive on the right pins, signal reference present, handshake lines wired or explicitly disabled if the module does not use them. An example program written for a different modem is a skeleton to copy, never a drop-in, because interface, command syntax and response format all move with the hardware. The fault symptoms separate cleanly. Framing that does not match gives you data that arrives but reads as rubbish; crossed conductors give you a port that never receives at all. Neither is repaired by changing the alarm rung. The discipline is the same one used when connecting a controller to RS-232 and RS-485 serial devices: prove the physical and framing layers with the simplest possible exchange before any application logic rides on them.
How long should each stage wait before timing out? #
Make each timeout exceed the line time of the longest exchange plus the response time the module documents: at a 9600 baud port with 8 data bits, no parity and one stop bit, one character takes about 1.04 ms, so a 60-character exchange takes about 62 ms.
That 62 ms is only the wire. The slow part is the cellular side, where the module registers, submits the message and waits for the network's acknowledgment, and the size of that time is the module manual's to state. Compute the floor from the port: 9600 baud with one start bit, 8 data bits and one stop bit is 10 bits per character, so the port moves 9600 / 10 = 960 characters per second, one character costs 1 / 960 s = 1.04 ms, and a 60-character exchange costs 60 x 1.04 = 62.4 ms. Set each waiting stage's timeout at transmit time plus the documented maximum response, plus margin; where the manual gives no number, measure the transaction, and if 20 test sends never take longer than 8 s, a 10 s timeout is a defensible setting. Never let a bare delay decide the next step: a timer cannot distinguish a rejected command from a module still working. Only the expected response can.
How do I prove one alarm produces exactly one message? #
Test the whole chain, not only the handset: send a manual message and record the module's response, then switch M100 on once and confirm one request enters the sequence, stays a single transaction while the bit remains on, and fires again when the alarm clears and returns.
Watch five things together in the online monitor: M100, the pending request, the stage counter, the last received response and the final result. Testing only by waiting for a phone leaves every failure without an address. Then work the cases:
- One manual send: record both the module's response and the handset result.
- Alarm raised once: exactly one request enters, one text arrives.
- Alarm held on: no second request fires, however long the bit stays set.
- Alarm cleared and re-raised: a new event produces a new message.
- Failure forced under controlled conditions, for example by removing the antenna: the stage times out, records the failure, and retries at a bounded pace instead of hammering the port.
- PLC restarted with the alarm still active: implement the startup rule that a fault still present at power-up raises a fresh request, because the condition the recipient cares about still exists.
One boundary belongs here: an SMS chain is a notification convenience, not a safety function. A hazard that can hurt someone needs protection and annunciation that still work with the radio link dead.
What do I fix first when the message still does not arrive? #
Fix the modem interface before you touch the alarm rung: verify wiring and framing, confirm SIM registration, signal and antenna through the module's diagnostics, check the destination format, and only after the module answers a manual command should you look at the ladder around M100.
Work down that order and the cases resolve themselves:
- The bit changes but the module answers nothing: an interface fault in the conductors, framing, module supply, antenna or SIM registration. The alarm rung is innocent.
- A manual send works but the automatic send never fires: a trigger fault, meaning the rising edge is not detected or the pending latch is never set.
- One message arrives and later alarms stay silent: the sequence fails to clear and re-arm the pending bit, or the module rejects the second transaction; read the response it returns on that second attempt.
- Messages repeat rapidly: a level-triggered transmit rung without edge detection and latch.
- The module accepts but the phone stays silent: check the destination, where the sample value 123456789 is an example and not a subscriber, and the message format the service requires.
Each case ends the same way: the module's own response, read at the failing stage, says which side to open next. The ladder around M100 is the last thing you revise, not the first.
Questions asked
Will the number 123456789 work as the destination?
It is an example value, not a subscriber. Enter a real test number in the format your module and cellular service require; most services want the full international form with the country code and no leading trunk zero. Confirm the first test against a phone you hold, so a formatting fault shows up as your own missed message instead of a silent failure.
Does a transmit-complete flag mean the phone received the text?
No. It proves the PLC finished clocking its characters out of the port; it says nothing about the module, the network or the handset. A success string from the module means it accepted the submission for the network. Only a documented delivery-report mechanism from the module tells you the message reached the handset, so treat those three points as separate results when you record a send.
Can I reuse a ladder example written for a different GSM modem?
Only as a structure to copy, never as a drop-in program. Another module can differ in electrical interface and pinout, command syntax, response strings, terminators, character encoding and the number of exchanges per message. Keep the stage-and-response skeleton, and take every command, response and timeout from the manual for the module actually fitted, otherwise a program that ran on the donor hardware fails silently on yours.
Which instructions make the Q CPU send the bytes?
The transmit and receive instructions documented for the serial communication module fitted in your base; the module's application manual names them and defines the control data, buffers and completion flags they use. A CPU cannot address the modem without that module's instructions, which is why the first commissioning step is identifying the exact module and reading its manual rather than adapting rung logic from a different controller family.


