Initialize MODBUS

Slave side

Master side

#include <MB_SlaveData3.h>

// This is the easiest way to create new packets// Add as many as you want. TOTAL_NO_OF_PACKETS// is automatically updated.enum{ PACKET1, // leave this last entry TOTAL_NO_OF_PACKETS,};// this is my custom datatype transfered via modbust_MB_SlaveData3 modbusSlave1;

// Create an array of Packets for modbus_update()Packet packets[TOTAL_NO_OF_PACKETS];// Create a packetPointer to access each packet// individually. This is not required you can access// the array explicitly. E.g. packets[PACKET1].id = 2;// This does become tedious though...packetPointer packet1 = &packets[PACKET1];