TIA - why isnt this working?

rQx

Lifetime Supporting Member
Join Date
Oct 2010
Location
Trelleborg
Posts
1,051
Hi!
I have a working modbus RTU routine, but I get some errors sometimes so I wanted to add some delays between REQs. I didnt get it to work so I scaled the FB down to minimum but it still doesn't work. Shouldnt the two programs act the same? I get error 8200 (the port already in use with another request. So I get almost constant errors.
The FB has the same logic as when I dont use the FB. Is it processed some other way?

1. working
2. FB
3. Not working

working.PNG FB.PNG not working.PNG
 
I dont understand the idea of querying the ENO with a NOT. The code after the NOT only executes when there is an internal error in the FB, not if there is an error with the modbus comms. And that is unlikely to happen.
 
I dont understand the idea of querying the ENO with a NOT. The code after the NOT only executes when there is an internal error in the FB, not if there is an error with the modbus comms. And that is unlikely to happen.

I think that the ENO goes true when it's executed with no error and it stay false when error. It's taken from example in TIA help file.

Thanks for the input but that is not what I needed help with since both "examples" share the same result handling
 
The error handling is not what this thread is about. It is about the REQ handling. The error handling is taken from TIA portal sample program and seems to be working fine, giving me error bool and error holding when there is error on the block

It is the REQ handling I wan't to discuss :)
 
Agreeing with the others, ENO is rarely false..
Maybe if you supply faulty parameters to the MB-block.
Consider changing it.

Why are you using type in/out in your FB?
Is there a reason, because itÂ’s rarely needed...
I donÂ’t se the need in your case, change to in for the inputs and out for the output.
I donÂ’t understand your system, but make sure to call your fb before MB-fb.
Try that and get back. Also, check for crossreference. That array-bit is maybe used elsewhere?

And...consider leaving ladder :geek:
 
Agreeing with the others, ENO is rarely false..
Maybe if you supply faulty parameters to the MB-block.
Consider changing it.

Why are you using type in/out in your FB?
Is there a reason, because itÂ’s rarely needed...
I donÂ’t se the need in your case, change to in for the inputs and out for the output.
I donÂ’t understand your system, but make sure to call your fb before MB-fb.
Try that and get back. Also, check for crossreference. That array-bit is maybe used elsewhere?

And...consider leaving ladder :geek:

As I said it is used like this in example in TIA help file, and it works. It seems like ENO is false when the block return error status

The whole modbus sequence is working, fault handling , req handling etc. But when I add the FB, it doesnt. It is called before the mb.

In/out is used because I had a more complex FC before as I stated. So when trying to find why it did not work I havent changed it to I and O , but it shouldn't matter.

Array bit only used here.

Im sure I've missed something basic :)
 
Please post better/full screenshots with no errors.
Image "not_working" has an FB without a valid DB instance assigned to it and what's more unclear is that has the same name as the FB in image "FB" but withe entirely different parameters. All three images are cutoff at a point where it is impossible to determine either the name or the number of the FB.
 
Last edited:
Better picture and I have tried to make it more understandable.
And to be clear, it's the REQ handling I'm curious about.

The working example is running 20 instances of MB_master.

After each DONE or ERROR it moves to next seq, in the end it moves back to seq=0.

The not working example is running the exact same program, but I wanted to have the REQ in a FC/FB to be able to add time, compares etc.

http://www.plctalk.net/qanda/attachment.php?attachmentid=57787&stc=1&d=1616741483

Not working.jpg
 
It does look like the code should work the same.
Cant you monitor the code online to see where it goes wrong ?
If the sequence changes too fast to follow, you can setup a trace of the relevant variables.
 
It does look like the code should work the same.
Cant you monitor the code online to see where it goes wrong ?
If the sequence changes too fast to follow, you can setup a trace of the relevant variables.

I can see the working version sequencing through the sequence. I think the non working is also sequencing it, but to fast to see. I get errors from the maste blocks 8200 (port already in use) suggesting it does sequencing but overlap the REQs. I will try to make a trace ( have never used but good to learn)
 
Is there a timing difference when the source of the REQ input is evaluated between the two cases?


The modbusRtuReqHandlingFB be converted to an FC; if that was done, the could not its ENO be connected to the MB_MASTER REQ input?



What happens in the working case if we

  • remove the rung feeding REQ,
  • duplicate the FB behavior ([NC .loadMaster.done] AND [== .control.modbusSequencer 0] => .control.req[0]) before the run with MB_MASTER
  • feed the MB_MASTER.REQ with .control.req[0]
?




TL;DR


Assuming it has but the one rung, the FB does not require any InOuts: IN/OUT_seq can be an Input (IN_seq); IN/OUT_req can be an Output (OUT_req)


modbusRtuReqHandlingFB can be an FC, and its ENO could replace .control.req[0], as noted above
 

Similar Topics

Hi guys , I'm new with Allen Bradley, but I have experience with Tia portal (s7 1200 ,s7 1500) I want to convert my project from Tia portal to...
Replies
1
Views
87
Hi, I have had problem with upgrading some projects from v16 to v18. I tried it on 3 diffrent computers. I want to post this so that anyone that...
Replies
3
Views
109
Hello gentlemen, Im working on a small project on TIA Portal, about establishing a Modbus TCP connection between my ET200SP plc and a socomec...
Replies
11
Views
253
I am currently am in a PLC class and need urgent help on how the ladder logic would be laid out. I understand how to get the traffic lights to...
Replies
19
Views
410
Hello, If the date on the license manager of tia Portal has expired, can I still work with it? or is this just to keep the program up to date...
Replies
7
Views
194
Back
Top Bottom