Shone Posted August 6, 2020 Report Share Posted August 6, 2020 Hello everyone, I’m trying to send an email via socket 3 and as long as exist connection between PC and PLC (online) LAN, everything works fine, but as soon as I disconnect PC and try to send, SB150 remains 0. Socket 3 not connected. I am making a mistake and would be appreciate if someone can help me with it. Pictures of Ladder are attached. Thank you in advance Link to comment Share on other sites More sharing options...
MVP 2023 Flex727 Posted August 6, 2020 MVP 2023 Report Share Posted August 6, 2020 You have several problems here. What is the purpose of MB 146? Do NOT do conditional subroutine calls. It is also very inadvisable to do conditional Socket initializations, especially here where it is completely unnecessary. Please post your program here. We need to see inside your function blocks to provide any meaningful help. Link to comment Share on other sites More sharing options...
Shone Posted August 7, 2020 Author Report Share Posted August 7, 2020 Hello Flex, Thanx fot the quick answer. MB146, end of the day desperate try to change something... The program is attached. Link to comment Share on other sites More sharing options...
Annatooli Posted August 8, 2020 Report Share Posted August 8, 2020 One possible problem is in first net where you SET and RESET MB 501. It would be fine this way, if you wont use this bit also in net. What happens behind the scenes is - Visilogic stores old value into temporary value and uses it instead of freshly setted bit itself. Try splitting this net in two. Link to comment Share on other sites More sharing options...
MVP 2023 Flex727 Posted August 10, 2020 MVP 2023 Report Share Posted August 10, 2020 On 8/8/2020 at 5:17 PM, Annatooli said: Try splitting this net in two. NEVER place multiple logic threads into a single ladder rung. Separating the logic threads is what the ladder rungs are there for. Sometimes it will work, but without evaluating the compiled code or the STL, you can get unpredictable results. Link to comment Share on other sites More sharing options...
stembera Posted September 5, 2020 Report Share Posted September 5, 2020 Maybe I am too late here but nobody noticed risky using of rise edge of MB501 in Rung 1. When MB500 goes on, then MB501 is activated. This is the only case when second line of the Rung 1 is active. In situation when neither (SB146 = 1 and SB151 = 1 and SB146 = 1) nor (SB150 = 1) the MB501 never goes off so the TCP Connect Socket 3 is never called again until power cycle of PLC. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now