Technical data

Linkage with PLC
CP 486 00/14 VIPA GmbH 149
6.4.2.4 Write a Variable to the PC
This function enables to write single data (bit, byte, word,...) to the memory of the PC. When
calling, the address of a variable to be written must be specified. The function transmits its value to
the bank and does not wait for the PC to read the data, but returns immediately to where it was
called.
Register
high In low Out
AX $31 typ status
BX size bst
CX adr
DX - bit
SI offset
DS segment
typ element area (type) of data for single element in PC (DB, MB, ...)
size code of data size (Bit, Byte, ...)
bst module number, is to be set only for element area (type) DB or DX
if element area (type) is absolute, here are the high-order bits of adr.
adr initial address in area
bit bit number if data size is bit or semaphor.
offset offset of variable address (in AT)
segment segment of variable address (in AT)
status < 0 error number because of error
129-255 job number to call status
Note:
Different to read jobs, a write job is not being blocked, nevertheless the job status as well should be
as long called as the job is finished with or without error.
Depending on the element size, the pointer to the data in the AT is to interpreted differently:
- bit or semaphore:
pointer is the address of a byte, the bit is read by bit number 0.
- Byte, left byte, right byte: the pointer is the address of a byte. The byte is
read from the memory cell.
- Word:
the pointer is the address of a word. High- and low-byte are exchanged
at the transmission.
- Doubleword/extended word:
the pointer is the address of a extended word, the extended word is read and
the order of all 4 bytes is reverse.