How to Trigger BAT File Execution on Windows 10 PC Using Logix Controller

Question:

Hello, I am seeking a straightforward method for my 5069-L350ERMS2 to prompt a BAT file to run on a Windows 10 PC. The goal is to ensure that files are updated properly on the HMI by updating a TXT file whenever changes are made. The PC in question serves as a TFTP file server for recipe storage and is connected to the network via static IP over ethernet. Here are two potential options to achieve this: 1) Implement a command from the CPU to the PC for file PUT to trigger file updates. 2) Utilize a Windows service to execute the BAT file at regular intervals, aiming for 5-10 second intervals to minimize latency. Any assistance with this matter would be highly appreciated. Thank you. Best regards, Rafael

Top Replies

Instead of involving the PLC, it seems like the FTP files and TXT file are all on the PC based on your description. Have you considered updating the recipe on the TXT file that the HMI reads? This could streamline the process and avoid the need for PLC intervention.

Hello @lmscar12, I appreciate your response. The recipes are developed on the HMI/PLC and saved on the PLC SD card. These files can be transferred to the PC file system using a TFTP server. I am looking for a solution for the PC to automatically execute the BAT file when changes are detected in the directory files. This may involve setting up a Windows service or receiving a command from the CPU. Thank you.

When searching for a USB I/O device, consider options from reputable brands such as National Instruments and Labjack. These devices are widely available and offer detailed product documentation on the official website of National Instruments. Explore the range of USB I/O devices to find the best fit for your needs.

I'm currently exploring the capabilities of AdvancedHMI, which appears to be user-friendly and compatible with VB for executing files. In AdvancedHMI Controls, tags are used as bindings. I'm curious about how to initiate a subroutine when a tag value exceeds a certain threshold.

RafaelNY inquired about integrating AdvancedHMI for their project. Utilizing VB for file execution, they found the platform to be user-friendly with tag bindings within its controls. They sought guidance on triggering a subroutine based on a tag value reaching a specific threshold. Exploring HMIs, it was noted that most options, including AdvancedHMI, offer data change events for this functionality.

Hi Rafael, You could address this issue by creating a script on your PC to monitor changes to the TXT file, which then signals your bAT file to run when changes are detected. For this, you can use a 'FileSystemWatcher' object in PowerShell. The script would need to be left running on your PC, but it would start your BAT file promptly and only when necessary, unlike a continually looping BAT file that would consume unnecessary system resources.

Hi there Rafael, From what you've laid out, both options are quite feasible. In terms of utilizing a command from the CPU, Rockwell has pretty comprehensive instructions on the FTP objects available in the 5069 platform that could potentially initiate this PUT command as per your first option. Option two, setting up a recurring Windows service, would absolutely get the job done, but it sounds like it could possibly put an unnecessary load on the PC, especially if it's checking for updates every 5-10 seconds. A third option might be to set a trigger on the recipe storage file. This way, the BAT file would only execute when a change is made, making it more efficient and less taxing on the server. Hope this gives you another perspective to consider!

More Replies →

Streamline Your Asset Management
See How Oxmaint Works!!

✅   Work Order Management

✅   Asset Tracking

✅   Preventive Maintenance

✅   Inspection Report

We have received your information. We will share Schedule Demo details on your Mail Id.

To add a comment, please sign in or register if you haven't already..   

Frequently Asked Questions (FAQ)

FAQ: 1. How can I trigger a BAT file execution on a Windows 10 PC using a Logix Controller like the 5069-L350ERMS2?

Answer: - There are two potential options to achieve this: 1) Implement a command from the CPU to the PC for file PUT to trigger file updates. 2) Utilize a Windows service to execute the BAT file at regular intervals, aiming for 5-10 second intervals to minimize latency.

FAQ: 2. What is the purpose of prompting a BAT file to run on a Windows 10 PC from a Logix Controller?

Answer: - The goal is to ensure that files are updated properly on the HMI by updating a TXT file whenever changes are made. The PC in question serves as a TFTP file server for recipe storage and is connected to the network via static IP over ethernet.

FAQ: 3. How can I connect the Logix Controller to the Windows 10 PC for triggering the BAT file execution?

Answer: - Ensure that the Windows 10 PC and the Logix Controller are on the same network and that proper communication protocols are set up between them for file transfer and execution.

FAQ: 4. Is there a recommended interval for executing the BAT file on the Windows 10 PC for updating files on the HMI?

Answer: - It is suggested to aim for 5-10 second intervals to minimize latency and ensure timely updates of the files on the HMI.

Ready to Simplify Maintenance?

Join hundreds of satisfied customers who have transformed their maintenance processes.
Sign up today and start optimizing your workflow.

Request Demo  â†’