Modbuss Communication error between Modicon m340 and altivar 71

Hey Guys, i made a communication between modicon m340 cpu 2020 and altivar 71 through modbus using writevar function as shown in the following pictures. sometimes it works and the motor runs, and othertimes, the driver enters a stop mode called ‘‘NST’’, any help please?

take a look here

https://www.schneider-electric.com/en/faqs/FA175942/

i think number 4 may be your problem, check if write correct values.