salt Posted May 18, 2022 Report Share Posted May 18, 2022 Hello, I am programming the Vision 350 in Visilogic. In the design of the process loop some conditions lead to simultaneous (or parallel) outputs. In the program, some of thoses outputs are represented internally by memory bits to be true or false before actual output in the scan cycle. The problem: putting coils (the "internal" MBs I mentioned above) in parallel does not trigger all of them. See net below: Trying an alternative doesn't work either: Any suggestions? Quote Link to comment Share on other sites More sharing options...
AlexUT Posted May 18, 2022 Report Share Posted May 18, 2022 Coil cannot be used as condition. When activate coil - you have to use the same MB's contact as condition. Quote Link to comment Share on other sites More sharing options...
salt Posted May 18, 2022 Author Report Share Posted May 18, 2022 5 minutes ago, AlexUT said: When activate coil - you have to use the same MB's contact as condition. That is what I did in the first option. Quote Link to comment Share on other sites More sharing options...
DanT Posted May 18, 2022 Report Share Posted May 18, 2022 Hi; Where are you using these coils as coils else where in your program? If you use a coil as a coil say 3 times in a program, only the last state of the coil is valid at the end of the program scan. Remember a PLC Scan starts at the top and ends at the bottom. Coils MB 312,313,314 and 317 must have other factors controlling them. Can you post a copy of your program. DanT Quote Link to comment Share on other sites More sharing options...
AlexUT Posted May 18, 2022 Report Share Posted May 18, 2022 You use Inverted Coils - look Help for description. It will be good if you create test project with onlu elements you use and test. Then post project if you have trouble. Quote Link to comment Share on other sites More sharing options...
MVP 2022 Flex727 Posted May 18, 2022 MVP 2022 Report Share Posted May 18, 2022 Search your program for each coil that is not working properly. Almost certainly you have duplicate coils. Ladder logic does not allow duplicate Direct or Inverted coils (you can have duplicate Set & Reset coils). You can also perform a Project Optimizer under the Build menu to get a list of all duplicate coils. Also, there is no difference between coils set up in parallel or series in VisiLogic (other programming software can differ). I would also suggest avoiding using inverted coils routinely. It can be a bit confusing and it's usually just as easy to change the logic a bit and use direct coils. This is just a matter of programming style and won't affect the way your program works. Quote Link to comment Share on other sites More sharing options...
MVP 2022 Ausman Posted May 18, 2022 MVP 2022 Report Share Posted May 18, 2022 As I was about to post, Flex's answer popped up with a bit of stuff I've already written, so I'll leave it in anyway. In the Help files, go to Search and search for Ladder Net. On top of this knowledge, my personal preference is to NEVER use Inverted Coils. I've said a similar thing elsewhere on the forum, but the gist of it is to only use a particular way of operating something throughout your program. Using controls that invert the coil can get very confusing and hard to keep track of. This is probably why you've got the result you have. Bearing a whole host of other potential things in mind, you can easily do the idea of what you want to do using Vector Store, addressing a sequential number of MBs in one hit. cheers, Aus Quote Link to comment Share on other sites More sharing options...
MVP 2022 Flex727 Posted May 18, 2022 MVP 2022 Report Share Posted May 18, 2022 Here is the way I would have done ladder rung 8: Quote Link to comment Share on other sites More sharing options...
salt Posted May 18, 2022 Author Report Share Posted May 18, 2022 Thanks for the helpful comments. A description of the program : There are several modes of operation: 1- Standard process according to set points (3 temperatures and 1 relative humidity) by which some of 8 outputs are ON and some OFF in 8 states (combination matrix of 3 temperatures and 1 rh). 2- external (by modbus) main switch. When on - the operation is same as (1), otherwise shut down of all outputs in particular order. 3- operation in case of operational problems (detected by digital inputs). In this case, and depending on the detected fault , some of the outputs go off and stay that way for several minutes. Based on this I decided to dedicate each mode of operation to its own subroutine which run one after another, wherein 8 internal MBs change state before actual output. Thise are overriden in order: mode 1 then 2 and last 3. So the last mode turns off relevant MBs set beforehand. The snippets I posted above are from the third subroutine (events). Now, I see that I should have used resets instead of inverted coils, because I need only to turn false some of the MBs. DanT -so yes because of this coils were true instead of just going false in this subroutine. Ausman, I'll consider your suggestion on using vectors instead of MBs. I tell you all this because maybe you have another idea for the design of the entire program. Quote Link to comment Share on other sites More sharing options...
Fernando Castro Posted May 18, 2022 Report Share Posted May 18, 2022 1 hour ago, salt said: Hello, I am programming the Vision 350 in Visilogic. In the design of the process loop some conditions lead to simultaneous (or parallel) outputs. In the program, some of thoses outputs are represented internally by memory bits to be true or false before actual output in the scan cycle. The problem: putting coils (the "internal" MBs I mentioned above) in parallel does not trigger all of them. See net below: Trying an alternative doesn't work either: Any suggestions? Your problem is somewhere else on your code, I bet you. Those rungs both are correct.... assuming you are not using both at the same time because as mentioned by other you can not use a coil twice 1 hour ago, AlexUT said: You use Inverted Coils - look Help for description. It will be good if you create test project with onlu elements you use and test. Then post project if you have trouble. I dont think that this is the case that @salt has mistaken inverted coils with normal coils Quote Link to comment Share on other sites More sharing options...
Fernando Castro Posted May 18, 2022 Report Share Posted May 18, 2022 1 hour ago, Ausman said: As I was about to post, Flex's answer popped up with a bit of stuff I've already written, so I'll leave it in anyway. In the Help files, go to Search and search for Ladder Net. On top of this knowledge, my personal preference is to NEVER use Inverted Coils. I've said a similar thing elsewhere on the forum, but the gist of it is to only use a particular way of operating something throughout your program. Using controls that invert the coil can get very confusing and hard to keep track of. This is probably why you've got the result you have. Bearing a whole host of other potential things in mind, you can easily do the idea of what you want to do using Vector Store, addressing a sequential number of MBs in one hit. cheers, Aus I agree, and inverted coils is a thing that I have never seen before using unitronics... its confusing however there is one use case that works greate with inverted coils.... Hide bit for HMI elements 😅 now you have an Show element instead of hide 1 Quote Link to comment Share on other sites More sharing options...
MVP 2022 Flex727 Posted May 18, 2022 MVP 2022 Report Share Posted May 18, 2022 1 hour ago, Fernando Castro said: however there is one use case that works greate with inverted coils.... Hide bit for HMI elements 😅 now you have an Show element instead of hide 👍 Wouldn't it be great if they offered a checkbox on the HMI element to allow the bit to be used for either hide or show. Quote Link to comment Share on other sites More sharing options...
sgull Posted May 18, 2022 Report Share Posted May 18, 2022 6 hours ago, salt said: Based on this I decided to dedicate each mode of operation to its own subroutine which run one after another, wherein 8 internal MBs change state before actual output. Thise are overriden in order: mode 1 then 2 and last 3. So the last mode turns off relevant MBs set beforehand. Hi Salt Looking at your statement above I am wondering how you are calling your sub-routines. If you are using conditional calls on the subroutines you will get situations like you describe in your first post. If the routine is not being called continuously coils may just hold the last state before you stopped calling the subroutine. Regards Denis Quote Link to comment Share on other sites More sharing options...
salt Posted May 19, 2022 Author Report Share Posted May 19, 2022 10 hours ago, sgull said: Hi Salt Looking at your statement above I am wondering how you are calling your sub-routines. If you are using conditional calls on the subroutines you will get situations like you describe in your first post. If the routine is not being called continuously coils may just hold the last state before you stopped calling the subroutine. Regards Denis The subroutine are called one after the other with the intention of holding a bit's last state unless one of the subroutines makes it chagnge its state. I tried before to implement conditional subroutines with several layers of parent subroutines but it really brings ladder diagram programming to its limits. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.