IMDHMIControls LibraryShop main store

How-to

How Unity Pro disables and re-enables M340 CANopen nodes at an event

Industrial networks Published 8 min read By IMDHMI controls team

Short answer

On a Modicon M340 with Unity Pro, event-driven node enable and disable is done through the documented CANopen node-management system words %SW142 to %SW145, not through a drive stop instruction. Stop the Altivar through its normal command path first, drop the node, and treat the drive's communication-fault response as the only thing that actually stops the motor.

On this page
  1. Where the node-control words live
  2. Confirm the CPU and Unity Pro version first
  3. Stop the drive before you drop the node
  4. What disable actually does on the bus
  5. Write the event logic with one owner and a defined handshake
  6. Re-enable the node and prove the data is fresh
  7. Worked example: phased disable of drive nodes
  8. The decision, per case
  9. Questions asked

Yes, it is possible, and the answer lives in the controller, not in a drive instruction: the Modicon M340 CANopen implementation gives you system words %SW142 to %SW145 as the documented node-management interface, so a BMX P34 20302 project in Unity Pro S V7.0 can drop and reinstate individual CANopen nodes at an event. What it is not, ever, is a way to stop a motor. Dropping an Altivar 312 or Altivar 61 node changes its protocol participation; the drive's own configured communication-fault response is what actually removes torque. The sequence below does the stop first, the node action second, and validates fresh data on the way back in.

Where the node-control words live #

The Modicon M340 CANopen user manual documents the CANopen implementation for the range, and within it the system-word range %SW142 through %SW145 carries the node enable and disable interface for the CANopen master. Open the Unity Pro version you are running, locate these four words in its system-word reference, and read three things for each word before writing any code: the description of the operation it performs, the read/write classification, and which node addresses each word covers.

Do not infer the node-address-to-bit or node-address-to-word assignment from the fact that there are four 16-bit words. Four words at sixteen bits each would hold 64 positions, which does not by itself tell you how node addresses 1 through 63 are mapped, or how reserved positions behave. The mapping is stated in the manual for your firmware; use it as printed.

Also read what the documented operation actually does to the node. The CANopen node-management state machine under CiA 301 moves a device between initialization, pre-operational, operational and stopped states, and the NMT stopped state is the one that halts cyclic process-data exchange while management traffic still exists on the bus. Whether the system words issue an NMT-style exclusion, suppress the master's participation for that node, or merely report status decides what your logic can rely on. A status word cannot substitute for a command.

If your installed Unity Pro help describes %SW142 to %SW145 with a different function than you need, get the applicable node-control procedure through the vendor's official support channel rather than writing trial values into system words.

Confirm the CPU and Unity Pro version first #

System words are version-qualified. Before touching them:

  1. Read the CPU reference from the project's hardware configuration and confirm it targets the BMX P34 20302.
  2. Read the running firmware from controller diagnostics and record it next to the project version.
  3. Confirm the engineering installation is Unity Pro S V7.0 or the version your project was built in, and use that installation's help file for the word definitions.
  4. Record each drive's configured CANopen node address from the project and compare it with the address read at the physical drive, so a disable command written for node 5 can never reach node 6.

Resolve any existing bus faults before you test application-controlled exclusion. A node that already drops out intermittently will make your test meaningless, and a coupler that boots but gets rejected by the master is its own fault to fix first — that case is covered in the article on why a CANopen coupler boots up but the PLC rejects it.

Stop the drive before you drop the node #

A node exclusion can leave the last received command in effect until the drive's communication supervision acts, or it can trip a communication fault immediately. Which of the two happens is decided by the drive's configured communication-fault response, so read the actual values in the Altivar's communication supervision settings — supervision time, fault response, command source and restart conditions — for both the ATV312 and ATV61, because the two families do not share a settings layout and an assumption carried across them will be wrong on one.

