7/4/2009 3:13 PM | |
Joined: 10/7/2005 Last visit: 8/19/2024 Posts: 3016 Rating:
|
That is in principle true and certainly a "neat" way to substantially reduce the number of parameters to be passed on to the FB. However, should you, dear Plectrotion, choose to go down the UDT path, please be aware of the impact this will have on code size and cycle time. Have a look at this thread to find out more. Note further that UDT's"reside" in DB's andyou can unfortunately NOT create an "I/O UDT" in the symbol table. What thismeans is that using UDT's will not necessarily solve the problem of theI/O's that you needpass on to your FB100 (unlessyou declare the I/O address as aDWORD Pointer format in your UDT in which case you may be better off using STRUCT's since UDT's don't allow you to have seperate inital values per UDT reference). Anyway, I hope this helps somewhat and good luck with your project |
Last edited by: fritz at: 7/4/2009 3:39 PMCheers |
|
7/4/2009 3:30 PM | |
Posts: 8946 Rating:
|
Hello Fritz, like always, you have a nice precisely and analytically kind to observe problems. Yes, the code will increase, because all the data of UDT will be inside the instance-DB (FB) or in the local data-stack (FC). This can bring problems if a smaller CPU is in use. With the cycle time,I do not really agree 100%. Do you think the cycle time will be increased more as using an other, pointer - based, solution? Also an advantage of the UDT is (for me) the clear an straight dokumentation of the program and the possibilty to do changes quick and easy. |
7/4/2009 4:15 PM | |
Joined: 10/7/2005 Last visit: 8/19/2024 Posts: 3016 Rating:
|
Thank you Juergen, your post's aren't all that bad either ("keep 'em coming" as they say)
Possibly not (at least not enough to make a case against using UDT's). I still believe that your inital suggestion ofusing a UDT is a very good onefor Plectrotion to at least solve a part of his "problem". I onlywant to make sure he (and others who read this) are aware of the ramifications. |
Last edited by: fritz at: 7/5/2009 11:00 AMCheers |
|
7/6/2009 12:36 PM | |
Posts: 241 Rating:
|
Opps, Here is the program. AttachmentParalink.zip (171 Downloads) |
This contribution was helpful to
1 thankful Users |
7/7/2009 6:40 AM | |
Joined: 10/7/2005 Last visit: 8/19/2024 Posts: 3016 Rating:
|
My dear Plectrotion |
Last edited by: fritz at: 7/7/2009 9:00 AMAdded that the Find/Replace also works on DB variables. P.S: Pleased to see that I am not alone in my opinion, thanks guys, I appreciate the feedback and I guess I wasn''t the only one who had to "sleep over" this first. Cheers |
|
This contribution was helpful to
4 thankful Users |
Follow us on