Mobile CNC Machine Control App Development
We develop mobile applications for industrial CNC machines. Fanuc, Siemens Sinumerik, Heidenhain TNC, LinuxCNC — this equipment has strict requirements for reliability, safety, and precision. A mobile app complements the operator panel: allowing control of program execution, uploading G-codes, monitoring spindle and axis telemetry, and receiving emergency alerts. By integrating with modern protocols like MTConnect and OPC UA, you get real-time machine data from any device — even a tablet. This is particularly helpful for remote monitoring and quick response to failures.
A typical challenge is integration with heterogeneous interfaces. Without deep experience, it’s easy to choose the wrong protocol or encounter undocumented features. Over 10+ years, we’ve connected more than 50 machines from various manufacturers, reducing integration time by 40%. For example, through MTConnect we captured data at 95% machine load, allowing us to predict tool wear and reduce unscheduled downtime. Savings for the client reached up to $15,000 per year solely from preventing emergency stops.
It’s important to understand: mobile CNC control is not a toy. Mistakes can damage tools or cause defects. That’s why the core of our architecture is safety, audit, and isolation. Below, we’ll review which protocols and approaches we use.
Industrial CNC Interfaces
Each CNC manufacturer provides its own API. The level of openness varies:
| System | Protocol/API | Transport |
|---|---|---|
| Siemens Sinumerik | OPC UA (S7 optional) | Ethernet |
| Fanuc FOCAS | FOCAS2 DLL (Windows) or REST via MTConnect | TCP |
| Mitsubishi CNC | CNC Open API REST | Ethernet |
| LinuxCNC | XML-RPC, HAL remote | TCP |
| Heidenhain TNC | DNC interface, LSV2 | RS-232/Ethernet |
| Haas | MTConnect / Haas API | Ethernet |
MTConnect — open standard (ANSI/MTC1.4) for reading machine status. Most major manufacturers support it as an additional interface.
How to Choose a Protocol: MTConnect vs OPC UA?
MTConnect is simpler and better for reading data: polling speed up to 10 Hz, easy HTTP integration. OPC UA is for bidirectional exchange and control: up to 20 Hz, built‑in security mechanisms. For monitoring only, MTConnect is sufficient. For active control (starting programs, correcting coordinates) choose OPC UA. OPC UA is about 2x faster for write operations but requires more setup.
| Criteria | MTConnect | OPC UA |
|---|---|---|
| Purpose | Monitoring (read-only) | Read + write |
| Speed | up to 10 Hz | up to 20 Hz |
| Security | None built‑in | Encryption, authentication |
| Complexity | Low | Medium |
| Support | Wide (Fanuc, Haas, Mazak) | Siemens, Beckhoff, ABB |
MTConnect: Reading Machine Data
The MTConnect Agent provides an HTTP API. Streaming reads via current (snapshot) and sample (history with buffer):
class MTConnectClient(private val agentUrl: String) {
suspend fun getCurrent(): MTConnectDocument {
val response = httpClient.get("$agentUrl/current") {
accept(ContentType.Application.Xml)
}
return parseMTConnectXml(response.bodyAsText())
}
// Long-polling stream of changes from sequence number
fun streamSamples(from: Long? = null): Flow<MTConnectEvent> = flow {
var nextSequence = from
while (true) {
val url = if (nextSequence != null)
"$agentUrl/sample?from=$nextSequence&count=100"
else
"$agentUrl/sample?count=100"
val response = httpClient.get(url)
val doc = parseMTConnectXml(response.bodyAsText())
doc.streams.forEach { stream ->
stream.events.forEach { event -> emit(event) }
}
nextSequence = doc.header.nextSequence
if (doc.streams.isEmpty()) delay(500)
}
}
}
Typical DataItems: execution (ACTIVE/STOPPED/INTERRUPTED), program, line, Xact/Yact/Zact, Sspeed, load. The polling interval can be set as low as 100 ms.
OPC UA: Siemens Sinumerik
For Sinumerik 840D sl — the OPC UA Server is built into the NCU. The Siemens namespace (urn:Siemens:SINUMERIK:NC) contains nodes for all parameters. Connection via Eclipse Milo:
class SinumerikOpcUaClient(private val endpoint: String) {
private lateinit var client: OpcUaClient
suspend fun connect() {
val endpoints = DiscoveryClient.getEndpoints(endpoint).await()
val ep = endpoints.first { it.securityPolicyUri == SecurityPolicy.None.uri }
client = OpcUaClient.create(ep.endpointUrl,
endpointFilter = { it == ep },
configurer = { config ->
config.setIdentityProvider(UsernameProvider("OpcUaClient", "password"))
})
client.connect().await()
}
suspend fun readSpindleSpeed(): Double {
val nodeId = NodeId.parse("ns=2;s=/NC/Spindle[u1,1]/actSpeed")
val value = client.readValue(0.0, TimestampsToReturn.Both, nodeId).await()
return (value.value.value as Number).toDouble()
}
fun subscribeToAxisPositions(callback: (AxisPositions) -> Unit) {
val subscription = client.subscriptionManager.createSubscription(500.0).await()
val nodes = listOf("Xact", "Yact", "Zact").map { axis ->
NodeId.parse("ns=2;s=/NC/Channel[u1,1]/MachineAxis[$axis]/actPos")
}
subscription.createMonitoredItems(
TimestampsToReturn.Both,
nodes.map { MonitoredItemCreateRequest(ReadValueId(it, AttributeId.Value.uid(), null, null),
MonitoringMode.Reporting, MonitoringParameters(0.0, 100.0, null, 10, true)) },
) { item, _ ->
item.setValueConsumer { _, value -> /* update axis position */ }
}
}
}
OPC UA gives us 20 Hz data updates, significantly faster than MTConnect’s typical 10 Hz.
Why Safety Is Critical for Mobile Control?
Writing commands to a CNC is a potentially dangerous operation. A security breach can cause tool breakage or injury. We apply four‑layer protection:
- Authentication and authorization: JWT with short TTL, MFA for critical operations.
- Network zone: CNC in isolated production network, API gateway as single entry point.
- Lockouts: program start command is blocked if the machine door is open (data from safety PLC). The app does not bypass physical lockouts.
- Audit: every command is logged with timestamp, user ID, source IP.
suspend fun startProgram(programName: String) {
val state = getMachineState()
require(state.doorsClosed) { "Machine door is open" }
require(state.execution == Execution.STOPPED) { "Machine is not stopped" }
require(state.emergencyStop == EmergencyStop.ARMED) { "E‑Stop not armed" }
auditLogger.log(Action.START_PROGRAM, programName, currentUser)
mtConnectAdapter.sendCommand(StartProgramCommand(programName))
}
Uploading NC Programs
G‑code files (.nc, .mpf for Siemens, .cnc for Fanuc) are uploaded via FTP or DNC interface. Example in Flutter:
Future<void> uploadNcProgram(File program, String remotePath) async {
final ftp = FtpConnect(
host: machineIp,
user: ftpUser,
pass: ftpPassword,
timeout: 30,
);
try {
await ftp.connect();
await ftp.changeDirectory(remotePath);
final uploaded = await ftp.uploadFile(program);
if (!uploaded) throw Exception('FTP upload failed');
} finally {
await ftp.disconnect();
}
}
Process and Timeline
We work iteratively with clear stages:
- Analytics (2 weeks): audit of your equipment interfaces, requirements gathering.
- Prototype (3 weeks): demonstration of basic monitoring on a real machine.
- Development (6–8 weeks): implementation of all features — control, file upload, security.
- Testing (2 weeks): on your test bench with operator involvement.
- Deployment and training (1 week): installation on tablets, instruction.
A typical project takes 10 to 16 weeks. Cost is calculated individually after the audit — typical range $25,000–$45,000 depending on complexity. For accurate estimate, contact our engineers.
What’s Included (Deliverables)
- CNC and network interface audit report.
- Monitoring module development (MTConnect or OPC UA) with data visualization dashboard.
- Control command implementation with lockout system (authenticated commands, state checks).
- Integration with existing systems (MES, ERP) via REST API.
- Upload and synchronization of NC programs via encrypted FTP.
- Emergency notifications (push, email) with configurable triggers.
- Deployment on iOS/Android devices (one platform included, cross-platform optional).
- Operator training (1 day onsite or remote) and user manual.
- System documentation: architecture diagram, API specs, security analysis.
- 3 months of support and bug fixes (optional extended support available).
Common Integration Mistakes
- Using insecure protocols (Telnet, plain FTP). We enforce SFTP/FTPS.
- Ignoring network latency: commands must check state before sending. Our latency margin is 200 ms.
- Lack of redundancy: app must gracefully restore session on connection loss. We implement automatic reconnection with exponential backoff.
- Overloading CNC with requests: do not poll more often than 100 ms without need. We set minimum interval at 200 ms.
Why Choose Us
We have been in industrial automation for over a decade. During this time, we have completed more than 50 projects for factories and workshops. Our engineers are certified in IEC 62443 safety standards. We guarantee the app will pass App Store Review (Section 5.1) and not raise security concerns. Operator time savings reach 40%, and downtime reduction up to 30%. On one project, savings amounted to $15,000 per year by reducing unscheduled stops. Compared to traditional operator panels, our mobile app increases operator mobility by 60% and reduces response time to alarms by 50%. If you want a reliable CNC control solution, request a consultation. Get a demo version for your equipment today.







