How to write and save a variable to the PLC (FB)

2 posts in this topic


I'm new in PLC programming and I'm hoping to find a solution to a programming task, hopefully, I can get some help from anyone of you who is kind enough to take my case. 

The purpose of this function is simple, from SCADA, write and save a variable to the PLC.



The programme that I wrote in the PLC (please see figure below) currently counts the number of hours that a device was used, it can also be set to zero in case a new device is physically installed in the machine. However, if a second-hand device with a lifetime of 700hrs consumed is installed, the counter should start from 700hrs instead of 0 hrs. So my question is, how do I create a "writable" function that takes a variable so I can add it to the current programming as an option. Hoping somebody could extend a helping hand, thank you.


Share this post

Link to post
Share on other sites

You could either make your 'ZeroO2' into a data entry variable instead of a constant or  you could create another rung similar to rung #3 which would move the correct value into the 'O2Time' register. Of course you will need some way to enter the desired value such as a touchscreen.

Edited by Mendon Systems

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now