The safe order at the event:

  1. Bring the driven equipment to its required state through the normal command path: issue the application stop, confirm the drive's status feedback and the physical indication such as measured speed.
  2. Hold the run request inactive. Interlock it so that communication returning cannot simply resurrect the previous run command.
  3. Only then write the disable action for that node through the documented system word, preserving the bits of every other node in the word.

Node management is not a safety-rated stopping function. The machine's independent safety functions — the rated stop circuits, interlocks and their validation — stay responsible for any stop the risk assessment calls a safety function. This procedure is a normal operating action only.

What disable actually does on the bus #

Under CiA 301, a node in the stopped state stops exchanging cyclic process data, but the bus is not silent: management and supervision traffic still exist, and the master can still see the node. Plan the acceptance test around the required function — no fresh process data from that drive — not around total bus quiet, which you will not get.

If your real goal is only that a drive stops taking part in a process phase while staying healthy, this is the right tool. If your goal is a motor stop, the drive's command path and its communication-fault response do that job, and the node action is bookkeeping around it. Where the whole question is which network fits which device role, the fieldbus selection article on Modbus, PROFIBUS and CANopen covers that decision separately.

Write the event logic with one owner and a defined handshake #

Give one program section exclusive ownership of the node-management words. If another task writes a different node's bits in the same word, a read-modify-write race can drop a healthy node. Route every enable and disable request through one sequence that:

  1. Masks the word so only the target node's documented position changes, preserving unrelated and reserved bits.
  2. Checks the target node address against the commissioning record before the write executes.
  3. Issues the command with the edge or level behavior the documentation defines — a pulse if the semantics are handshake-style, a maintained value if the documentation defines a maintained request. Confirm which before choosing, not by experiment.
  4. Waits for a completion indication: the node's participation or state feedback reaching the requested state, checked in the controller diagnostics, not just the PLC's copy of the output word.
  5. On expiry of the wait, keeps the run inhibit active and reports requested state, actual state and bus diagnostics to the operator.

Set the wait timeout from documented numbers, not from feel. For example: if the drive's heartbeat producer time is 300 milliseconds and your diagnostic read runs every 10 milliseconds, three full heartbeat periods gives 3 × 300 ms = 900 ms of certainty that a responding node would have answered; add margin for one missed heartbeat and the sequence waits 1.2 seconds before declaring failure. If your supervision time differs, the same three-times rule applies to your number.

Re-enable the node and prove the data is fresh #

Reintegration is the mirror of the disable, with one extra trap: the PLC input image can hold values that look healthy because the master last received them before the exclusion. Old data in the input memory is not proof of a live exchange.

  1. Check the drive is ready: power present, node address unchanged, no local fault latched, run request still inactive.

  2. Write the enable action for that node through the same single-owner sequence and masked-word discipline.

  3. Wait for the node to return to operational participation in the controller diagnostics, comparing the requested state with the actual one if it stalls, and inspect configuration or supervision faults before repeating the command.

  4. Validate freshness: confirm the drive status words change over several scans in step with a known drive-side change — toggle a status bit at the drive or observe actual speed varying — rather than trusting a static value.

  5. Release the run inhibit only after step 4 passes, and never as part of the enable write itself.

Worked example: phased disable of drive nodes #

Take an ATV312 at node 5 and an ATV61 at node 11, both healthy and communicating, with a documented mapping that places each node's control position at a known bit of one of %SW142 to %SW145. A recipe phase must take node 5's drive out of communication and leave node 11 running.

  1. Event fires. Logic commands the node-5 drive to stop through its normal command path and holds the run request off; drive status confirms zero speed within the application's own 2-second window.
  2. Logic reads the word covering node 5, clears node 5's documented position, leaves every other bit untouched, and writes the word back once, as a pulse if that is the documented handshake.
  3. Completion check: node 5's cyclic data stops updating while node 11's status words keep changing — both observed across at least 3 scans at a 10 ms task, so 30 ms of differentiated behavior.
  4. Timeout for the wait is 1.2 seconds by the rule above (3 × 300 ms heartbeat plus one missed-period margin, rounded). If node 5's data still updates at expiry, the exclusion failed; the sequence reports the actual state and keeps the inhibit.
  5. Re-enable at the next phase reverses the bit, waits the same 1.2 seconds for operational participation, then toggles a drive status bit at the drive and confirms the PLC sees it change within 300 ms before releasing the run inhibit.

