TechTip: Recipes On Weintek HMI

This tech tip is about the recipe function on Weintek HMI, a frequently asked question. As usual, we’ll work through the steps for a basic example to get you started. As with most of our TechTips, this can be achieved without any hardware, making use of the excellent simulator feature in EasyBuilder Pro. A recipe, is a set of parameters that is used to produce a product or run a particular process. These could be times, temperatures, operation counts, volume or weight of material etc. The example program is for a bread making process. The parameters for our bread recipe Continue reading TechTip: Recipes On Weintek HMI

TechTip: SQL Query With Weintek cMT Series HMI

In addition to being able to syncronise datalogs and alarm/event logs to a MySQL or MS SQL database, you can now read, update, delete and append databases using the SQL query object. Steps1. Create your database on your MySQL or MS SQL database server. I have called mine “database” and created a table on it called “plcdata“. idplcdata is the primary key and data is the column for the data I want to record. 2. Setup Database Server in EasyBuilder Pro project. I am running MySQL locally on my PC for testing, so IP address is set to local – Continue reading TechTip: SQL Query With Weintek cMT Series HMI

TechTip: Ramp Up and Down a Value Using a Macro On Weintek HMI

This TechTip is about using For/Next loops to ramp up and down a value on a Weintek HMI. The macro is using local word LW 100 as the output, the time in mS between steps is set by “time” (LW 101), the value to increment/decrement by is variable “IncDecValue” (LW 102) and the number of iterations is “steps” (LW 103). The Macro: macro_command main() short value = 0 // “value” is a short (16bit) – this has been zeroed – just in case! short IncDecValue // change the increment/decrement value here short i // i is a short to be used Continue reading TechTip: Ramp Up and Down a Value Using a Macro On Weintek HMI

TechTip: Using Project Tags In a Macro On a Weintek HMI

In this TechTip we’re looking at using tags in a project and how they work in a macro. Address Tags are a great way to maintain control of elements you may wish to reassign later to an alternative address. In our simple example, we have 2 tags set up in the Address Tag Library using local bits. They are called “Lamp” and “Lamp2” mapped to LB10 and LB100. In our Macro we can pick Tags by ticking the “User-defined tag” box on the macro helper: Macro from our example project is as follows… note the use of Tags “Lamp” and Continue reading TechTip: Using Project Tags In a Macro On a Weintek HMI

TechTip: Enabling EasyAccess 2.0 on a cMT-GXX Gateway

The reduced interface in EasyBuilder Pro for the cMT-GXX series Gateway means that to start the EasyAccess 2.0 service we have to find a way to set the EasyAccess Control word LW 10820 to “1” to start the service. (At this point it is assumed that you have already purchased EasyAccess 2.0 and assigned it to your cMT-GXX gateway using PC Activator or the online service in on the web portal.) The Macro below will set the required control word to enable the service: =========================================== macro_command main() short EA2Enable = 1 // EA2Enable is a short (16bit word) and we’re Continue reading TechTip: Enabling EasyAccess 2.0 on a cMT-GXX Gateway

TechTip: Sending Alarm Emails from a Weintek HMI

This TechTip is about sending alarms from a Weintek HMI. The example is using Gmail – but you can use your own preferred email provider of course. In Gmail, you will need to enable “Allow less secure apps”. this can be found here: https://myaccount.google.com/lesssecureapps when logged into your Gmail account. This is because a Weintek HMI is not a device recognised by Google (such as a PC, iPad, IOS or Android device). In  EasyBuilder Pro system parameters, we need to tick the enable email box. and enter the account credentials. They are as shown below (for Gmail – other email providers may differ). You also Continue reading TechTip: Sending Alarm Emails from a Weintek HMI

TechTip: Bit Sequencing Using a Macro on Weintek HMI

In this TechTip, we’ll build on something we’ve looked at previously, and that’s For-Next loops. In this example what we’re looking to do is sequence 8 bits in the HMI (LB-10-17) with a time delay – an application of this might be if you’re looking to perform several bit-triggered data transfers. First off we’ll declare the variables… macro_command main() // Declare variables bool bit // bit is a boolean (bool) short loop // loop value – short (16bit) short time=500 // time – short (16bit) = 500mS Then we’ll do our loop – in this case, 10-17… for loop=10 to Continue reading TechTip: Bit Sequencing Using a Macro on Weintek HMI

TechTip: Using StringCat in a Macro on Weintek HMI

This TechTip is about using “StringCat” in a Weintek HMI macro. You may already be familiar with using CONCAT in Microsoft Excel to link different text strings together to form a new string, this is what StringCat does. In this example, we’ll be looking at a scenario where a number needs to be joined to a 4 character ASCII string. For example “number “+ “text” = “outputstring”. i.e. 1234+ABCD = 1234ABCD First off, we’ll declare the variables, we have “number” (which we’ll get from an HMI LW register LW0), “text” which we’ll get from LW2 (2 words – 4 characters) and the result will Continue reading TechTip: Using StringCat in a Macro on Weintek HMI

TechTip: For-Next Loop in Weintek HMI Macro

In this TechTip, we’ll be looking at For-Next loops in the Weintek HMI macro language. It will be assumed that you’ve already got some basic knowledge of Weintek macros. As in other macro TechTips we’ll start off by declaring some variables: macro_command main() // Declare variables bool Lamp // Lamp is a bit (bool) short i // i is the loop variable short millisecs // the time for delay in mS short loop //number of loops set using LW1 We’ll use GetData to get the values for DELAY from LW0 and for the number of loops from LW1 (we could Continue reading TechTip: For-Next Loop in Weintek HMI Macro

TechTip: Simple Macros in Weintek HMI

Weintek HMI have a very powerful macro language enabling scripts to be written to implement control, perform calculations and much more. For those new to macros it can be quite daunting to get started. The example shown in this TechTip Article are designed as a “leg-up” to get you started with macros. Step 1 The Macro button is on the project tab within EasyBuilder Pro: Step 2 We need to create a macro by clicking “New…” Step 3 Let’s break down what you need to know to get started with writing a macro. First off we need to declare variables. Continue reading TechTip: Simple Macros in Weintek HMI