How to Reset Power State Machine Variable on Micro850 PLC Power Cycle in ST Programming

Question:

Hello everyone, I'm seeking assistance from the PLC programming community as I am new to this field. My current project involves using a Micro850 2080-LC50-24QBB controller and programming in ST. While my program is mostly functioning as required, I recently discovered in the manual that user-created variables are retained on power cycle for Micro830 and Micro850 controllers. However, I specifically need the state variable of my power state machine to reset to a known value when power is lost. I had assumed I could achieve this by setting an "Initial Value" for the variable to receive when power is restored and the program restarts. Is there a way to ensure that a user variable is written to a specific value, such as 0, whenever power is cycled? I would appreciate any guidance or advice on how to achieve this functionality. Thank you for your help!

Top Replies

A critical aspect of PLC programming is the implementation of a first pass system bit, which holds true during the initial single scan after the PLC shifts into RUN mode. This particular bit can then activate a sequence that resets all the bits within the state machine. Known as __SYSVA_FIRST_SCAN, this first scan bit plays a crucial role in optimizing PLC operations.

User drbitboy suggested implementing a "first pass system bit" for the initial single scan after the PLC shifts to RUN mode. This bit could activate a routine to reset all the bits in the state machine. The __SYSVA_FIRST_SCAN, or first scan bit, serves this purpose effectively. In Connected Components Workbench (CCW), the "Initial Value" determines the variable's default setting after a fresh download. Changes made to the variable during normal operation will persist through a power cycle. I have utilized the __SYSVA_FIRST_SCAN variable as suggested by drbitboy for similar purposes. This bit is specifically designed to be true only during the first scan, allowing it to trigger any necessary power cycle initialization.

This solution worked perfectly, I appreciate it!

Hello everyone, I am facing the same issue. Could someone please provide me with an example demonstrating how to incorporate it into the program? Thank you.

Thank you for the information, Revnus. Do I need to go through this process for each variable that I want to restore to its original settings?

Hello! Your issue certainly poses an interesting challenge. Given that those PLCs do indeed retain state on power cycle, you may want to think about implementing a "start-up" routine in your ST programming. This routine would run every time the PLC powers on, thereby resetting your state variable to your desired value. This way, regardless of what value the variable retains upon power-cycling, you still have control in setting it to a known state at the beginning of each PLC operation. Hope that helps. Remember to test it thoroughly to ensure it works as expected in your specific context!

Hey there! Welcome to the world of PLC programming! For your Micro850 controller, it’s true that user-defined variables retain their values during a power cycle. To ensure your state variable resets to zero when power is restored, you could use the built-in "Startup" routine. You can set a marker or condition that checks if the controller is doing a cold start (like a power cycle) and then explicitly initialize your state variable to the desired value there. This way, as soon as the power is back, your logic will always start fresh, regardless of any previous state. Give that a try!

Welcome to the world of PLC programming! Your approach is on the right track, but to reset a variable to a specific value like 0 on power cycle for the Micro850, you can utilize the β€œPower-Up” routine available in the programming environment. You can set up a dedicated initialization routine that runs when the controller powers up, where you explicitly assign your state variable to 0. One thing to keep in mind is that you might want to double-check the configuration settings for variable retention to ensure they align with your needs. Good luck with your project, and feel free to share any other questions you might have!

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 reset a user variable to a specific value on power cycle in a Micro850 PLC using ST programming?

Answer: - To reset a user variable to a known value on power cycle in a Micro850 PLC, you can set an "Initial Value" for the variable to receive when power is restored and the program restarts.

FAQ: 2. Is it possible to ensure that a user variable is written to a specific value, like 0, when power is cycled on a Micro850 controller?

Answer: - Yes, you can achieve this functionality by defining an "Initial Value" for the variable in your ST program to ensure it gets set to the desired value, such as 0, on power cycle.

FAQ: 3. How can I manage the state variable of a power state machine in a Micro850 PLC to reset on power loss and restart?

Answer: - You can handle the state variable of your power state machine by setting its "Initial Value" to the desired state when power is restored, allowing it to reset to a known value on power cycle.

FAQ: 4. Any tips for a beginner in PLC programming using a Micro850 2080-LC50-24QBB controller in ST language?

Answer: - For beginners using a Micro850 PLC with ST programming, it is beneficial to refer to the manual for details on retaining user-created variables on power cycle and setting initial values for variables to handle power loss scenarios effectively.

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  β†’