Hello everyone,
I've been working on a Modicon M340 project using a CPU BMX P34 2020 processor, making use of its serial port to do Modbus master communication with a Modbus slave PLC, a Modicon Compact 984, connected via a radio link. Each of these PLCs control it's own sugarcane railway locomotive, and they can operate as master or slave. (I should acknowledge that I had a well designed program from the original 984 PLC to base my M340 program on, thankfully.)
Well, the communication seems to go very well indeed, using Read_Var and Write_Var blocks in a FBD program in the M340. (That's once I'd worked out _exactly_ how to use Unity's powerful functions.) But when I try to cancel a communication using the Cancel function, (during testing, I'd disable the slave so it couldn't reply, to see what happened) it seems as if the M340 PLC ignores the Cancel function, and just keeps on with the three retries and three second timeouts.
I call the Cancel function while the Read_Var or Write_Var function is still active, and use the current communications number, and there appear to be no errors from the Cancel function, so why doesn't the Cancel function work?
I've also tried using the "cancel bit" made available with the read_var and write_var blocks, but that doesn't seem to work either.
Hoping I'm not the first who's had this problem,
Kind regards,
Roger Valmadre.
I've been working on a Modicon M340 project using a CPU BMX P34 2020 processor, making use of its serial port to do Modbus master communication with a Modbus slave PLC, a Modicon Compact 984, connected via a radio link. Each of these PLCs control it's own sugarcane railway locomotive, and they can operate as master or slave. (I should acknowledge that I had a well designed program from the original 984 PLC to base my M340 program on, thankfully.)
Well, the communication seems to go very well indeed, using Read_Var and Write_Var blocks in a FBD program in the M340. (That's once I'd worked out _exactly_ how to use Unity's powerful functions.) But when I try to cancel a communication using the Cancel function, (during testing, I'd disable the slave so it couldn't reply, to see what happened) it seems as if the M340 PLC ignores the Cancel function, and just keeps on with the three retries and three second timeouts.
I call the Cancel function while the Read_Var or Write_Var function is still active, and use the current communications number, and there appear to be no errors from the Cancel function, so why doesn't the Cancel function work?
I've also tried using the "cancel bit" made available with the read_var and write_var blocks, but that doesn't seem to work either.
Hoping I'm not the first who's had this problem,
Kind regards,
Roger Valmadre.