Jump to content

Activate two timers when a button is pressed


Recommended Posts

Hi All,
I'm new to this and desperately require your help.

I give up.....i'm trying to create a program to activate two timers when a button is pressed. I've created the Ladder and can get my green icon to show for 3 seconds when I push the corresponding button but I just can't get the relay to energies for the set amount of time. When the relevant button is pressed the output energies for as long as the button is pressed and completely disregards the output timer. Could anyone look at the attached to see what i'm doing wrong please?




EID Speed Lanes_ modified1.ulpr

Link to comment
Share on other sites

  • MVP 2023


Thank you for posting your code with your question.

For starters, download the examples and take a look at them.  Also look at the Help under Contents->Tags->Data Types.  

I've looked at your code and have a couple of suggestions-

1.  Your tag names are way too long - you can't easily see what you're doing in the code and selecting them when you drop a contact becomes cumbersome.  I know UniStream allows these long names but the Creators didn't give us a method of displaying more text on the display so it's easy to get lost with overly verbose names. 

2.  Similarly, use short names in the "Alias Name" in the IO tags tab.  "URB Adapter1_O..." means nothing.  I see you have three four output modules, so I'd suggest "Out1" to "Out12" as I don't know what these really are.  The alias tag is set at the bit level, and you can use that name when writing your code.

3.  An easy thing to be confused about is thinking that timer function blocks act the same as a contact themselves.  They do not.  A timer is an object that has  .Preset, .Current, and .Out properties.  The .Out is what you assign to your contact elsewhere in your logic.

4.  You do understand that a TE timer is a pulse, right?  Usually people use TD (delay) timers.  Always start a TE with a positive transitional, unless you want it to keep pulsing.


I hacked on the first few rungs of your code, renaming things per the above suggestions for the East Lane DDA In.  You'll see I shortened the tag names considerably and aliased the outputs.

Let us know what further questions you have.

Joe T.

P.S. - You may want to ask your local friendly distributor to help with some initial training on the product.  I do this for my people.


EIDSpeedLanes_modified1 JT.ulpr

  • Upvote 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...