We will now look at the Horner 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 – Horner Report Generator
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. The 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 conventions. 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
%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.
Horner XL4 Report Generator Sample
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.
https://accautomation.ca/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.
https://accautomation.ca/horner-xl4-recipe-instruction/
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.
The main menu in Cscape selects 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.
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 be 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)
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 of 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.
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.
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:
https://hornerautomation.eu/product/xl4-prime-ocs-3-5-colour-touchscreen/
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 PLCs 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.
Thank you for creating this. Do you have an example in which you use a USB drive, rather than the microSD card?
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:
https://accautomation.ca/horner-xl4-ftp-file-transfer-protocol-server/
Hope this helps you out.
Regards,
Garry
It is possible to get a report in pdf format ?
Hi Pablo,
The register data is stored in .csv (comma-separated value) format only. You would have to import to another program like excel or word and then save the file as a PDF.
I hope this helps you out.
Regards,
Garry