You are not registered yet. Please click here to register!


 
 
plc storereviewsdownloads
This board is for PLC Related Q&A ONLY. Please DON'T use it for advertising, etc.
 
Try our online PLC Simulator- FREE.  Click here now to try it.

New Here? Please read this important info!!!


Go Back   PLCS.net - Interactive Q & A > PLCS.net - Interactive Q & A > LIVE PLC Questions And Answers

Reply
 
Thread Tools Display Modes
Old October 20th, 2021, 04:21 AM   #1
bb76
Member
United Kingdom

bb76 is offline
 
Join Date: Oct 2020
Location: UK
Posts: 23
MB_Client TIA Issue

I'm trying to set up some comms for a new bit of kit we're getting. The OEM has supplied a simulator software in order to do this.

I need to read 20 registers from the simulator over Modbus TCP from their Modbus server so I've created a MB_Client block and it's happily doing it's thing. The issue I have is that the values it is reading are jumping from the actual values to zeroes.

After trying different block versions, TIA versions, timers for the read request I noticed that in the MB_Client DB there are some temp data registers and the values are constant in there but the values being output from the block to my DB seem to jump to zero in line with the block active signal going false.

Has anyone got any idea what is happening here? We have a few of these blocks in other bits of kit and I can't see any differences in the config.

Edit: Also tried S7 1200 & 1500 but same issue.
  Reply With Quote
