![]() It looks to me that it is passed as copy instead and if the OP writes the tag asynchronously just when the FB is processed, the write (bit set/reset) fails and the data in the DB is overwritten when the FB call ends. The data structure (PLC data type) is passed as an InOut parameter to a FB and therefor it should be passed as a pointer by reference. As Siemens does not recommend to use this function I switched to an extra single command bit (which is more labor-consuming) and I use two events with SetBit and ResetBit functions. The bit gets not always set or reset using the function SetBitWhileKeyPressed which is very annoying and possibly dangerous. ![]() Now with TIA I do the same with S7 1500 and S7 1200 CPUs and with various basic panels. The UDT was passed to a FB as INOUT parameter. In the former STEP 7 5.5 I used a byte member of a UDT placed in a DB to display the state of a device, one of the bits of that byte was used to control the device using the WinCC function SetBitWhileKeyPressed. I have a similar experience with TIA v13.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |