HCBBS Forum (English)
Submit Chemical Projects / Find Solutions
Amplify Your Requirements on a Broader Chemical Platform *Engineering · Technology · Equipment · Solutions*
Submit Request

How to convert dint to int in PCS7

2010-07-23View Original

Thread Content

How can I convert dint to int in PCS7? Is there a module for direct conversion?
Reply #22010-07-23
I can't remember if there is a module for converting DINT to INT in PCS7. But such a switch is risky. The range of double integer is 0~4294967295 (regardless of positive and negative), while the range of integer is 0~65535. If your double integer is greater than 65535 (regardless of whether it is positive or negative), the value you convert will be wrong. If you are sure that the value of the double integer is between 0 and 65535, then you can take out the high-order word of the double integer and make it an integer. Note that it is not a low-order word
Reply #32010-07-24
First of all, thank you very much for your friend's reply, and also thank you very much for the reminder from the buddy on the second floor. I spent a lot of effort yesterday and found a module from DINT to INT. It is very easy to use. My double integer value should be between 0 and 65535, so I used it like this for the time being. No problems have been found for the time being. Your reminder has made me understand a lot, thank you!
Reply #42010-07-25
Ha, you're welcome. Just help each other and learn from each other * , we can improve together :)
Reply #52010-07-26
If you use SCL language, there is a function called DINT_TO_INT can be converted, and SCL's type conversion functions are very comprehensive and rich, basically everything you want to use is available. LAD and CFC can only be checked to see if they are in the library, but they have not been used.

Submit a Project

**Looking for Chemical Technology, Equipment & Solutions?** No Registration Required Broader Platform Exposure | Global Chemical Service Provider Connections

Submit Request — Free Consultation

Disclaimer

This is an automated machine translation of the original thread. Some technical terms may have inaccuracies; the original text shall prevail. Click "View Original" at the top right to access the source page, which supports IP-based automatic real-time language translation. Please watch out for contact details and sales inducements to prevent fraud. All content and translations are for reference only, representing solely the poster's personal views. For enquiries, email service@hcbbs.com.