10/27/2023 1:16 AM | |
Joined: 5/14/2020 Last visit: 6/1/2024 Posts: 12 Rating: (0) |
Hi, This is a great example but is it possible to make this splitter block in LAD logic. If it is possible please can you show. My entire program is in Ladder. Please help. Thanks
------------------------------------------------------------------------------------------ |
Last edited by: Jen_Moderator at: 10/27/2023 10:29:08New subject after splitting |
|
10/27/2023 2:57 AM | |
Joined: 12/18/2014 Last visit: 6/2/2024 Posts: 33140 Rating: (4094)
|
The split block is a UDF. UDF can only programmed in FBD, not in LAD. That's why I created a LAD program for you that contains both the "Time_split" program and the function of the "Time_split" block. AttachmentTime_split_LAD_0BA8.Standard.zip (227 Downloads) |
10/27/2023 6:00 AM | |
Joined: 12/18/2014 Last visit: 6/2/2024 Posts: 33140 Rating: (4094)
|
See attachment.
AttachmentTime_splitting.zip (248 Downloads) |
10/27/2023 11:48 AM | |
Joined: 5/14/2020 Last visit: 6/1/2024 Posts: 12 Rating: (0) |
Thank You very much. Problem Solved.
|
This contribution was helpful to1 thankful Users |
10/30/2023 4:00 PM | |
Joined: 12/18/2014 Last visit: 6/2/2024 Posts: 33140 Rating: (4094)
|
First the block SF002. The hourly value of the setpoint hours from the HMI is in parameter V1. This value is multiplied by 60 (V2) to convert hours to minutes. The minutes from the set point minutes of the HMI (V3)are then added. This is how the total minutes of the set points are determined by the HMI. Now the value of the total minutes is referenced to the setting parameter of the off delay T001. The value of the remaining time of T001 is transferred to the VM memory (address VW8) via Parameter VM Mapping and is now read in again via the analog network input NAI1 and via the Analog amplifier SF009 referenced to mathematical instruction SF003. The analog threshold trigger SF004 checks whether the value of the total minutes is greater than 29. If the value is greater, then the value in the analog MUX SF005 is set from 0 to 30. Additionally, the value of the total minutes from SF003 is referenced to the mathematical instruction SF006. In SF006 the number of hours should be calculated from the total minutes. Here, the current value from SF005 (0 or 30) is first subtracted from the total value of the minutes. The background is that LOGO! only knows integers and so there are no rounding errors when dividing by 60 distorts the result. Example: 54/60 = 0.9. The LOGO! cannot do 0.9 and rounds up to 1. Then, with minutes remaining, 1 hour would be calculated, which is not true. However, if the value 30 is subtracted from 54 before dividing it by 60, the result is: (54-30)/60 = 0.4. At 0.4 the LOGO! rounds down and the result is 0 hours. The result in SF006 is now the number of hours, this value is referenced to the mathematical instruction SF007. Here the hourly value is multiplied by 60 again in order to have the hourly portion again in minutes. Finally, the remaining minutes are determined in SF008. The value of the total minutes (SF003) is connected to the Ax input of SF008, the value of the total hours in minutes (SF007) is connected to the Ay input of SF008. In SF008, the value of the input Ax is now subtracted from the input Ay, resulting in the minute component. |
Last edited by: Jen_Moderator at: 10/31/2023 10:23:20Text formatting optimized. |
|
Follow us on