2/18/2017 4:31 PM | |
Posts: 5225 Rating:
|
Have you seen this application example? @Duris - The question did have enough information. The help in TIA is just not too helpful when explaining the inner workings of the instruction. |
This contribution was helpful to
1 thankful Users |
2/18/2017 6:02 PM | |
Posts: 5225 Rating:
|
Hi Irfran, I like your idea of using an LREAL. See the attached pictures and description to help you. The first picture shows how the HMI can be configured to not show the decimal point. I guess you have already done so. The other picture shows possible code to convert from LREAL to the STRING.The status view shows a simulated PLC so that each computation step is more clear. ** Based on the example application given earlier - - My guess is that you need a STRING[22]. Keep in mind: VAL_STRG needs 10 digits + a sign >> 11 characters for your case. In my code example the size = 22 can be lowered down to 11 but not less. THIS is what gave you problems. Next you need to move the string to the left. I think you need to include a "+" in the telephone number. (From reading the documentation.) My code example do make provision to include or exclude the "+". What are your thoughts on the matter?AttachmentLREAL to STRING.zip (211 Downloads) |
Last edited by: William_B at: 2/18/2017 8:30:34 PMreview text |
|
This contribution was helpful to
1 thankful Users |
2/20/2017 6:54 AM | |
Posts: 4 Rating:
|
Dear All, Thanks for the replies. Thank you William for liking my idea and for taking the effort to resolve the issue. I have come up with a solution and I have attached the logic (pdf) for it. I know that the logic is a little bit memory consuming but it is working very well. I am attaching the HMI screenshot so that things becomes more clear. Please let me know if you want any more clarification. I shall upload the logic somewhere else and PM you the link. AttachmentForum.zip (224 Downloads) |
4/13/2019 2:18 PM | |
Posts: 1 Rating:
|
Dear colleagues. I cannot compile the project without user authorization. What is the password for the example project you mentioned above? https://support.industry.siemens.com/cs/de/en/view/58638283 |
Last edited by: clockwise at: 4/13/2019 2:21:24 PMLast edited by: clockwise at: 4/13/2019 2:22:12 PMLast edited by: clockwise at: 4/13/2019 2:26:57 PM |
|
Follow us on