1/10/2012 8:48 AM | |
Joined: 3/11/2007 Last visit: 7/18/2024 Posts: 226 Rating:
|
How you can use the instructions (fieldread & fieldwrite) to read and write to an array of type string? thanks |
1/10/2012 9:01 AM | |
Joined: 10/10/2005 Last visit: 8/29/2024 Posts: 1917 Rating:
|
Hello, regarding to your question, please see the informations of the FAQ which do you will find in the internet: http://support.automation.siemens.com/WW/view/de/40651587 With best regards |
1/11/2012 4:47 PM | |
Joined: 7/7/2010 Last visit: 8/30/2024 Posts: 15125 Rating:
|
Uploaded attachments show a different approach (thanks to Pegaia's tips on the AT data coercion method). In the zip are 4 images as follows: 1. DB configuration for where I store my string array, and where I put copies of the string array as a byte array. 2. Init my strings in an OB, then call my string test FC that copies the array of string to array of bytes. 3. The interface configuration that makes the logic as simple as a single "MOVE_BLK" command. 4. Watch table (live) showing input strings, and the copied bytes, plus the copied max length (20) and actual length, which varies depending on the string length. I think this approach would be far better than a loop to run through string arrays. However, that said, you can use this method IN FRONT OF a fieldread/fieldwrite to coerce the string array into a datatype accepted by fieldread/fieldwrite (it does not like strings). Hope this is helpful. AttachmentStringArray_To_ByteArray_Solution.zip (577 Downloads) |
science guy |
|
Follow us on