Jordy Posted March 15, 2016 Report Share Posted March 15, 2016 Hi I'm trying to build some logic to charge batteries in a loop but I don't know what's the best solution for this. (vision 130) I have 8 outputs (with external relays) and I want to activate them one by one. we have 1 load system and 8 batteries. (see picture) This must be in a loop and the charging has to change to the next battery every t minutes. so O1 comes high, then stops and then O2 comes high important: between switching of and turning on the next output we need a small delay of D seconds to avoid short circuits. when a battery is not used we have to skip this one. (we can see this using the MB101->MB108) when a battery comes in we have to charge this one next. we only have MB101->MB108 for the status of the batteries (connected/disconnected) and 8 outputs. If MB103=0 this means battery 3 is not connected and must not be charged, we need to skip this output. When MB103 becomes 1, this means that this battery must be charged next because it was last in use. When we disconnect a battery (MB->0) , the charging must stop immediately and move on to the next battery I think i need a kind of table to do this but I never used this before. I don't know if I can do this in vigilogic without a table? any help is welcome. Link to comment Share on other sites More sharing options...
MVP 2023 Flex727 Posted March 17, 2016 MVP 2023 Report Share Posted March 17, 2016 By "table" do you mean a Data Table? It doesn't look like you need anything like that. You seem to have a good handle on the logic - just code what you've written in the above post in ladder logic and start checking your logic. If you get stuck, just post your code here and someone will assist. Link to comment Share on other sites More sharing options...
Henny Posted March 17, 2016 Report Share Posted March 17, 2016 Hello Jordy My first thinking is use a Mi that contains the number of the batterie that has to be charged(1-8). Use another mi that contains the bitmask. 1 = 0000 0000 0000 0001 2 =. 0000 0000 0000 0010 3 = 0000 0000 0000 0100. etc. Copy this bitmask with num to bit instruction to the outputs. Assuming that your outputs are fore example 01 = batterie 1. O2= batterie 2. 03= batterie 3 etc (addressed directly behind each other). To creatie the desired bitmask you can use the bitset instruction. Hope you understand the idea behind it? Kind regards Henny Link to comment Share on other sites More sharing options...
TozoM8 Posted March 18, 2016 Report Share Posted March 18, 2016 The drum sequencer would be great for this. 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