The arithmetic is the same for any heartbeat time and task rate: timeout = 3 × producer time + 1 period margin, rounded up to a whole task multiple. With a 500 ms heartbeat and a 20 ms task that is 3 × 500 + 500 = 2000 ms, already a task multiple.

The decision, per case #

  • Need a drive out of a process phase, drive healthy and no torque required: stop it through the command path, then disable the node with %SW142 to %SW145 through the documented, masked, single-owner sequence.
  • Need a motor stop with torque removal: that is the drive's command path and its configured communication-fault response, with the machine's safety functions for anything the risk assessment rates as a safety stop. Node exclusion is never that function.
  • Need the node back: re-enable through the same sequence, prove fresh process data, then release the run inhibit.

If your installed documentation describes the node-management words differently than assumed here, treat that documentation as the authority for your firmware and get the node-control procedure through the vendor's official support channel.

Questions asked

Do the %SW142 to %SW145 words work on every M340 CPU?

They are documented for the M340 CANopen implementation in the Modicon M340 CANopen user manual, and the CANopen master function itself is tied to the CPU in the project. Confirm the exact CPU reference in the hardware configuration and read the system-word description in the Unity Pro version you are running, because the word definitions and access conditions belong to that documentation, not to a generic M340 rule.

Can dropping a CANopen node be used as an emergency stop?

No. A node-management action changes protocol participation; it is not a safety-rated stopping function and it does not guarantee torque removal. The machine's stop requirement belongs to its independent safety functions, wired and validated as a safety function. Use node disable only as a normal operating action, with the drive already in a commanded stop and the run request held inactive.

What is the difference between a stopped node and a communicating one?

Under CiA 301, a device in the NMT stopped state does not exchange cyclic process data, though management traffic still exists on the bus. A device in the operational state exchanges cyclic data. That is why a disabled node can still appear alive in diagnostics, and why your acceptance test must check process-data freshness, not just bus activity.

Why does my drive run on after I disable the node?

Removing the node from cyclic communication leaves the last received command in effect until the drive's configured communication supervision times out and its communication-fault response acts. That response, not the node action, is what stops the motor. Command the stop through the normal control path first, and hold the run request inactive while the node is out and during reintegration.

Keep reading

  • Selection guide

    Selecting a PROFIBUS DP to CANopen gateway for S7-400 drives

    A mapped PROFIBUS DP to CANopen gateway exchanges a configured process image, not raw CAN frames the S7-400 builds. Select it on whether the gateway performs CANopen startup and node management for the drives, whether its PDO mapping covers the drive command and status objects, and whether it supports the consistent DP transfers SFC 14 and SFC 15 require. The 488-byte and 320-byte exchange figures on the shortlisted units decide only the byte headroom, not capability.

    Industrial networks

  • Troubleshooting

    Why only master on the bus in STARTER shuts a running PROFIBUS line

    The line dies because checking only master on the bus tells the PG to grab the token, and the running S7-300 class 1 master already holds it: two masters, one bus fault. On a live line, leave the box unchecked, give the PG an unused node address (never 0, the PLC's address, or the drive's), set the PG to the rate the bus runs, and STARTER connects online without stopping production.

    Industrial networks

  • How-to

    Configuring S7-200 PROFIBUS communication with an MM440 drive

    The S7-200 cannot be the PROFIBUS-DP master for an MM440: the EM277 is a slave-only module. Make an S7-300 the DP master with the EM277 and the MM440 as slaves, exchange the speed request through the EM277 V-memory window, and start the drive with control word 047E then 047F plus the normalized speed word. If you only need direct S7-200-to-drive control, use USS at the drive's serial terminals instead.

    Industrial networks