How Can We Help?
Create a slideshow of HMI screens
In this tutorial, you will learn how to use a slideshow to present your interface screens.
Can be used for a demonstration at a trade show or to display instructions, advertisements, etc.
Define control address of the screen ID
In PLC Control, you can chose the address which will control the screen number to display
Create screens to be displayed for the slideshow demo
On each page you can set the texte “Serial ID of the current screen is” followed by the “Numerical display” LW10000
In the LW60010 register you will find the serial number of the current scree. This register is not writable.
Create a script to change the slideshow to the next screen and call it up every x seconds
- Create a script in “Script Editor” [1] [2]
- Copy the whole script bellow and modify these lines according to your screens [3]
-
unsigned short screenIDs[] = {0,1,2,3,4};
- #define NUM_SCREEN_IDS 5
-
-
Compil it [4]
#include "MacroInit.h"
void Macro_main(IN *p)
{
MarcoInit
//ToDo
// Define the array of screen numbers and its size
unsigned short screenIDs[] = {0,1,2,3,4}; // Example array of screen numbers to be show in the slideshow
#define NUM_SCREEN_IDS 5 // Manually defined size of the array
static int currentIndex; // "statttc" maintain the value of currentIndex between each script calls
// Copy the current screen number value to LocalWord[10000]
LocalWord[10000] = screenIDs[currentIndex];
// Update the index for the next call
currentIndex = (currentIndex + 1) % NUM_SCREEN_IDS; // with modulo function
}
Call the script every number of seconds you wish
Here’s the Screen_Slideshow