Industry Online Support
Technical Forum
6/25/2014 11:13 PM | |
Posts: 5225 Rating: (1185) |
Hi. I agree with the idea.. ensure there is a checkpoint between the source and where the value is used within the code. I am not sure how S7-1200 -|OK|- checks if the value is a REAL.. maybe this could be a question to ask the TIA (Portal) sub group. My first thought was to look for something in the SM (special memory bits). The closest there is, is the bits inside SMB1.. but that will not help too much. Looking through the S7-200 manual, it says that it is using the ANSI/IEEE 754--1985 standard to represent the REAL (Floating Point). Then to.. LINK. The only problem for the REAL datatype is the NAN representation (see Wikipedia). Except for the NAN representation, a DWORD, DINT and REAL can not be identified by only looking at the 32 bits. So maybe put in a bit mask check for the NAN.. (maybe infinity too). The bit check can be to handle the source value as if it is a DWORD and compare for a few HEX (16#xx..xx) or BINARY (2#xx...xx). If the NAN check passes, a compare function for REAL should be legal.. especially if you do not use Siemens standard (ex. I0.0) and not IEC standard coding (ex. %I0.0). I hope this is helpful to you.. but maybe do ask what the S7-1200 REAL type check does. Greetings. w [Deleted the previous answer and replaced with this one] |
Follow us on