-
Posts
3,325 -
Joined
-
Last visited
-
Days Won
241
Content Type
Profiles
Forums
Gallery
Events
Blogs
Downloads
Articles
Media Demo
Posts posted by Flex727
-
-
20 minutes ago, Arberhaziri said:
(not every time that PLC is one in that day)
This leads me to believe that the PLC might not be on at midnight on occasion. In that case it gets a bit more complicated. If that's the case, I'll leave it to you to attempt that and you can let us know if you need help.
-
There are a number of ways to do this. One easy way is to compare SI 35 to a number from 0-23 and activate a bit when the compare is true. If you want something to happen every day at midnight, it might look something like this:
I didn't complete ladder rung 2 - you would place the task(s) you want to accomplish there.
-
This kind of thing is easy to create in Microsoft Paint. Here is what I created and use. You're welcome to use or modify as you see fit.
Slide Switch Red_Left.bmpSlide Switch Green_Right.bmpSlide Switch Green_Left.bmpSlide Switch Red_Right.bmp
-
1 hour ago, krolikbest said:
My thinking was like a pc-programmer
That's extremely common - probably the most difficult thing for computer programmers to overcome when programming PLCs. I also come from a computer programming background and it took me awhile to get my mind right for PLCs.
-
And to expand a bit for anyone unfamiliar with Ladder Logic. In normal computer programming, subroutines are typically used to execute some code under certain specific conditions (e.g. a print subroutine would only be executed when the operator issued a print command). This should not be done in Ladder Logic - subroutines should only be used to organize your code into manageable chunks, but every subroutine should be executed on every scan. You have to have a bit of a different mindset when creating proper code in Ladder Logic.
-
Do NOT perform conditional calls of subroutines. It is BAD practice.
In this situation, I think you're under the mistaken impression that since you've SET MB 2012 in the rung where you're calling the subroutine, that the subroutine will be called as long as MB 2012 remains SET. That is NOT the case.
-
Please don't generate duplicate posts. Keep in mind that this is a user forum staffed by volunteers, most of whom are not Unitronics employees. You will not get instant answers to your problems. If you cannot wait for help here, you can contact Unitronics Support at support@unitronics.com. They are pretty good at getting back to you within 24 hours or so.
-
Unless the pumps run constantly, you will need a contact at the beginning of ladder rung 4 in Ausman's example to allow ML 4 to only increment when the pump is running.
47 minutes ago, neil76 said:I presume I will require a separate counter for every item that would be in my final programme this would be around 30.
Yes, unless all items always run together at the same time.
-
The way I do this is to use SB 13 to increment an integer operand (probably ML or DW), then divide the result by 360. This gives you operating hours to the tenth of an hour.
-
3 hours ago, Isakovic said:
Turns out you don't need to have defined slave addresses in Modbus Configuration FB.
Wow, this is interesting news. It seemed to me that I had problems at one time with the slave address incorrect in the Config FB, but maybe I'm misremembering. This is great information to file away for future reference. Thanks @Isakovic for taking the time to collect the data!
-
Did the IT contractor forward port 20256 to the correct IP address of the PLC? Is there any firewall in place that might prevent access? Is the Default Gateway set correctly in the PLC? Are you certain about the external IP address (can you ping it from your phone)? Are you sure your phone is trying to connect through cellular and not through wifi?
I have done this many times and usually have no issue as long as the addressing is correct.
-
You are initializing and using Com Port 3. I don't have a Samba in front of me and haven't checked the specs lately, but I don't think there are 3 Com Ports available. Try changing to Com 1.
-
3 hours ago, Isakovic said:
I'm not sure about reinitializing Configuration FB. It does have addresses for only 15 slaves,
I'm sure you're correct about not needing to reinitialize the FB in normal situations, but I assumed it would be necessary at some point if you have more than 15 slaves. I thought it would be simpler to have a single routine that repeats for each of the 20 slaves. You could do 10 and 10, but I don't think it saves any time as the FB initialization appears to complete in a single PLC scan.
- 1
-
On 6/10/2020 at 4:23 AM, newbie88 said:
So do i need to close/open socket every time when i'm reading values out of it upon the complete switching?
My understanding of MODBUS TCP is that you MUST Connect with each device you communicate with. To connect to a different device using the same socket, you must Disconnect, re-initialize the MODBUS Configuration FB, then Connect to the new device. You have System Bits that will help you determine the status of all this, but I would use timers to be sure sufficient time has occurred for all the operations to complete. I would expect communication with 20 slaves to take perhaps a couple of minutes if you want it to be 100% reliable.
- 1
-
Are you talking about serial communication settings or what?
-
You will need to re-load the program. It is no longer in the PLC.
-
5 minutes ago, Ausman said:
Hmmmm. I have great mental pictures of you restlessly prowling around the house waiting for midnight to tick over. Coffee jitters, keys jangling in hands, can't wait to push the right one in and turn it!
Eerie! It's like you were there.
- 1
-
I believe you should see SB 148 ON when you are connected with Remote Operator (assuming you are using the default Socket 1 for PC-PLC communications).
- 1
-
1 hour ago, Ausman said:
And they even have stuff ready made for Unitronics gear.
Okay, this rocks. Great find, @Ausman!
-
Good question! I hope someone finds an answer.
-
I had a Hyundai Santa Fe once upon a time that strangely had the calendar date displayed on the dash. It was set with the month day and year and knew which years were leap years. However, the subroutine that it went into to allow February to have more than 28 days failed to have an exit. So, on leap years it would continue to count up from February 29th, each day incrementing up. It was easily fixed by resetting the date to March 1st, but I had to see what it would eventually do. Each day it incremented up until it hit February 99th, and since there were only 2 digits, I couldn't wait to see what it would do the next day. You would have thought that maybe it would go to 00, but it didn't. It completely lost its mind and displayed nonsense symbols every day thereafter.
- 3
-
11 hours ago, Joe Tauser said:
I believe you that Modbus IP takes over and won't let go.
Before I wrote my comment I re-created his routine with just one socket and tried everything I could to get the MODBUS configuration to let go without a PLC reset. Nothing worked. I was very surprised. I also took a look at the System Integers that denote socket configuration, but they are all read-only. I'm thinking Unitronics needs to address this if possible.
-
As far as I can tell, you cannot change the configuration (as opposed to the protocol) of a socket without a configuration FB. It seems that the socket initialization (or card initialization) should reset the configuration, but it doesn't except by PLC reset. Since there is no PCOM configuration FB that I am aware of, it seems that a PLC reset is your only option. You might want to contact Unitronics support to confirm this, and if confirmed, request they add the feature on a future update to VisiLogic.
I'd like to find out that I'm wrong about this as I think it's an oversight by Unitronics.
-
19 minutes ago, Joe Tauser said:
If you want decimal points do everything in MF data types and build your formula out manually.
Or do some math ahead of the formula block to ensure any division results with integers are greater than 1 and big enough to provide the needed precision. Then you can sort out the decimal location afterward.
Schedule a task to happen everyday
in Vision & Samba PLC + HMI Controllers & VisiLogic Software
Posted
So you want the event to occur every day the first time the PLC is powered on?