In this lab we will take an existing screen (the one you made in an earlier lab) and make a few modifications. This is typical in developing a project. First, you put together a few basic screens to outline your project. Then, as the design comes together, you go back and modify those screens to better represent what you need to monitor and control your application. And you add links from one screen to another, building a network of screens so that the user can go from screen to screen within your application. That’s exactly how our demo was put together!
We’ll take advantage of that first screen you developed in the labs. Click on the Screens directory in the Workbench to list all the screens of the project in the right hand pane. Open the screen called “MYSCREEN.cim” in CimEdit by right clicking on it and choosing Edit.
The “.cim” at the end just means that it's a CIMPLICITY HMI screen file. In fact, it's “registered” with Windows. What that means is that if you double-click on it from Explorer, it will automatically launch CimView to run and display the screen. Or you can right click and Edit the file, which will automatically bring up CimEdit for you. This is completely Windows integrated to save you time and effort - nothing new to learn here!
We will add two buttons to this screen so that we can open our current and historical trend chart screens from within the running demo. This is a simple modification, but very powerful. With the development tools provided by CIMPLICITY HMI, you can go back and update your screens when you need to. You don’t need a compiler or fancy tools to write new software - just CimEdit!
Ok, let's add those buttons. Choose the “Text Button” icon in the toolbar. Create a button somewhere on the lower left of the screen. The actual position isn’t important - just keep it clear of the other objects so that it's easier for you to work with.
Go ahead and click on it once to select it. Then let’s copy and paste it back in to make a second button. How? Well, like standard Windows style programs, you can use the pull down menu at the top - Edit, Copy, then Edit, Paste - or you can use the standard short-cut keys: Control-C to copy and Control-V to paste. It all looks something like the following screen:
Now, let's configure the left button first. Put your mouse cursor within the button and double-click. This opens the Properties Dialog box for the button.
Click on the “Text Button” tab. Put the word “Current” in the String field at the top. This will stand for our Current Trend Screen.
You can also choose to change the font size and type as well as button and text color.
Now click on the Events tab. In the Event field, select “Mouse Up” for the event. Now, use the “>” symbol to the right of the Action field and select New so that we can define a new procedure to execute whenever we get this event.
Let's call this Procedure “View Current Trends.” Go ahead and enter that as the procedure name. When you have a large project with lots of procedures, it really helps to use meaningful names. CIMPLICITY HMI lets you use a full name for these - not some cryptic abbreviation or number.
Now, we need a new procedure. Click on the New button. In the Action field, click on the down arrow and select “Open Screen.” This will open a screen window to display the current trends chart but will leave our first screen (MYSCREEN.cim) open.
Click on the ellipsis (…) button to the right of the Screen Name field and browse for “CurrentTrend.cim.”
Use the pulldown to select CIMPDEMO for the base project. Wait - what’s this all about? Well, CIMPLICITY HMI lets you link screens together from different projects! This is including projects that are running on other CIMPLICITY HMI computers! Wait - what about programming data communications and learning all about TCP/IP (whatever that is!)? Well, you don’t need to! Just enter the project name here and the screen will link to that project. This is how you quickly and easily link together lots of CIMPLICITY HMI Servers to make an entire enterprise-wide system!
Go ahead and click on OK now to define this new procedure. That’s enough for now.
Let's repeat the steps for the 2nd button. Double-click on it to get the object properties page. In the Text Button tab, enter Historical in the String field.
http://www.cadfamily.com/html/Article/Modifying%20and%20Linking%20Screens%20in%20Cimplicity_544_1.htm
No comments:
Post a Comment