Struggling to transfer real numbers from an NB screen to an NX1P2 PLC? Despite using the NB screen and NX1P2 PLC, issues persist with getting proper translation of real numbers. When inputting 1.25 into a numeric entry box on the screen, the PLC displays 1067450368. Various conversion methods, such as DWORD_TO_REAL, have been attempted without success in displaying 1.25 or even an INT/DINT of 125 on the PLC. Are there specific steps or techniques for inputting REAL numbers on an NB screen and transferring that information to the PLC? For the NB screen setup, ensure the Numeric Data's Storage Format is set to Float, Data Length to DWORD, Integer to 2, and Decimal to 2. In the Variable Table, set Memory Type to Word, Area to H, Address to 110, and Data Format to BIN. As for the NX1P2 configuration, create a Global Variable with Data Type set to DWORD and AT location set to %H110.
In order to address this issue, you may need to perform a byte/word swap in the programmable logic controller (PLC) as there may be a compatibility issue with the NB device.
When dealing with byte order, it is important to correctly transfer data between different tag types. For example, if the NB (Network Bridge) is unable to copy 32-bits from a DWORD tag into a REAL tag, there are steps to follow. Start by obtaining the initial DWORD tag from the HMI, referred to as dworig, which may have a value like 1067450368. Another DWORD tag, dwtmp, is used as an intermediary in the process. The final result will be stored in a REAL tag called reel. If dworig is equal to 0 or -217483568, then reel will be set to 0.0 or -0.0 respectively. If not, the process continues by performing bit-wise operations. First, a bit-wise AND operation is done between dworig and 8388607 (0x007FFFFF), with the result stored in dwtmp (2097152). Adding 8388608 to dwtmp, the resulting value is moved into reel (10485760.0). If dworig is negative, reel is multiplied by -1.0. However, if dworig is not negative, dworig is divided by 8388608.0. Further steps involve additional bit-wise AND operations and adjustments based on the value of dwtmp. If dwtmp is 127, the process is completed. Otherwise, depending on whether dwtmp is greater or less than 127, either multiplication or division is performed on reel. Each bit in dwtmp then dictates a specific mathematical operation on reel, ranging from multiplying by 2.0 to multiplying by extremely large numbers such as 1.8446744E+19. In conclusion, the process of transferring and converting data between DWORD and REAL tags involves a series of precise calculations to ensure the final result is accurate.
Forget about all that and utilize the CopyNumTo command instead.
✅ Work Order Management
✅ Asset Tracking
✅ Preventive Maintenance
✅ Inspection Report
We have received your information. We will share Schedule Demo details on your Mail Id.
Answer: - The issue may be related to the configuration settings on the NB screen and NX1P2 PLC. Ensure the correct data formats and memory types are set up for proper transfer.
Answer: - To input REAL numbers on an NB screen, make sure to set the Numeric Data's Storage Format to Float, Data Length to DWORD, Integer to 2, and Decimal to 2. Configure the Variable Table with Memory Type set to Word, Area to H, Address to 110, and Data Format to BIN. For the NX1P2 PLC, create a Global Variable with Data Type DWORD and AT location set to %H110.
Answer: - Ensure that the storage formats, data lengths, memory types, and data types are correctly configured on both the NB screen and NX1P2 PLC. Double-check the address locations and data formats to facilitate accurate real number transfers.
Join hundreds of satisfied customers who have transformed their maintenance processes.
Sign up today and start optimizing your workflow.