I am inputting two integers (Low and High) and need to switch their positions and convert them to REAL in Machine Edition version 9.5. I am currently facing a challenge in converting the integers to REAL due to validation issues when using "Move Int" to Real. Here is the current process: - Input data as R1 (Low) and R2 (High) - Move R2 to R3 - Move R1 to R4 Now the integers are in the correct order with R3 as High and R4 as Low. To convert them to REAL, should I first convert them to DINT? Any suggestions on how to achieve this in Machine Edition?
Within the function set, there are two essential SWAP instructions available. SWAP_WORD is designed to switch the bytes within a 16-bit WORD, while SWAP_DWORD is meant for interchanging the words within a 32-bit DWORD. If you find yourself facing difficulties reaching a floating-point number, consider whether you need to perform a SWAP operation after reading two INTs in the incorrect sequence. Following the SWAP, convert the result into a REAL variable. In cases where the 16-bit entities are meant to be interpreted as floating point but are not in the right order, utilize the SWAP instruction with a DWORD variable as an output. Additionally, it is crucial to create another REAL variable with the same address as the DWORD output from the SWAP operation to correctly interpret the bits as per IEEE-754 floating point format.
After completing my work, I require precision with Real data analysis beyond the decimal point. I almost overlooked the importance of SWAP_DWORD, but I will make sure to include it. In the GE environment, do Word and Integer carry the same weight at 16 bits? It can be quite perplexing when working with Word and Integer commands.
What is the process for merging two integers to create a DINT or REAL data type?
When working with GE PLCs, it's important to understand the difference between INT and WORD data types. An INT is signed and has a range of values from -32768 to +32767, while a WORD is unsigned and ranges from 0 to 65535. But how can you combine two integers to create a DINT or REAL value? There are a couple of scenarios to consider. If you have a DINT value of 12345678 and two INTs with values of 1234 and 5678, the simplest solution is to convert both INTs to DINT or REAL. Then, multiply the INT with a value of 1234 by 10,000 and add the second INT to the result. It's important to note that the INT_TO_DINT instruction is only available in the Rx series of PLCs. However, the 90 series offers INT_TO_REAL and REAL_TO_DINT instructions as alternatives. In another scenario, if your DINT value of 12345678 is split between a low word value of 24,910 and a high word value of 188, you can easily create a DINT variable with the same address as the low word to handle this situation efficiently.
Thank you for explaining the concepts of INT and WORD. I am currently using an RX3i system. I will experiment with the suggestions you provided. Let's see how they work out.
It seems like you're on the right track! When converting from INT to REAL in Machine Edition, you can indeed first convert INT to DINT and then use the "To Real" function block to convert DINT to REAL. This helps to eliminate potential truncation errors. Remember to properly allocate memory for the variables to overcome any validation issues. Happy coding!
I've encountered a similar issue in Machine Edition before. Rather than converting them to DINT first, you can directly convert INT to REAL using the TO_REAL function. When you need to convert your integer, the syntax would look like this: R3_Real := TO_REAL(R3); Similarly do it for R4. This method would prevent the validation issues encountered with the 'Move Int' to Real situation. Just ensure the variables R3_Real and R4_Real are declared as REALs. Hope this helps!
It sounds like you're on the right track with moving the values around, but the conversion issue might be tied to the data types you're using. Instead of moving the integers to DINT first, you could try using the "Move" instruction directly to convert them to REAL. Make sure you're specifying the right data type in your move operation; for instance, using "Move R1 to R4" as REAL instead of DINT. This might help bypass the validation errors you're encountering. If it still doesn't work, double-check the documentation for any type-specific quirks in version 9.5 that could be affecting the conversion. Good luck!
It sounds like you're on the right track by rearranging R1 and R2 first! However, when converting your integers to REAL format in Machine Edition, you donβt necessarily have to convert them to DINT first. You can try using the "Move" instruction directly from INT to REAL if itβs available in your version. Just make sure your data types are aligned properly in the tag configuration. If you're still facing validation issues, double-check if there are any datatype restrictions or settings that might be causing the hiccup. Good luck, and feel free to share your progress!
β 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: Answer: To switch the positions of the integers and convert them to REAL in Machine Edition, you can follow a process such as inputting data as R1 (Low) and R2 (High), moving R2 to R3, and moving R1 to R4. Then, R3 will be High and R4 will be Low. To convert them to REAL, you may need to consider converting them to DINT first.
Answer: Answer: Validation issues when using "Move Int" to Real in Machine Edition may occur due to data type mismatches or incorrect conversion processes. Ensure that the data types are compatible and consider converting the integers to an appropriate format before converting them to REAL.
Answer: Answer: To convert integers to REAL in Machine Edition, consider switching the positions of the integers and then converting them to an intermediate data type like DINT before converting to REAL. Ensure that the conversion processes are done correctly to avoid validation issues.
Join hundreds of satisfied customers who have transformed their maintenance processes.
Sign up today and start optimizing your workflow.