Justin Posted June 1, 2019 Report Share Posted June 1, 2019 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? Thanks Justin EID Speed Lanes_ modified1.ulpr Quote Link to comment Share on other sites More sharing options...
MVP 2022 Joe Tauser Posted June 2, 2019 MVP 2022 Report Share Posted June 2, 2019 Justin, 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 1 Quote Link to comment Share on other sites More sharing options...
Justin Posted June 4, 2019 Author Report Share Posted June 4, 2019 Hi Joe, Many thanks for this, the changes you made worked a treat. As for the other items you suggested I made the changes and it has really made a difference. Thank you for your time. Best Regards, Justin Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.