Why doesn't the communication block of CP342-5 / CP343-1 / CP343-5
work when I assign the ANY parameter symbolically?
For data transfer with CP342-5 / CP343-1 / CP343-5 you are using
one of the following communication blocks:
- FC 1 "DP_SEND"
- FC 2 "DP_RECV"
- FC 3 "DP_DIAG"
- FC 4 "DP_CTRL"
- FC 5 "AG_SEND"
- FC 6 "AG_RECV"
The Help specifies that only specific VARTYPES (e.g. bytes) are
permitted for the ANY parameter.
In a program without symbols you assign the ANY parameter
directly with the pointer format as follows, for example:
P#db1.dbx0.0 byte 20
With this the communication works
In a program with symbols the pointer input can under certain
circumstances be converted into a symbolic input. In such cases it
might happen that the blocks report an error.
If there is a symbol for the area addressed (e.g. in a data
block), then the actual VARTYPE of the area is recognized and
converted into the symbolic representation.
This is the case, for example, when an array of characters has
been declared in the data block and the pointer length matches the
byte length of the array. Then the VARTYPE CHAR is used instead of
the VARTYPE BYTE - consequently the block reports an error.
Either you provide for actual bytes in the memory area (i.e. only
bytes are defined in the data block) or you do not permit the
compiler to convert into symbols. You can achieve this by
addressing slightly less than the symbolic area.