2/21/2021 9:17 AM | |
Joined: 3/30/2020 Last visit: 9/13/2024 Posts: 4753 Rating: (977) |
Hello.
Your observation is correct. The tags that are called by reference doe not show any monitor value. It has been a design choice from Siemens. K_Ohjus mentions the "any pointer". This has been the original all round pointer for the S7-300 and S7-400. It is available for the S7-1500 and by exception used in the S7-1200. The VARIANT and Array[*} is trying to fill the gap left open when "any pointer" is removed or cannot be used in optimized data structures. As such Array[*] and VARIANT are not always available. The right PLC firmware and software version is needed. The [Programming guideline] shared by Mr. Jacek is worth looking at for revealing some secrets. Those secrets does not have value if the fundamentals of PLC coding is not mastered yet. The best samples would be the ones that Siemens shared with us as ready to use libraries. One of those: {https://support.industry.siemens.com/cs/ww/en/view/109479728} |
Activities of this user is voluntary. There is no obligation or liability placed on this user. Though optional, your 'please' and 'thank you' is highly valued. |
|
2/21/2021 2:30 PM | |
Joined: 3/5/2017 Last visit: 9/10/2024 Posts: 775 Rating: (127) |
I agree, there are pretty good stuff in that library. But usually it is best to delete most of the code and only keep what you need, and i would use those functions for learning purposes only. There is no point to use Variant as an input if you know that the input is going to be an array. Those functions are allarounders and are pretty costly to cycle time. One IF is like 3ms to 40ms depending on used PLC
|
- Trying is the first step towards failure. |
|
2/21/2021 2:39 PM | |
Joined: 3/30/2020 Last visit: 9/13/2024 Posts: 4753 Rating: (977) |
Insightful comment. Did you not notice that there are a generation of designers who aim to design a cure-all solution in their functions? Even if such a design is not optimized for processing. The brand that offers the most ready-to-use building blocks are the ones who are most popular. Siemens has historically focussed on optimized processing. (Note: I did not say 'fast'.) Customers seek other priorities. |
Last edited by: qwazee at: 02/21/2021 15:45:52typo Activities of this user is voluntary. There is no obligation or liability placed on this user. Though optional, your 'please' and 'thank you' is highly valued. |
|
3/2/2021 10:33 AM | |
Joined: 2/20/2018 Last visit: 8/14/2024 Posts: 46 Rating: (0) |
Hi. Does STRING is elementary data type or structured data type? I have made some test with call FB multiple times in loop and register time of the loop execution. According to my tests I am sure that : 1. Data Type like as String take a longer when declared at IN/OUT instead of IN area 2. Data Type like structured take a longer when declared at IN instead of IN/OUT area Naturally is that passing by reference should take less time than passing by value, isnt it? When I declare STRING at IN/OUT area then can not see its value at my instance DB against to structured data for example, question is why? And last question is what is the difference between Wstring and string? Regards. |
Adam |
|
Follow us on