PaulZ Posted February 18, 2019 Report Posted February 18, 2019 (edited) Hello All, I just got a new PLC so I could continue my development of the application. I am getting there slowly but surely, still learning a lot.. There is one issue I cannot fix. The issue is that I use a MI to store the converted value of a 4 - 20mA pressure transmitter, and display this at two different HMI displays. On one HMI display, "Manual", it shows the correct value, while on the other HMI display it consistently shows 0.01. The strange thing is that the bar graph right above the 0.01, which is using the same MI, shows the correct indication... I have tried changing the sizes of the indication, till like 3x required size, removed it, and re-inserted it, but no luck. What am I missing here? I have attached the project files, and some screenshots of the configuration of all the elements. The conversion is done at ladder rung 1 in the main routine, and in online mode I can see that it all works as expected. (As can be proven by the right indications) Thanks in advance for your time... Paul Config: Conversion: Working indication: Working graph bar: NOT working indication: Starting Air Compressor Control Panel - v0.51.vlp Online checks. Correct (working): Not correct (not working): Edited February 18, 2019 by PaulZ Put some headers above images
MVP 2023 kratmel Posted February 18, 2019 MVP 2023 Report Posted February 18, 2019 Please try to store MI3 to another one and place it as MI to display on not correct screen.
MVP 2023 kratmel Posted February 18, 2019 MVP 2023 Report Posted February 18, 2019 Program tested on V1040 - the same issue present. STORE to another MI make correct variable indication. But why original prog do not work??? I try to use original prog and delete trend - indication is correct. I use another stored MI in trend and indication is correct also.
PaulZ Posted February 18, 2019 Author Report Posted February 18, 2019 38 minutes ago, kratmel said: Please try to store MI3 to another one and place it as MI to display on not correct screen. That works... 🙂 But why? What is the "difference"? Is it a bug...?
PaulZ Posted February 19, 2019 Author Report Posted February 19, 2019 1 hour ago, kratmel said: Program tested on V1040 - the same issue present. STORE to another MI make correct variable indication. But why original prog do not work??? I try to use original prog and delete trend - indication is correct. I use another stored MI in trend and indication is correct also. I see that my reply is below yours. I didn't see this answer before. I am happy to find out it isn't just me who is confused.. haha I can live with the solution of using another MI, but it is strange. Now off to getting the trends to work, and then I'm done! Thanks Kratmel!
MVP 2023 Ausman Posted February 19, 2019 MVP 2023 Report Posted February 19, 2019 Hi Paul, in quickly looking at your program there are a few standout things that I would be doing very differently. 1). As Flex is fond of saying...."Unitronics don't charge for ladder rungs". You have way too much happening in a lot of rungs. eg Main routine 7. Sometimes things don't work as you would expect with too many things bundled into the same rung, due to the way things happen internally. It might work, but it is often way easier to troubleshoot later if things are broken down into separate areas. There is nothing wrong with using an MB as a "sub-controlling" bit to do the same trigger over and over in progressive rungs to prevent trying to do it all in one. 2). MRoutine rung 15 why use set and reset on actual outputs? Set and reset can lead to all sorts of issues. Much better to have them as power up as "none" and normal controls make them on or off. If you really need things to boot to a certain setting, in the Output list you can see a "power plug" and you can choose what state you want things to boot to, None, Set, Reset, but remember that immediately anything else in the program tells the output to do the opposite action it will occur. Edit: use -( )- as the coil. 3). Without a deeper look, it is possible that your way of using MBs linked to displays is causing issues. I always try to use the ON state of such an MB as the trigger for any ladderwork, and said ladderwork is often in a subroutine that is only run when the screen is active. Your method of using -[ / ]- to say a display is not on might be the reason for the hiccouph. Once you get more used to programming, you inevitably come back to something you first did and go "why in the world did I do it that way?!!" But keeping on at things and learning all the time is part of the process. As you are doing. cheers, Aus
MVP 2023 Flex727 Posted February 19, 2019 MVP 2023 Report Posted February 19, 2019 Excellent response from Ausman. I'll add one more thing in the interest of good programming practice - do NOT have conditional subroutine calls. In rung 16 of the Main Routine, the direct contact of MB 4 is totally unnecessary. There's nothing wrong with separating out your button check into a separate subroutine if you wish, but there's no reason to only call it when that screen is displayed. Same with rung 17, and also in rung 18. Rung 18 isn't a conditional subroutine call, but MB 6 is totally unnecessary. If you want all that stuff in one ladder rung, then replace MB 6 with SB 1. Regarding the incorrect display of MI 3. That is only occurring when you have the Trend graph displayed. And it's not being displayed incorrectly - MI 3 is being overwritten by the value "1" when the Trend is on screen. I don't have time to go through your Trend graph setup in detail, but look there for your problem. Perhaps delete it and re-create it if you can't find the issue.
PaulZ Posted February 19, 2019 Author Report Posted February 19, 2019 36 minutes ago, Flex727 said: Excellent response from Ausman. I'll add one more thing in the interest of good programming practice - do NOT have conditional subroutine calls. In rung 16 of the Main Routine, the direct contact of MB 4 is totally unnecessary. There's nothing wrong with separating out your button check into a separate subroutine if you wish, but there's no reason to only call it when that screen is displayed. Same with rung 17, and also in rung 18. Rung 18 isn't a conditional subroutine call, but MB 6 is totally unnecessary. If you want all that stuff in one ladder rung, then replace MB 6 with SB 1. Hi Flex, Thanks for the hints. I am editing the ladder at the moment using these hints 🙂 . As I said before, it is a (steep) learning curve, and slowly but surely I am getting there... 37 minutes ago, Flex727 said: Regarding the incorrect display of MI 3. That is only occurring when you have the Trend graph displayed. And it's not being displayed incorrectly - MI 3 is being overwritten by the value "1" when the Trend is on screen. I see where I went wrong... When I initially put the HMI together I did not have the PLC yet to try things out yet. I see that in the "Link" I indeed used MI 3... I think I assumed that was the value to be displayed. And now I know better, but it never dawned on me to check that config... Thanks again for your time Paul
MVP 2023 Ausman Posted February 19, 2019 MVP 2023 Report Posted February 19, 2019 I wish I had a model of each type of Vision so that I could load up people's programs to check them "in the flesh", as issues are always easier to find. But sadly I don't, and never will unless Unitronics does some donations to everyone who needs them on the forum! And sometimes I can't spend a heap of time going through the program in Visi to find a hiccouph! One of the hardest things in the world is going through someone else's program to find a fault. We all do things differently! Good call Flex, and keep at it, Paul. cheers, Aus
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