9/7/2018 3:52 PM | |
Joined: 9/27/2006 Last visit: 9/4/2024 Posts: 12282 Rating:
|
Hello Yogendra; The IEC functions DI_String and R_String produce a S7 string s result, which is slightly different in format that straight ASCII (array of characters). A S7 string uses the first 2 bytes to specify the actual length and total length of the string. So when you manipulate the characters in the string for display, transfer or transmittal for example, you must start using the 3rd byte of the string to obtain the first character, as discussed here: https://support.industry.siemens.com/cs/ww/en/view/17471991 My suggestion: use a VAT table to view the contents of the produced string and examine specifically the first 2 bytes of the resulting string. Hope this helps, |
Last edited by: dchartier at: 9/7/2018 3:53:32 PM |
|
This contribution was helpful to
1 thankful Users |
9/14/2018 2:21 PM | |
Joined: 11/9/2008 Last visit: 8/23/2024 Posts: 410 Rating:
|
Hi Daniel, Thanks for your reply. I used R_String instruction. I have some doubts regarding Instruction, if I have give input 123.5 then it convert in string format it shows below result E.g Input :- 123.5 Result in String :- '+' '1' '.' '2' '3' '5' '0' First 2 Byte for Max. length and actual length of string. 2nd byte is for 1st char and 3rd is for decimal point and other byte for remaining char. I have one question reading decimal point. How to send this data to printer due fix position of decimal point is fixed at 3rd Byte. Please guide me how to find out whether decimal point is after 2 or 3 decimal [e.g 12.3 or 123.5] Regards, Yogendra |
2/20/2023 9:54 AM | |
Joined: 2/20/2023 Last visit: 2/20/2023 Posts: 1 Rating:
|
You can use Ai tools. |
Follow us on