Horner XL4 Report Generator

The Horner APG XL4 all in one controller has a feature to generate text reports. These reports can consist of text and data from memory locations in the controller. Reports can be printed using a serial interface printer through any of the serial ports of the unit or can be saved on the removable micro SD media card attached to the device. We will be taking our process mixing tank and generating a report that will show when the batch started, filled the tank and when the batch was finished emptying. This report will be saved on the removable micro SD media card attached to the unit.

Previously we discussed the following in our Horner XL4 Series:
System Hardware
Installing the Software Cscape
Cscape Software Setup
Establishing Communication
Numbering System and Addressing
User Interface
Timers and Counters
Compare and Move Instructions
Math Instructions
Program Control Instructions
Rotate and Shift Register
Recipe Instruction

Overview of Reports
Cscape will be used to configure and download the report parameters to the Horner APG XL4 controller. This will happen automatically when the program gets downloaded to the controller. Report editor is what is used to configure the report we will make in Cscape. A paper report to the printer will consist of specifying the lines per page (1-240) and the characters per line (10-132). If information is stored on the removable memory then you still need to specify the lines per page, characters per line and the name of the file that the information will be saved under. File names are restricted to the 8.3 convention. Example: ReportXX.csv The size of the report when using the media card is limited to the size of the micro SD card inserted.

The removable media has system registers associated with the card. Here are the registers:
%SR175 Status – Current status of the RM interface
horner-xl4-report-generator-060-min
%SR176 Free Space – This 32 bit register shows the free space on the card.
%SR178 Card Capacity – This 32 bit register shows the card space capacity.

Let’s take a look at a sample program.
Our original process mixer program was from this post: PLC Programming Example Process Mixer. This post walked through the development of the application.
http://accautomation.ca/plc-programming-example-process-mixer/
PLC Programming Example - Process Mixer
We modified this program to add three ingredients A, B and C. This modification was explained in the following post.
http://accautomation.ca/horner-xl4-recipe-instruction/
horner-apg-xl4-recipe-instruction-160-min

We will add the following logic to store the real time clock values when our sequence is started, when the tank is filled and when the tank is empty. This will be used when we assemble our report.
horner-xl4-report-generator-010-min

The main menu in Cscape select Program | Report Editor. This will call up the main menu of the report editor. The screen that is displayed is where we will write our report.
horner-xl4-report-generator-020-min
You can see that we have a report written, which will show the information that we want to collect at the end of every process mixing batch.
Text and data from registers can mixed to create the report. Hitting the F1 key will call up the help file for this editor window.

In the main report editor window, select File | Configure Printer. (CTRL + Shift + P)
horner-xl4-report-generator-030-min
This is where we will specify our lines per page and characters per line. The carriage return is selected for the end of the report but leave the form feed unselected. We do not want to leave a large gap between each or our reports on the file.
The Printout Medium is selected to Removable Media. The file name is given ‘MReport.csv. The append file is selected so that each report will be added to the file. If not selected, then the report will overwrite the previous in the file.

The report control registers can be set by selecting File | Control Register from the main menu of the report editor. (CTRL + T) This will determine when the report will be written to our removable media.
horner-xl4-report-generator-040-min
Our report will be triggered with the internal bit %T00102. This is activated when the process tank is empty. The status register is used to indicate any errors in writing the information to the memory.
horner-xl4-report-generator-035-min

Here is what our report will look like in the file MReport.csv.

Batch Started: 2016/11/23 06:07:12
Batch Ended: 2016/11/23 06:08:01
Tank Filled: 2016/11/23 06:07:22
Mixer Time: 30.0
Product A: 1.0
Product B: 2.0
Product C: 3.0

———————————-
Batch Started: 2016/11/23 06:08:13
Batch Ended: 2016/11/23 06:08:53
Tank Filled: 2016/11/23 06:08:23
Mixer Time: 20.0
Product A: 1.0
Product B: 2.5
Product C: 1.5

———————————-

This is an easy and quick way to get information out of our controller quickly about our process.

See this logic in action by watching the YouTube video below.

You can download this application here. It will contain all of the screens and logic programming.

All of the documentation for the XL4 can be downloaded at the following URL:
http://www.horner-apg.com/xl4

Next time we will look at communicating through the serial port using Modbus RTU protocol.

Watch on YouTube : Horner XL4 Report Generator
If you have any questions or need further information please contact me.
Thank you,
Garry



If you’re like most of my readers, you’re committed to learning about technology. Numbering systems used in PLC’s are not difficult to learn and understand. We will walk through the numbering systems used in PLCs. This includes Bits, Decimal, Hexadecimal, ASCII and Floating Point.

To get this free article, subscribe to my free email newsletter.


Use the information to inform other people how numbering systems work. Sign up now.

The ‘Robust Data Logging for Free’ eBook is also available as a free download. The link is included when you subscribe to ACC Automation.

4 thoughts on “Horner XL4 Report Generator”

  1. Thank you for creating this. Do you have an example in which you use a USB drive, rather than the microSD card?

    1. Hi David,
      We are using a microSD card because there is a memory slot built into the CPU unit. Normally I would just use a USB device that accepts a microSD card to use a USB device.
      https://www.amazon.ca/s/ref=nb_sb_noss/130-2605872-0071321?url=search-alias%3Daps&field-keywords=usb+microSd+adapter&rh=i%3Aaps%2Ck%3Ausb+microSd+adapter

      You can also use FTP to get the information from the card from a network. See the following post:
      http://accautomation.ca/horner-xl4-ftp-file-transfer-protocol-server/

      Hope this helps you out.
      Regards,
      Garry

Leave a Reply

Your email address will not be published. Required fields are marked *