TechTip: Using GETBIT in a Macro on Weintek HMI

Occasionally, you may need to read a bit or bits from a PLC or controller register if they are not directly accessible via the driver being used – an example of this could be a PLC status word where each bit represents the status of various PLC conditions, for example, “Battery Status” or “CPU Error” etc. Or it may be that you want to replicate some PLC logic that is otherwise inaccessible. The GETBIT macro instruction is very useful in these circumstances, enabling you to retrieve an individual bit and use that in conjunction with further logic such as an Continue reading TechTip: Using GETBIT in a Macro on Weintek HMI

TechTip: Using Weintek HMI to Print a label on a Zebra Printer using Free Protocol

In this TechTip we’ll be looking at printing a label to a Zebra printer by sending the ZPL string to the com port or Ethernet port on the HMI. Zebra printers are increasingly popular in production and packaging and are highly configurable and able to print barcodes, QR codes, Data matrix codes etc. (for reference, the printer used in this demo was a Zebra GK420t.) This isn’t intended to be a lesson in the ZPL language, but we will run through the label string used for our demo: The code we’ll use for this label is below: We can preview Continue reading TechTip: Using Weintek HMI to Print a label on a Zebra Printer using Free Protocol

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