Explainer
What GX Works2 FB password protection actually protects
Short answer
FB password protection and withholding symbolic source raise the effort to read or reuse a structured text FB on an L06CPU; neither enforces a per-PLC license, so a copied project still runs. Distribute compiled code only, set the block password, and prove by an upload test on a spare CPU what a recipient actually recovers.

On this page
You want a structured text function block to run on one L06CPU and nowhere else. The honest answer: GX Works2 FB password protection locks the block inside the engineering project, and withholding symbolic source means an upload of the CPU returns compiled logic instead of your ST. Both measures raise the effort needed to read or reuse the block. Neither is a per-PLC license. A copy of the downloaded project runs on any compatible CPU, because no documented feature of this CPU family checks who executes the logic. The workable plan is to ship compiled code only, set the block password, and prove on a spare CPU what a recipient can actually recover.
What the FB password locks #
GX Works2 applies a password at block level. The behavior that matters for your decision is documented in the Structured Project operating manual: to use the compilation result display, all block passwords must be unlocked. That tells you where the password acts. It gates access to the block's contents and diagnostics inside the engineering tool. The Simple Project (Function Block) manual covers the FB creation and password operations you use when you set it.
So the password stops someone from opening the FB body in your project file and reading or editing the ST. It does not act on the CPU. Once the project is downloaded, the compiled logic executes whether or not anyone knows the password, and a recipient who receives the project file with the password set still has a working program. Protect the password itself: handing it over with the project, or leaving it in a shared engineering workstation, removes the barrier entirely.
What an upload returns without the source #
A compiled ST FB does not download as text. The compiler turns it into executable instruction logic, and unless symbolic or compressed source is stored in the CPU, an upload brings back that generated logic with jumps into routines, not your original structured text, names or comments. This is the general reason why uploading a PLC program is not full source recovery (article:why-uploading-a-plc-program-is-not-full-source-recovery).
Illustrative example, not a measured result: suppose your FB implements a twelve-state sequence and compiles to roughly 260 instruction steps, inside a total L06 program of 5,200 steps. An upload without source returns all 5,200 steps. The portion belonging to your FB is 260 / 5,200 = 0.05, so 5% of the uploaded file, interleaved with unrelated logic, with no symbol telling the reader where the block starts or ends. That is the effort you are buying: not secrecy, but the job of finding and understanding 5% of a large logic listing.
Effort is not prevention. Compiled binaries have been reconstructed on other platforms, as this recovery of FANUC KAREL source from compiled .PC files shows (https://industrialmonitordirect.com/blogs/knowledgebase/recovering-fanuc-karel-source-from-compiled-pc-files). A recipient who can read the uploaded logic, or simply watch the FB's I/O behavior, can reimplement the function. Withholding source raises the cost of copying; it does not make copying impossible.
Why neither feature is a license #
A per-controller license needs three things: an identity the CPU can read from inside the program, a validation routine that copying the project cannot skip, and a defined response when validation fails. FB password protection supplies none of the three, because it lives in the engineering tool. Source withholding supplies none either, because it changes what is readable, not what runs.
The HMI does not close the gap. An HMI password locks that panel's screens; the CPU accepts writes to the same devices from any other client, whether an engineering tool, a second terminal or a SCADA node. A button that only appears after an HMI login is operator ergonomics, not controller-side authorization.
What a binding scheme would actually require #
The MAC-address and remote-activation ideas both depend on capabilities you must confirm in the CPU documentation before designing around them: a stable identifier the application program can read, and a comparison the program performs that a copied project cannot simply have removed. If the exact L06CPU and firmware combination exposes no such documented mechanism, do not substitute a guessed reading method; build on nothing you have not tested on the target hardware.
If confirmation fails, commit to the legitimate alternatives: a supported external authorization device, or a contractual and operational control, meaning a license agreement, serial-numbered release records and a named contact who owns each distributed copy. If you do build a remote enable after confirmation, define the authentication, the expiration, the behavior on network loss and the recovery path, then test power cycling, communications failure and project transfer, and confirm the protected function stays disabled when authorization is absent. One safety rule governs all of it: whatever enable logic you add must never disable a safety function or leave outputs in an undefined state; the CPU module manual expects a fail-safe circuit external to the controller for exactly that reason.
How to ship and verify the block #
Keep the editable ST source and the full engineering project under controlled access, and distribute only the compiled project elements the customer needs for commissioning. Do not store symbolic or compressed source in the CPU unless the customer genuinely needs it, because that restores the readable form the whole scheme removes. Set the FB password before release.
Then run the upload test on a spare or controlled L06CPU, with the same GX Works2 options you will use for customer downloads:
- Download the exact project you intend to ship, with the password set and no source stored.
- Upload from that CPU into a fresh, separate project and inspect the result: structured text, symbols, comments or only generated logic.
- Try to open the protected FB in that separate project and record what the password actually blocks.
- Download the shipped project to a second compatible CPU and confirm it executes. A run on the second CPU proves no binding exists, which is the fact your contract must cover.
- Record the results with the GX Works2 version, the CPU model and its firmware, and keep a known-good backup plus a versioned release record.
The decision for each risk #
Stopping casual reading or editing of the FB: yes. Set the block password, ship compiled code without symbolic or compressed source, and the recipient's upload returns anonymous generated logic. Stopping reuse on another PLC: no documented feature here does it, and your step 4 test will demonstrate that; cover it with the license agreement and release records, or with a supported authorization architecture chosen after the CPU documentation confirms a mechanism. Building on a MAC address or remote activation before that confirmation: no. The panel will show the FB running normally on any CPU that receives the copy, so treat the engineering-tool password as exactly what it is, a lock on the project file, and put the enforcement where it can actually live.
Questions asked
Does withholding the source stop someone reusing the FB logic?
No. It removes your ST text from the uploaded file, but a recipient can still read the generated instruction logic, watch the block's I/O behavior, and rewrite the function. Treat source withholding as an effort multiplier of unknown size, not as prevention, and keep the reuse question in the contract rather than in the code.
Can the HMI password act as the activation control?
Not as a controller-side control. Unless the PLC program itself validates a credential, the gating lives in a device the FB does not control.
What should I record from the upload test?
Record whether the upload shows structured text, symbols, comments or only generated logic; whether the protected block opens in a separate project; and whether a copy of the downloaded project executes on a second compatible CPU. Note the GX Works2 version, the exact CPU and its firmware with each result, so the record matches what you ship.
Which manuals cover these functions?
The GX Works2 Version 1 operating manual for Simple Project (Function Block) covers FB creation and password operation, and the Structured Project manual covers block passwords and the compilation result display. The MELSEC-L CPU module user's manual covers program fundamentals and the fail-safe design expected around the controller.

