Jump to content

how to create this in visilogic - is this possible?

Recommended Posts

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

  • MVP 2023

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

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


Link to comment
Share on other sites

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.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...