making a slideshow by wincc

you can look at the attached 3 pictures and you will find the final code.

Two comments:

1)
If you add picturenames with defines, you should place the define between the associated WINCC... START/END comments.
If you use a picture names:
Code:
// WINCC:PICNAME_SECTION_START
#define PIC_1 "myPic1.pdl"
// WINCC:PICNAME_SECTION_END
The same when you use tags inside a C script.
Code:
// WINCC:TAGNAME_SECTION_START
#define TAG_1 "myTag1"
// WINCC:TAGNAME_SECTION_END
Otherwise searching and replacing of tags or picture names will not work.

2)
I would use a switch/case statement instead of if-then.
Code:
switch (val) {
  case 0: 
    OpenPicture(PIC_1);
    break;
  case 1: 
    OpenPicture(PIC_2);
    break;
  case 2: 
    OpenPicture(PIC_3);
    break;
}
For your if-then statement, if you have 22 conditions and one is true, the others are also checked unnecessary.
A switch statement is if there are consecutive case-values, compiled into a jump-table, which is fast and efficient.
And that's the common used way in C.
 
The Internal Binary tag which can stop the slideshow by making a button while pressed set slideshow value equal 1000 for example or what

You can use a seperate tag to stop/start the slideshow. Then in the scripts where you change the picture you have to check the value of the tag, and when false then don't do the picture change.

You can do it using only the existing tag, like you mentioned set it to 1000 to stop. Then you have to modify to the global script, to that it does nothing when the value is == 1000.
Then you can use a button to toggle slideshow on and off, with code like this (pseudocode):
Code:
if (slideshow < 1000){
  /* stop slideshow */
  slideshow = 1000;
} else {
  /* start slideshow */
  slideshow = 1; /* use an appropriate value in each picture, that the slideshow proceeds with the next picture */
}
 

Similar Topics

Hi, I have seen a few post with similar topics and I have tried contacting the authors however I have not had any luck so I am posting this new...
Replies
14
Views
1,014
Hi everyone I've created an FC that includes the blocks TCON, TDISCON, TSEND and TRCV. This block has to be as generic as possible across...
Replies
15
Views
1,526
Hi all, I have been working on a tool for my company that handles a specific task our company runs into often related to PLC's. This is a tool I...
Replies
15
Views
2,884
Hi, i need to make: 1- A PLC Program on Omron PLC CP2E-N using high speed counter E6C3-AG5B 360P/R 2M(Absolute) ,to Reject bottles on Conveyor...
Replies
4
Views
879
I was taught to go to Combined > Make Change > go to Offline > will prompt to save > Save > Exit out of program > will prompt to save again >...
Replies
0
Views
680
Back
Top Bottom