There are two methods of transferring data between the controllers, Producer/Consumer, and Messaging.
Which you choose will depend on how fast and repeatable (in time) you want that data to be transferred. You may have multiple pieces of data, some that is required rapidly and at a fixed rate, and some that is only required when certain conditions are met.
If you choose the Produce/Consume model, then there is no coding needed in the PLC to make the data transfer happen. You configure a tag in the "sender" as a Produced Tag, specifying for how many Consumers, and then configure an identical tag in the "receiver" as a Consumed tag. This tag you also specify the comms path to the Producer controller, and the update time. Once the two tags are configured correctly, the data transfer occurs automatically when the programs are downloaded to the controllers. This data transfer is deterministic, meaning if you ask for data update at, say, 20mS intervals, then it will occur at 20mS intervals. This works even if the controllers are in Program mode. NB. there is a 500 byte limit for Produced/Consumed tags, which can be of any type, except BOOL
For data that needn't be transferred continuously, then the message (MSG) instruction can be used to initiate the data transfer whenever you like. This data transfer can either be "Write" to the destination PLC, or a "Read" from the source PLC. Of course, data transfers using Messaging require the PLC to be in Run mode.
HTH