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:
Installing the Software Cscape
Cscape Software Setup
Numbering System and Addressing
Timers and Counters
Compare and Move Instructions
Program Control Instructions
Rotate and Shift Register
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
%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.
We modified this program to add three ingredients A, B and C. This modification was explained in the following post.
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.
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)
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.
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:
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.
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.