Mshak Posted June 6, 2019 Report Share Posted June 6, 2019 So I am a beginner when it comes to not only unitronics software, but PLC's in general. I am tasked to connect 2 door bells (one in the front, one in the back) to the PLC and create a program that once one of the buttons has been pressed, it sends a signal to the plc which activates a horn and tower lights (depending on the door). My problem is creating a data table that acts as a log. It is supposed to keep track of - 1. the time when a button is press, and - 2. the date. Also one other question, the timer off command doesn't seem to work in my programming, which is supposed to turn off the outputs after 5 seconds. of being activated, Thanks, I know it is a lot but any help would be appreciated. Link to comment Share on other sites More sharing options...
MVP 2023 Flex727 Posted June 7, 2019 MVP 2023 Report Share Posted June 7, 2019 5 hours ago, Mshak said: the timer off command doesn't seem to work in my programming, which is supposed to turn off the outputs after 5 seconds. of being activated, Use a positive transition of your button push to activate a Time TE. Use the output bit of the TE to activate your outputs. Something like this: You appear to have the Horn coil in both rungs 1 & 2. THAT WILL NOT WORK. You can only have a direct coil in one ladder rung. Link to comment Share on other sites More sharing options...
MVP 2023 Flex727 Posted June 7, 2019 MVP 2023 Report Share Posted June 7, 2019 6 hours ago, Mshak said: My problem is creating a data table that acts as a log. It is supposed to keep track of - 1. the time when a button is press, and - 2. the date. You're on the right track using the UDFB RTC to ASCII. Just place a line like this in your Main Routine: Then copy those operands over to your Data Table Struct triggered by a positive transition of your button press. You will also need to index the Data Table down a line each time. Link to comment Share on other sites More sharing options...
Mshak Posted June 7, 2019 Author Report Share Posted June 7, 2019 Thank you, this information helped out a lot. One last question, when doing the call functions, I see you numbers the time to #1 and the date to #9.... are those arbitrary numbers? What do they represent? Link to comment Share on other sites More sharing options...
MVP 2023 Flex727 Posted June 7, 2019 MVP 2023 Report Share Posted June 7, 2019 12 minutes ago, Mshak said: I see you numbers the time to #1 and the date to #9.... are those arbitrary numbers? What do they represent? If you look at the top comment line of the RTC to ASCII UDFB, it explains what the numbers mean. It's basically selecting which format style you want your Time and Date strings to be in. Link to comment Share on other sites More sharing options...
Mshak Posted June 10, 2019 Author Report Share Posted June 10, 2019 Can you explain exactly how to index the data table down a line each time? Link to comment Share on other sites More sharing options...
MVP 2023 Flex727 Posted June 10, 2019 MVP 2023 Report Share Posted June 10, 2019 33 minutes ago, Mshak said: Can you explain exactly how to index the data table down a line each time? You appear to be using Data Table Indexed. There is a function for "Insert Row to DTI" that automatically shifts the rows down below the point of insertion. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now