Welcome to our new forum
All users of the legacy CODESYS Forums, please create a new account at account.codesys.com. But make sure to use the same E-Mail address as in the old Forum. Then your posts will be matched.
Close
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2015-11-17
Originally created by: scott_cunningham
Short of copying the bytes directly, maybe you can use use POINTER TO BYTE as an in-between. For example, define pData : POINTER TO BYTE. Then pData := ADR(Array[1500]). Now you have the address of the data at position 1500 in the array. Now maybe you can do you work based on pData instead of your array[0..100].
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Yet another silly question here
I need to send ascii characters over FMS. My sae1939 lib data input is ARRAY 0..1600 of byte
Mostly using FBD-s to program, i got a block to convert ascii text to ARRAY 0..100 of byte
How do i assign the array of 0...100 to 1500...1600
Getting "Cannot convert array 0...100 of byte to array of 0..1600 of byte"
or if i try to define [1500..1600] then i get error "Expecting "," or " before """
so how to assign arrays of different size and how to point the locations (with single byte locations defining like [2] etc seems to work fine)
Related
Talk.ru: 2
Originally created by: scott_cunningham
Short of copying the bytes directly, maybe you can use use POINTER TO BYTE as an in-between. For example, define pData : POINTER TO BYTE. Then pData := ADR(Array[1500]). Now you have the address of the data at position 1500 in the array. Now maybe you can do you work based on pData instead of your array[0..100].
Thank you!
a string has a limited length so direct will not work, as scott says use for this a pointer
and have a look at how oscat is solving strings.