Jump to content

Help needed with challenging algorithm


Recommended Posts

  • MVP 2023

I have an odd customer request that has me stumped as to how to program this efficiently - perhaps someone here can help.

I am using a v570 PLC to control 10 valves. I have 10 demand digital inputs (requests to open individual valves) and 10 digital outputs to open and close the valves. The pump that pushes chemical through these valves is not capable of handling more than a few open valves simultaneously, also some of the valves are more important than others. So, the customer would like an input on-screen to adjust the number of valves that can be open simultaneously and a priority selection for any or all of the valves. If there are more than the input value number of valves being requested to open simultaneously, then additional valves should be held off until an open valve closes. Valve opening should be in FIFO order with priority valves taking precedence.

The biggest problem I'm having is trying to deal with the FIFO (i.e. maintaining a continuous and current hierarchical list of valves waiting their turn to open) and for dealing with the conflict that allows the priority valves to move to the head of the line.

Can anyone suggest the basic framework of an algorithm that will accomplish this in VisiLogic?

Thank you for your help.

Link to comment
Share on other sites

Hi Flex,

I want to give you some initial tips:

There is Functional block (FB) Events. There you define a vector of bits. In your case each bit wil represent output of a valve. One fo thhe functions of this FB will show you how many bits are active (how many valves are open). You can easilly compare this number with the limit, set from, let's say HMI and block new valves to be open.

If there is more requests during block, you can enter the pointer of the valve requested in a vector of MI.

In VisiLogic > help menu > Examples > Project examples > Ladder you can find a nice working example V570 Vector FIFO. I hope it will help you to manage the vector of waiting to open valves.

It seems now you have the basic elements to start programming. I guess few details are missing.

Let me know if these tips are useful and which further help you need.

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.

Guest
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...