Newsroom
The new fr_comm library brings full FlashRunner 2.0 device control to Python 3.10 and later on Windows, Linux and ARM Linux — with no C/C++ or C# layer in between.
Modern production lines and automated test environments increasingly rely on Python. It runs natively on embedded Linux boards, integrates directly into CI/CD pipelines, and powers the automation layer of countless factory tools. Until now, connecting those environments to FlashRunner 2.0 meant bridging through a C/C++ or C# integration layer — an additional dependency that not every team can afford to maintain.
The fr_comm Python library removes that constraint. It delivers a standard pip-installable wheel that exposes the complete FlashRunner communication interface — device commands, file transfers, project execution, data encryption and real-time logging — directly from Python 3.10 or newer, on Windows, Linux and ARM Linux.
Install the wheel:
python -m pip install fr_comm_python-1.0.0.0-py3-none-any.whlVerify the installation:
python -c "import fr_comm; print('import ok')"
python -c "from fr_comm import FR_GetDllVersion; print(FR_GetDllVersion())"That is all the setup required. The following minimal example opens a LAN session, queries the device status and handles errors — ready to extend into a full production script:
from fr_comm import FlashRunner, FR_Comm_Exception
try:
with FlashRunner("LAN", "192.168.1.100:1234") as fr:
fr.FR_SendCommand("#GETENGSTATUS")
print(fr.FR_GetAnswer(1500))
except FR_Comm_Exception as exc:
print(exc)Customer applications interact through six public symbols. The surface is deliberately small, which keeps integrations straightforward and upgrade paths clean:
A FlashRunner instance opens the connection immediately on construction. Using a with block is the recommended pattern: the session is closed automatically and correctly even if an exception occurs mid-operation.
FlashRunner("LAN", "192.168.1.100:1234") # LAN, the most common production setup
FlashRunner("COM3", "115200") # USB/Serial on Windows
FlashRunner("/dev/ttyUSB0", "115200") # USB/Serial on LinuxBoth 115200 and 3000000 baud are supported. FlashRunner starts at 115200; to switch to 3 Mbaud, send #55*SETSERIALBAUDRATE HIGH at 115200 first, then match the baud rate on the host before continuing. This makes high-throughput transfers practical even over a direct USB connection.
Command execution follows a simple send/receive pattern. FR_SendCommand() delivers any FlashRunner command string; FR_GetAnswer() collects the device response with a configurable timeout:
fr.FR_SendCommand("#GETENGSTATUS")
answer = fr.FR_GetAnswer(1500) # timeout in msFor multi-channel scenarios, FR_SendCommand_Ex() targets an explicit channel list and builds the channel header automatically, eliminating manual string formatting in the calling code:
fr.FR_SendCommand_Ex([1, 2], "RUN Project.prj")
answer = fr.FR_GetAnswer(1500)File transfer works in both directions. An optional ProgressHandler delivers percentage updates, which is useful for console feedback or UI progress bars during longer transfers:
fr.FR_SendFile(r"C:\FlashRunner\app.frb", FR_FileType.FRB)
fr.FR_GetFile("app.frb", r"C:\FlashRunner\dest", FR_FileType.FRB)Project execution is a single call. FR_RunProject() blocks until all channels complete or the timeout expires. An optional per-channel callback makes it easy to feed results straight into an MES or test reporting system:
def on_done(channel: int, result: bool) -> None:
print(f"channel {channel}: {'OK' if result else 'FAIL'}")
fr.FR_RunProject("demo.prj", [1, 2, 3], 120000, on_done)Applications that write protected content to FlashRunner dynamic memory can perform RSA/AES encryption entirely within Python, with no external tooling. FR_GetPublicKey() retrieves and stores the device public key; two encryption modes are then available, depending on the workload:
The fr_comm library extends FlashRunner 2.0 to Python-based production and test environments without compromise. Every operation available through the C/C++ and C# libraries — commands, file transfers, project execution, encryption and real-time logging — is accessible through a single pip-installable wheel, on any platform where Python 3.10 runs.
For teams building automation around FlashRunner, this means shorter integration cycles, fewer toolchain dependencies, and a direct path from a Python script to a fully controlled programming station — whether that station sits on a development workstation or is embedded in a production line.