Jump to content

VisiLogic Delay Timer - Get Current Value on Change


Recommended Posts

I'm pretty new to ladder logic but have a long background writing code in C++, C#, and more.  I tend to look at solving my problems the way I would when writing code, which doesn't always translate to ladder logic.  This is my first time working with VisiLogic and I'm updating an existing project.  The implementation consists of a motor that runs for a time specified in a Delay Timer that I will refer to as DT 1.  I need to add another motor that will run for the same amount of time specified in the preset of DT 1 after the first motor is finished running.  I'm thinking I should add another timer (DT 2) for the second motor because there are different actions that have to happen when DT 1 and DT 2 expire.  DT 1's preset is set by the operator via an on-screen variable.  Is there a way to pull the preset time from DT 1 into DT 2 so that I don't have to add another operator entry field to the screen?  Is there a way to detect when the preset of a Delay Timer has changed?

 

Any advice is greatly appreciated.

Link to comment
Share on other sites

  • MVP 2023

Yes and yes. Use the "Load Timer/Counter Preset" (under the Store Menu) to move the TD1 preset into an ML and then "Store Timer/Counter Preset" to move the ML value into TD2. You can detect an update of the TD1 Preset by using the "Legal Entry" bit in the operator entry function. It will go high when an update is made. You can then use a Positive Transition of this bit to do the Load & Store for TD2.

Link to comment
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
×
×
  • Create New...

Important Information

Confirm to continue.