I have a CMM2 (Serial I/O) card in my system that talks to a device that utilizes Byte oriented messages EG a typical message I would send would be like:
Byte 0 - Header
Byte 1 - ID
Byte 2 - Command
Byte 3 - (0x00 Padding)
Byte 4 - Checksum LSB
Byte 5 - Checksum MSB
I currently have the CMM2 transmit buffer defined in %AQ as a Word array, as you can't define a Byte array in %AQ memory.
But it is more natural to construct these messages as a Byte array - so internal to my code I build the message in a Byte array and then copy it to the Word array transmit buffer*. However even though this works, this technique throws up an 8022 Type Mismatch Warning in Machine Edition (even tough the correct number of bytes are being copied), and it is this warning that I am trying to eliminate**
I have tried every combination of Move, Array Move etc that I can think of in order to fool ME but to no avail. The only options I seem to have left are:
Is there any thing else that I am missing that could solve my problem and eliminate this 8022 Warning?
---
* Byte arrays can be defined in discrete or symbolic memory, but symbolic memory byte arrays causes a totally different issue due to the packing of data in memory. If you attempt to copy word data to symbolic byte array you get a "Warning 8297 BYTE arrays are not packed in non-discrete memory" which means data is not correctly copied (and yes I did try it!). As such, in order to work I have to define Byte arrays in discrete memory (I,Q,T,M etc)
** I aspire to producing code with zero warnings (especially the 8022 Type Mismatch) in machine edition as I have found more than one coding error by tracking down the source of such errors.
Byte 0 - Header
Byte 1 - ID
Byte 2 - Command
Byte 3 - (0x00 Padding)
Byte 4 - Checksum LSB
Byte 5 - Checksum MSB
I currently have the CMM2 transmit buffer defined in %AQ as a Word array, as you can't define a Byte array in %AQ memory.
But it is more natural to construct these messages as a Byte array - so internal to my code I build the message in a Byte array and then copy it to the Word array transmit buffer*. However even though this works, this technique throws up an 8022 Type Mismatch Warning in Machine Edition (even tough the correct number of bytes are being copied), and it is this warning that I am trying to eliminate**
I have tried every combination of Move, Array Move etc that I can think of in order to fool ME but to no avail. The only options I seem to have left are:
- Define the transmit buffer directly in discrete memory (I,Q,T,M etc)
- Create some horrible looping code that packs/unpacks data between Word and Byte arrays
Is there any thing else that I am missing that could solve my problem and eliminate this 8022 Warning?
---
* Byte arrays can be defined in discrete or symbolic memory, but symbolic memory byte arrays causes a totally different issue due to the packing of data in memory. If you attempt to copy word data to symbolic byte array you get a "Warning 8297 BYTE arrays are not packed in non-discrete memory" which means data is not correctly copied (and yes I did try it!). As such, in order to work I have to define Byte arrays in discrete memory (I,Q,T,M etc)
** I aspire to producing code with zero warnings (especially the 8022 Type Mismatch) in machine edition as I have found more than one coding error by tracking down the source of such errors.