12/17/2020 8:12 AM | |
Joined: 3/14/2008 Last visit: 9/11/2025 Posts: 2216 Rating:
|
Hi, I do not know the INT_P block. Which FB number is it from which library? But in general the sampling time does the following: The sampling time has a system attribute so that the sampling time receives the OB interrupt cycle time. If the block is used in OB32 (1sec), the sampling time is set to 1 sec. If called in OB35 (500ms), the sampling time is set to 500ms. This will ensure the following: Counting is not depending on the OB interrupt block. If you do something like: Time:=Time+1.0 and the block is used in OB35, every 500ms the time is incremented with 1 sec. However, if you do the following: Time:=Time + SamplingTime, the time is incremented every 500ms with 500ms. So this will make sure the time is counted correctly independent of the calling interrupt OB. |
If I could help you, you can use the RATE button. Thank you. |
|
12/18/2020 7:36 AM | |
Joined: 3/14/2008 Last visit: 9/11/2025 Posts: 2216 Rating:
|
Hi, Thank you for the attachment and feedback. It helps a lot. When you place the block in CFC and compile/download, the system will automatically set the sampling time corresponding to the OB. You should not change this yourself as this will ensure proper counting of the values. If you place the block in another OB like OB32, you will notice the value is changed to the cycle of OB32. |
If I could help you, you can use the RATE button. Thank you. |
|
Follow us on