Old October 20th, 2021, 04:54 AM   #2
L D[AR2,P#0.0]
Lifetime Supporting Member
United Kingdom

L D[AR2,P#0.0] is offline
 
Join Date: Nov 2006
Location: UK
Posts: 6,305
Disable the modbus block and verify that nothing else is writing to your DB by modifying some values in the online view.
__________________
S7-300 to 1500 conversions done - email to s7conversions@hotmail.com
  Reply With Quote
Old October 20th, 2021, 05:10 AM   #3
bb76
Member
United Kingdom

bb76 is offline
 
Join Date: Oct 2020
Location: UK
Posts: 23
Quote:
Originally Posted by L D[AR2,P#0.0] View Post
Disable the modbus block and verify that nothing else is writing to your DB by modifying some values in the online view.
There is nothing else in the code at the minute, only the client block and my DB.
  Reply With Quote
Old October 21st, 2021, 02:20 PM   #4
Lare
Member
Finland

Lare is offline
 
Join Date: Jan 2006
Location: Finland
Posts: 1,727
Any screenshots of blocks or code?
  Reply With Quote
Old October 22nd, 2021, 08:13 AM   #5
RVaughan
Member
United States

RVaughan is offline
 
Join Date: Mar 2012
Location: Michigan
Posts: 75
First thought is, of course, post the code.
Second thought is, are any of the values stored in Temp variables? Inside optimized blocks the Temps are initialized each block call.
__________________
Seeking training, programming, service role in Auburn Hills, Michigan area. Siemens SiMgr/Portal, Rockwell 5000, safety PLCs. Trainer for the past three years, programmer for seven before that. 25% travel welcome. Part time/contract OK.
  Reply With Quote
Old October 22nd, 2021, 09:34 AM   #6
bb76
Member
United Kingdom

bb76 is offline
 
Join Date: Oct 2020
Location: UK
Posts: 23
Apologies, other work got in the way!

So a few pics for you.

Image 2 shows the client block.
Image 3 shows my DB containing the TCON IP v4 addressing tag and the array the data is being moved to. (note the data values are all zero)
Image 0 shows the same DB with actual values. Pics are a couple of seconds apart.
Image 4 shows the status code I've recorded as it operates. Mostly 7005/7006 (data being sent/received) but near the bottom of the pic there is 0000.

So the block is executing and receiving data but it seems like it drops connection for some reason.

Since the first post I've also used a red lion data station with the same addressing which works perfectly, so it's an option to use if I need to but if I can understand why the client block isn't happy it is much cleaner.
  Reply With Quote
Old October 22nd, 2021, 09:36 AM   #7
bb76
Member
United Kingdom

bb76 is offline
 
Join Date: Oct 2020
Location: UK
Posts: 23
Forgot the pics!
Attached Images
File Type: jpg image0.jpg (19.9 KB, 16 views)
File Type: jpeg image2.jpeg (108.5 KB, 16 views)
File Type: jpg image3.jpg (135.9 KB, 15 views)
File Type: jpg image4.jpg (119.2 KB, 14 views)
  Reply With Quote
Old October 22nd, 2021, 03:06 PM   #8
m_turk
Member
Croatia

m_turk is offline
 
Join Date: Jan 2008
Location: ZG
Posts: 249
- That "busy" bit on REQ.. I don't think you need it, and it might even cause problems. Try it with "always on".
- maybe the device can't reply so fast as you are calling it.. You'd then need an edge every second or two on REQ.
- I usually have a buffer, that would be your "MB_Data_Pointer". And another array and then If "done" move "MB_Data_Pointer" to Data_Array. That doesn't overwrite your data if there is an error.. Try that.
  Reply With Quote
Old October 22nd, 2021, 03:21 PM   #9
Lare
Member
Finland

Lare is offline
 
Join Date: Jan 2006
Location: Finland
Posts: 1,727
Quote:
Originally Posted by m_turk View Post
- That "busy" bit on REQ.. I don't think you need it, and it might even cause problems. Try it with "always on".
- maybe the device can't reply so fast as you are calling it.. You'd then need an edge every second or two on REQ.
- I usually have a buffer, that would be your "MB_Data_Pointer". And another array and then If "done" move "MB_Data_Pointer" to Data_Array. That doesn't overwrite your data if there is an error.. Try that.



MB_client needs rising edge on request input.


What I think is that MB_client is sending next request too soon as there is no delay after busy signal of same block is back to false.


MB_client takes several PLC cycles to operate so it can be timing error. Modbus query answer isn't processed before you send another message.


MB Serial coms makes CPU to fault if new request are sended faster than CPU can handle.

(At least on 300 series with same blocks)



Try clock bit to request (0,5s or 1second), will it work then?
Then make coms faster and look when it start to go wrong.
  Reply With Quote
Old October 23rd, 2021, 06:41 AM   #10
m_turk
Member
Croatia

m_turk is offline
 
Join Date: Jan 2008
Location: ZG
Posts: 249
Quote:
Originally Posted by Lare View Post
MB_client needs rising edge on request input.


What I think is that MB_client is sending next request too soon as there is no delay after busy signal of same block is back to false.


MB_client takes several PLC cycles to operate so it can be timing error. Modbus query answer isn't processed before you send another message.


MB Serial coms makes CPU to fault if new request are sended faster than CPU can handle.

(At least on 300 series with same blocks)



Try clock bit to request (0,5s or 1second), will it work then?
Then make coms faster and look when it start to go wrong.
Are you sure? I'm not sure for the MB TCP, but 100% sure for MB Serial in TIA that they changed the way REQ is handled (V14 or V15) and that you don't need the edge. It generates its own edge when not busy. I know because it was giving me problems with my routines where I was using 1s clock like you suggested, but the block went on and got more reads instead of one.

I agree that no delay on only one device might be giving him problems, but just putting the clock bit will make it read for half a second and then not read for half a second. That is why clock bit with edge is what I suggest..
  Reply With Quote
Old October 23rd, 2021, 06:52 AM   #11
Lare
Member
Finland

Lare is offline
 
Join Date: Jan 2006
Location: Finland
Posts: 1,727
Quote:
Originally Posted by m_turk View Post
Are you sure? I'm not sure for the MB TCP, but 100% sure for MB Serial in TIA that they changed the way REQ is handled (V14 or V15) and that you don't need the edge. It generates its own edge when not busy. I know because it was giving me problems with my routines where I was using 1s clock like you suggested, but the block went on and got more reads instead of one.

I agree that no delay on only one device might be giving him problems, but just putting the clock bit will make it read for half a second and then not read for half a second. That is why clock bit with edge is what I suggest..



Haven't tested it lately. Over one year when last time played with modbus and MB_client block.



Pretty sure that block needed square wave on reguest pin earlier. Then it maked rising edge inside of block.


If reguest pin was setted only to allways on state, then it only sended one reguest, not multiple ones.



I should test with V16 to be 100% sure, but no time for that.


Rising edge outside of block at least don't make multiple requests.






p.s

On old communication manual there was example that request pin is controlled by anothers MB_cliet block's done and error bits.

First block is started with first_scan bit and if another block is done or error.



Done and error bits are true only one scan so maybe r_trig is need outside. (or use done and error bits)

Last edited by Lare; October 23rd, 2021 at 06:59 AM.
  Reply With Quote
Old October 23rd, 2021, 06:59 AM   #12
m_turk
Member
Croatia

m_turk is offline
 
Join Date: Jan 2008
Location: ZG
Posts: 249
Quote:
Originally Posted by Lare View Post
Haven't tested it lately. Over one year when last time played with modbus and MB_client block.



Pretty sure that block needed square wave on reguest pin earlier. Then it maked rising edge inside of block.


If reguest pin was setted only to allways on state, then it only sended one reguest, not multiple ones.



I should test with V16 to be 100% sure, but no time for that.


Rising edge outside of block at least don't make multiple requests.
Yeah, it worked like that, I know. But it doesn't for MB_Master anymore so I guess it is the same with MB_Client. And don't want to use the weekend for testing either, lol..


He can't go wrong with the rising edge outside the block, then it will do just one no matter how it works internally..
  Reply With Quote
Old October 23rd, 2021, 07:10 AM   #13
Lare
Member
Finland

Lare is offline
 
Join Date: Jan 2006
Location: Finland
Posts: 1,727
Quote:
Originally Posted by m_turk View Post
Yeah, it worked like that, I know. But it doesn't for MB_Master anymore so I guess it is the same with MB_Client. And don't want to use the weekend for testing either, lol..


He can't go wrong with the rising edge outside the block, then it will do just one no matter how it works internally..





Quick googling gived this manual for 2019.

https://cache.industry.siemens.com/d...s7-1200_en.pdf


Chapter 4 on page 19.


MB_scleint and server


request:


Modbus request to the Modbus server, for example:
Write holding register
Read holding register
The "request" parameter is level controlled. This
means that the instruction sends communication
requests for as long as the input is set.





I undestand it that way that rising edge is needed outside of block.
  Reply With Quote
Old October 23rd, 2021, 07:19 AM   #14
Lare
Member
Finland

Lare is offline
 
Join Date: Jan 2006
Location: Finland
Posts: 1,727
Quote:
Originally Posted by m_turk View Post
But it doesn't for MB_Master anymore so I guess it is the same with MB_Client.



You probably meaned to write
"But it doesn't for MB_server anymore so I guess it is the same with MB_Client."





As MB_Master is same than MB_client and MB_Server is same than slave.
  Reply With Quote
Old October 23rd, 2021, 07:19 AM   #15
m_turk
Member
Croatia

m_turk is offline
 
Join Date: Jan 2008
Location: ZG
Posts: 249
Quote:
Originally Posted by Lare View Post
Quick googling gived this manual for 2019.

https://cache.industry.siemens.com/d...s7-1200_en.pdf


Chapter 4 on page 19.


MB_scleint and server


request:


Modbus request to the Modbus server, for example:
Write holding register
Read holding register
The "request" parameter is level controlled. This
means that the instruction sends communication
requests for as long as the input is set.





I undestand it that way that rising edge is needed outside of block.
Yup. That is how I thought it works now..

Edge outside to achieve the delay we both think he needs.
  Reply With Quote
Reply
Jump to Live PLC Question and Answer Forum

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Topics
Thread Thread Starter Forum Replies Last Post
Issue Changing IP on TP700 (WinCC / TIA Portal v14) kdcui LIVE PLC Questions And Answers 8 October 8th, 2019 03:28 PM
How to upload Siemens TIA v10.5 if I have just TIA 11 / TIA 12 lefarias LIVE PLC Questions And Answers 13 June 17th, 2019 08:50 PM
TIA V15 install issue putiss LIVE PLC Questions And Answers 2 July 18th, 2018 09:49 AM
TIA V13 SP1 keeps crashing!! Traloch LIVE PLC Questions And Answers 2 September 21st, 2015 11:11 AM
TIA Portal and SFB52/53 Michal_dk LIVE PLC Questions And Answers 1 June 15th, 2015 06:55 AM


All times are GMT -4. The time now is 07:06 PM.


.