6/26/2012 1:49 PM | |
Joined: 10/7/2005 Last visit: 9/14/2025 Posts: 3049 Rating:
|
Hello Nico1985 the behaviour you observe is (perhaps unfortunately) "normal". The root cause for the problem is that you do NOT always write to the FC OUT when you call it (your Set/Reset instructions are conditional writes) which leaves the OUT variable "unintialised" which in turn may lead to the OUT variable assuming random values. Attached is a pic from Step 7 inbuilt help about Functions which has more on this suject. If you are curious to find out why it works with M bits but not with DB bits, allow me to direct you to THIS thread which has all the gory detail on what goes on behind the scenes. I hope this helps |
Cheers |
|
This contribution was helpful to
2 thankful Users |
6/27/2012 9:35 AM | |
Joined: 10/7/2005 Last visit: 9/14/2025 Posts: 3049 Rating:
|
Spot on correct dear Nico1985andyou very neatly summarised the essence of it. @ manmeet:
I can't stop you from having this rule of thumb, but I do disagree with it. There is nothing at all wrong with using fully qualified DB addresses (e.g. DB10.DBX7.1, DB17.DBW4 etc.) as FC Parameters (I do it all the time). What is wrong though is to NOT (orconditionally) write to FC OUT parameters. |
Cheers |
|
Follow us on