Can't cancel Modbus master comms on M340

rogerval

Member
Join Date
Jun 2008
Location
Glenella
Posts
3
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.
 
Hallo my friend! I wonder whether you found a sollution to your problem!?
You know, I've made a connection like yours (two modicon M340 plc's communicating each other with modbus read_var etc) but I don't ever cancel modbus master with cancel bit or with some other way. I have no problem till now.
If i don't ever cancel the read_var but always read_var asks, do you think that if a slave has some problem replying, I will also have a problem with my master? Have you had such a problem? Now you made me wonder!!!!šŸ™ƒ
 
Hi dimmitrisd,
You may have a problem, if the 12 seconds or so for the original message and the retries to complete is too long. What I eventually did was use a NOM0200 dedicated comms module, and adapted my program to use that device. It can dynamically switch from master to slave mode if required, but allows the programmer to vary the retries etc in it's master mode. I still haven't figured out how to set the Modbus address of the module, but in the application where I'm using it, the slave address is more important than the master address.
(There was also a work-around using the CPU modbus port, but it was quite messy to program. The NOM was a better answer in the end.)
I have to go now, but if you have any further questions, I can try and help you.
Kind regards,
Roger V.
 

Similar Topics

Sometimes I forget to cancel forced bits in omron CJ2M-CPU34 PLC. I want to cancel all forced bits automatically and found something about fins...
Replies
2
Views
1,678
Hi guys I was hoping to get some help with a recipe in pv 1000.Question that I have has to do with the "GOT TO SCREEN" in my case main menu button...
Replies
4
Views
1,487
Hello On the machine simatic cpu 314dp-drivers cominucate with profibus. I would like chnge drivers and use analoge output module. When i plug...
Replies
1
Views
2,997
Hi all, Currently having trouble getting a speed reference to write over modbus to an Omron M1... I can successfully write a run command and...
Replies
2
Views
23
Apologies for not being the best IDEC programmer. I recently was doing some inspections on a site that had 3 FC6A IDEC processors. The issue is...
Replies
0
Views
51
Back
Top Bottom