Are you using the GSEDRV100 card? If so, set it up as Ethernet I/O Slave (NOT EtherNet/IP - that is something completely different). The PLC handles all the comm intelligently as part of the "native" PLC I/O and sticks the critical GS drive parameters into its own GSDrv structure (e.g. GSDrv.Direction bit). Because it's treated as PLC I/O, the GSEDRV100 handles mode changes properly. No ladder logic to write. No Modbus instructions (although there are GSREGRD and GSREGWR instructions that do Modbus behind-the-scenes for reading/writing any of the Px.x parameters)
If you are doing it "by hand" (i.e. no GSEDRV100 card), I think there might be a "run" relay you could hard-wire from the PLC to the drive? ? ? Sadly, you can't do a comm request in the "last scan". When the PLC goes to STOP/PGM mode - it can't execute any ladder logic. If you hard wire the "run" relay to the PLC, Y's automatically turn OFF when the PLC goes to PGM mode.