WRITE_PCMCIA: Writing data to the memory card
Original instructions
Function description
The WRITE_PCMCIA function transfers data from the PLC's RAM memory to the user memory card archiving zone. The function WRITE_U_PCMCIA enables to address the PLC zone's beginning to be copied to the PCMCIA card up to 65 535 (instead of 32 767 for WRITE_PCMCIA function) and is therefore recommended to be used instead of WRITE_PCMCIA function.
The additional parameters EN and ENO can be configured.
An example using the functions READ_PCMCIA and WRITE_PCMCIA is available, READ_PCMCIA and WRITE_PCMCIA example.
Representation in FBD
Representation:
Representation in LD
Representation:
Representation in IL
Representation:
LD Slot_Number
WRITE_PCMCIA Dest_Address, Words_Number, Source_Address, Write_State
Representation in ST
Representation:
WRITE_PCMCIA(Slot_Number, Dest_Address, Words_Number, Source_Address, Write_State);
Description of the parameters
The following table describes the input parameters:
Parameter
Type
Comment
Slot_Number
PCMCIA card slot:
  • 0 = upper slot,
  • 1 = lower slot
Dest_Address
First address where the data is written in the memory card.
Words_Number
Number of words to write.
Source_Address
First address where the data is read from the PLC (%MW). The upper limit of the address is: 32767.
The following table describes the output parameters:
Parameter
Type
Comment
Write_State
Code providing the result of the write command's execution:
  • 16#0000: write performed correctly,
  • 16#0102: Source_Address + Words_Number - 1 is greater than the maximum number of declared words in the PLC,
  • 16#0104: no valid application or no word in the PLC,
  • 16#0201: no file zone in the memory card,
  • 16#0202: memory card error,
  • 16#0204: memory card write-protected,
  • 16#0241: Dest_Address < 0,
  • 16#0242: Dest_Address + Words_Number-1 is greater than the highest address of the memory card,
  • 16#0401: Words_Number = 0,
  • 16#0402: Slot_Number is different from 0 and 1,
  • 16#0501: unsupported service.