I have a Display question, Can someone please Help! Button question


#1

Hey guys,

I’m new on here and I need some help.

We’re doing a project at school with Pac Display 9.1. I’ve already created my program and transfered it to pac display.

Here is my problem. When you make your button to run run your program how do you get the button to stay on when the program is running and tell it to shut off when the program is done?

If you click the toggle option, it will rerun your program. If you choose the direct option the button only stays on for as long as you hold the mouse button. As soon as you let it go, your program will run, but your button says off. The instructor says the button has to say on when the program is running and off when the program is not running. I’ve looked at the manuel and I’m out of answer.

Can someone please help me?


#2

hi, charliel48
try to use a varaible to determine the chart’s status


#3

It may be interesting to consider two bitmap buttons. One with the text “ON” and the other with the text “OFF” and then play with the “Visibility/Blink” controller driven attribute linked to a digital variable controlled by the program. By using the reverse state, when one object is visible the other is invisible and visa versa.


#4

Gudday Charliel48,

First up, welcome to the forum.

Getting to your question… I have to say, its very very very very very very very unusual to start a program (chart) from PAC Display.
Usually charts run all the time, and then you simply interact with them via PAC Display… In fact, to my knowledge, you interact with a single chart via PAC Display, but rather the entire strategy (which may consist of one or more charts)… This seems to fit in with the first part of your post where you talk about the ‘program’ rather than a chart (which, using the program term) is simply part of the program.

So, getting to the answer then… As far as I know, you cant do it directly… You are going to have to use a little smoke and mirrors.

Here is the big picture of what we are going to do… Set a variable in the chart which when set true runs the core program. Have the last part of the core program reset the variable when its done.
In PAC Display, link to that variable.

Here is a screen shot of the chart;


So, in the block 0, you dont do anything (as should be the standard practice (another topic for a different thread)).
In block one, ask ‘is variable’ true?
You should always have delays in your charts. Never ever, EVER loop around asking a question with no delay!!!
Once the variable is true (Note, its set true from PAC Display), you ‘enter’ your existing chart and do all that it says.
Once your chart has finished, add in the last block. In this block, use the command ‘Set variable false’ to set ‘Run’ false.
This way, after the delay, you will loop around asking if its true… which it wont be until you click the button in PAC Display and thus set it true.

The down side to this method is that if your chart is very short (and has few delays (have I mentioned how you should NEVER EVER have a chart with NO delays in it?)) then in PAC Display, your button will go down when you click it, the chart will run in a billizionth of a second and set the variable false and PAC Display will scan it every second (that’s the default) and so you will not even see it ‘depress’ while your ‘program’ (chart) is running.

If this is the case, quickest way to fix that is to put a ~2 second delay in your chart.

If I have misunderstood your question, just let me know.

If anyone else has another way of doing this, just jump in and lets know.


#5

Hey Ben. I’m a little confused on your answer.

I’ll try this a different way.

We’re working with a Festo Mixing Station and we have an opto 22 hooked to it. He gave us two recipies to make charts for in Control Basic. We’ve made charts for both recipies. We also made another chart for the water to be returned of course. We all have the power chart to control all the charts. So we have a total of four chart.

We transfered the program from conrol basic to pac display. We made an HMI for the Mixing station and made buttons to automatically run each one of our charts separtely. We have a recipie 1 button, recipie 2 button and a return button.

Here’s the problem i’m having. When I select the toggle option in the send descrete option, the toggle option will rerun my program.

If I choose the Direct Option, I will click and hold my mouse button and it will say my program is running, which it is. When I let go of the mouse button, it will switch to off, but my program will run it’s course and then shut off.

I want my buttons to say on when the program is running, and off when the program ends.

Is there anyway to do that? I have my charts already made and ready to go from control basic. My programs run perfectly.

All I’m trying to do is to get my buttons to say on when the program is running and off when it’s not on.

I’ve tried many things. I’ve tried switching it to current value instead of discrete. I’ve tried messing with the visiblity.

Do you understand Ben?


#6

Ben. Not so in agreement with your comment that its very very very very very very very unusual to start a program (chart) from PAC Display. If pushed I might agree that it is unusual, but with no [B]"very"s[/B]. Starting different recipes procedures, formulation or even unit files (all good SP88 Batch things!) by starting “one-off” charts is a great option available through PACDisplay. For instance running a chart that sets up a table of pointers that define your production unit, is something that leaves many PLC/SCADA and even some DCS systems [B]green[/B] with envy! I wouldn’t like to name names!

I still can’t see why [B][B]charliel48[/B]'s [/B]problem cannot be solved by two bitmap buttons [START] and [STOP], using controller driven inverted visibility/invisible attributes. The [START] button starts the relevant chart, which sets an internal variable to true. This makes the [START] button disappear and the [STOP] button appear, giving the option to send the process to a shutdown/safe state before finishing and stopping the chart. The last thing the chart does before ending is to set the internal value false, causing the [STOP] button to disappear and the [START] button to reappear for the next time.


#7

Charliel48,

Thanks for the further break down.
Yep, pretty sure I get it now and what you want to do is laid out on pages 135 and 136 of Doc #1702, the PAC Display Users Guide.

It shows how to have a button that changes state when the chart changes state, and it also shows how to have a button that can start and stop charts.

George, yeah, after re-reading the initial question, I [I]might[/I] have overdone the ‘verys’ ;-}
I need to keep in mind that I cant program for squat and so I would not [I]start and stop[/I] programs from PAC Display, I would have them as I pointed out, spinning, ready to go as triggered by a variable… Not the most efficient way to do it.
Appreciate your comments.

RTFMFTW.
(Read The Fantastic Manual For The Win).

Ben.