Posted 26 Mar 2018 Hello. How can I get bit addressing of defined variable in function block? For example: - I define variable type DUINT with name Double_VarI_INT. - I want to get or set one bit out of it (its double word). - If I use Double_VarI_INT.0 I got error. Best regards. Share this post Link to post Share on other sites
Posted 28 Mar 2018 I found a possible way to do it. You have to make a second function block in ladder an call that one from the STL function block using the correct arguments. The reason for using MOV (should actually be MOVL for UDINT) is because you can't pass an input to an output. The value of resultUDINT will change according to the bit number you put in myBIT (0-31). It may even be possible to make the function call simpler with some tweaking, I haven't really thought it through. You can use the same route to read a certain bit, by calling a ladder function block with arguments taken from your STL program. Share this post Link to post Share on other sites