3/6/2025 3:27 AM | |
Joined: 12/19/2024 Last visit: 7/27/2025 Posts: 3 Rating:
|
First of all, thank you for your answer. The entire program is attached.
AttachmentViap.zip (116 Downloads) |
3/9/2025 8:50 AM | |
Joined: 10/7/2005 Last visit: 9/14/2025 Posts: 3049 Rating:
|
Hi S7_Savas this is nasty programming and most likely not done because it is efficient or good, but rather because it can be done. Put simple, every FB211 call from within FB310 passes on a pointer value for it ValveStatus parameter. In the first FB211 call (for V_VA510), this is P#DB20.DBX120.0. accu1 does - for better or worse - now contain the pointers memory area and Byte.Bit address (i.e . 840003c0 in this example). SRD3 gets rid of the bit address so you are left with 78(hex) = 120(int). This value is now compared with the value in DB20.DBW2 ("Nr_VM") which is presumably entered from the HMI (or comes from drop down text list) and the block then controls that valve as per HMI commands. None of this rubbish programming would be required if they simply had added another INT input parameter to FB211 were you supply it with it valve number (e.g. 120 in this example) and use it for the comparison with the HMI valve number. This is the fix I suggest you apply now that it is in an S7-1500. |
Cheers |
|
This contribution was helpful to
3 thankful Users |
3/9/2025 8:51 PM | |
Joined: 12/19/2024 Last visit: 7/27/2025 Posts: 3 Rating:
|
Thanks for support. I understand this. Problem solved. |
This contribution was helpful to
2 thankful Users |
Follow us on