| |
Cowculator For DOS Link Programs

This webpage serves to give information about the file structure of the ATL COWDATA file used in the DOS version of ATL Cowculator. This file is used to store the information transferred between a PC and ATL feeding systems. NB - All numeric values in this document are DECIMAL.
What are Link Programs? - Link programs are small DOS utilities, written by ATL, that allow data to be transferred between a PC and an ATL feeding control system. Link programs do all the hard work of communicating with the control system and transferring data. They have been created because each feeding control system is very different and requires different data in different formats. Each control has it's own dedicated link program, but all the link programs use a common input and output file format, making it easy to link to third party software to any of the range of ATL feeding control systems.
Download Link Programs - Before you continue, you will need to download the current link programs. Click on the relevant download icon below to download a .ZIP file containing the required files. These programs are the copyright of ATL. However, they can be downloaded by anyone and used free of charge.
 |
|
atl_link_programs.zip - [300kb] - This file contains all six current link programs. |
 |
|
atl_demo_data.zip - [4kb] - This file contains a complete set of demonstration files. The main one of interest is cowdata.atl which contains all of the cow information. |
Recommended Installation - We recommend that you create a folder on the 'C' drive of the computer called 'ATL' and copy the link programs to that folder. Your application can then call the xxxlink.exe program. The cowdata.atl file should also reside in this folder. This is inline with the default installation folder for the ATL Cowculator program. If Cowculator is already installed on the computer there will already be a copy of the link programs already installed.
Invoking the Link Programs - There are six versions of the link software, each specific to a particular ATL product.
| Link Program Filename |
|
ATL Products |
| mk2_link.exe |
|
Micro Mk2 Feeder Control |
| mk2alink.exe |
|
Micro Mk2 Feeder Control with Herringbone Auto-ID |
| mk3_link.exe |
|
MicroMarque3 Feeder Control |
| mk3slink.exe |
|
MicroMarque3S Feeder Control |
| oop_link.exe |
|
Out-Of-Parlour Feeding System |
| yok_link.exe |
|
Yoke-L Forage Feeding Systems |
All of these programs write the same COWDATA file, although not all of the file is transferred to the control. The Link software is a DOS application that requires one serial port to be available, and at least an EGA display adapter. There are various command line parameters that must be used to initiate the transfer.
The command line is as follows...
XXXXLINK.EXE <FILENAME.ATL> <DIRECTION> <COM PORT> <PAUSE>
| FILENAME.ATL |
|
This is the name of the file to be sent/received. It must have an .ATL tail. |
| DIRECTION |
|
Should be R to receive data from the control system, or S to send data to the control system. |
| COM PORT |
|
The serial communications port that the control system is connected to; this should be set to either COM1 or COM2 (by default COM1 is selected). |
| PAUSE |
|
Adding PAUSE to the command line, will cause the program to display ***PRESS ANY KEY*** at specific points in the transfer (by default the program does not pause). |
Examples...
XXXXLINK COWDATA.ATL S COM1 PAUSE - Will send COWDATA.ATL to the control system using COM1 and pausing.
XXXXLINK COWDATA.ATL R - Will receive data from the control system and save it to COWDATA.ATL; COM1 will be used by default, and the program will not pause.
XXXXLINK COWDATA.ATL S COM2 - Will send COWDATA.ATL to the control system using COM2 without pausing.
ATL File Contents - The data transmitted and received by the ATL Feeder Control Systems differs depending on which type of system is in use. For example, the Micro Mk2 system uses a standard serial output at 1200 baud, whereas the MicroMarque3 and Out-Of-Parlour Feeding Systems has multiplexed data at 9600 baud. The MicroMarque3S system uses the same format but with more data. For this reason, it is easier for any 3rd parties writing software for use with ATL feeding control systems to use the ATL link software. This program creates a file on the hard disk of a PC containing all of the information held by the ATL control system, and is the same format regardless of system type.
For any 3rd parties who do not want to use the ATL link program and would rather link direct to the ATL feeding control system, more detailed information is available on how to achieve this; before the information is released the 3rd party must sign a Non-Disclosure Agreement (NDA). The NDA is available upon request. However, because our firmware is updated frequently we do not recommend that a direct link is made to the ATL feeder control system.
The file created by the ATL link software is usually called COWDATA.ATL, although the user can use any filename with an ATL tail.
The file is a standard DOS ASCII text file and the structure is as follows...
The file is separated into blocks of data. Each block holds all of the information for one cow. Each block of data contains only ASCII text and is terminated with a Carriage Return and Linefeed. Non-numeric information is enclosed with quotes. There is no header or footer information within the file, and therefore the first cow block starts at the first byte of the file. This is to allow the file to be simply imported into databases and spreadsheets etc. Each block of cow data is again separated into fields. Each field holds specific data for the cow. The fields are of a fixed length allowing data to be updated in the file, without the need to re-write the entire file.
Future Proofing - As future enhancements and features are added to the ATL feeding systems the COWDATA file may have to change to incorporate new fields. The overall structure will not change, but new fields will be appended onto the end of each cow block. Therefore any programs reading the file should read and store each field individually looking for commas to separate them. When the last field has been stored the program should read and disregard any remaining bytes until it finds a carriage return and line feed. Thus as new fields are added to the block, your program will not crash because it did not expect them.
Backward Compatibility - By the same token, if the program unexpectedly comes across a carriage return and linefeed, all remaining fields to be read should be set to zero and a new cow record started. This will ensure that your program will read old format files, with less fields, without corrupting all cow records.
File Structure (1 Cow Block)
Data Format |
|
Description |
|
Notes |
| xxxx, |
|
Cow Number |
|
0 to 9999 |
| xx, |
|
Ration |
|
0 to 99 |
| xx.x, |
|
Daily Milk Yield |
|
Must Include Decimal Point |
| xxx, |
|
Days Into Lactation |
|
0 to 999 |
| xxxxx, |
|
Cumulative Ration |
|
|
| xxxxx, |
|
Cumulative Milk Yield |
|
|
| x, |
|
A.I. Flag |
|
0-Off/1-On |
| x, |
|
VET Flag |
|
0-Off/1-On |
| x, |
|
MAS Flag |
|
0-Off/1-On |
| x, |
|
DRY Flag |
|
0-Off/1-On |
| xx, |
|
No. Of Days Before Due |
|
0 to 99 |
| x, |
|
TEST Flag |
|
0-Off/1-On |
| x, |
|
BULLING Flag |
|
0-Off/1-On |
| xx, |
|
Group Number |
|
|
| "xxxxxxxxxxxxxxxx", |
|
EID Code (Tag Number) |
|
|
| "xxxxxxxxxxxxxxxxxxxx", |
|
Cow Name |
|
20 Characters |
| "xx/xx/xxxx", |
|
Calving Date |
|
Millenium Format |
| xx, |
|
Lactation Number |
|
|
| xx.x, |
|
Out-Of-Parlour Feeder A |
|
Must Include Decimal Point |
| xx.x, |
|
Out-Of-Parlour Feeder B |
|
Must Include Decimal Point |
| xx.x, |
|
Out-Of-Parlour Uneaten Feed A |
|
Must Include Decimal Point |
| xx.x, |
|
Out-Of-Parlour Uneaten Feed B |
|
Must Include Decimal Point |
| xxxxx, |
|
Out-Of-Parlour Total Feed A |
|
|
| xxxxx, |
|
Out-Of-Parlour Total Feed B |
|
|
| xx.x, |
|
Out-Of-Parlour Feed To Add |
|
Must Include Decimal Point |
| xxx, |
|
Out-OF-Parlour Days To Add |
|
|
| xx.x, |
|
Milk Yield - 0 |
|
Must Include Decimal Point |
| xx.x, |
|
Milk Yield - 1 |
|
Must Include Decimal Point |
| xx.x, |
|
Milk Yield - 2 |
|
Must Include Decimal Point |
| xx.x, |
|
Milk Yield - 3 |
|
Must Include Decimal Point |
| x, |
|
Slow Milker Flag |
|
0-Off/1-On |
| xx, |
|
Number Of Days To Withhold Milk |
|
|
| xxx, |
|
Out-Of-Parlour Number Of Visits |
|
|
| xxxx, |
|
Out-Of-Parlour Time Spent In Stalls |
|
|
| xxx, |
|
Yoke-L Number Of Visits |
|
|
| xxx, |
|
Yoke-L Number Of Visits |
|
|
| xxx, |
|
Yoke-L Number Of Visits (Previous 24 Hours) |
|
|
| xxxx, |
|
Yoke-L Time Limit |
|
|
| xxxx, |
|
Yoke-L Time At Stalls |
|
|
| xxxx, |
|
Yoke-L Time At Stalls (Previous 24 Hours) |
|
|
| CR LF |
|
END OF BLOCK |
|
(0Dh, 0Ah in Hex) |
All fields are delimited with a comma, and each cow block is delimited with a carriage return and line feed (0Dh, 0Ah).
Field Descriptions
| Cow Number |
|
A three-digit cow number ranging between 1 and 999. Although this is a four figure field, only the last three digits can be used. The first digit must be zero. This is the cows freeze brand number. |
| Ration |
|
The feed to be dispensed each milking. Values between 0 and 99 are valid. One unit of feed is calibrated by the user to be what they want (i.e. 1/2kg or 2lb). |
| Daily Milk Yield |
|
The last recorded daily milk yield. |
| Days Into Lactation |
|
The number of days elapsed since the beginning of the cows lactation. This number is automatically incremented each day by the ATL control system. |
| Cumulative Ration |
|
The amount of feed dispensed since the beginning of the cows lactation (i.e. over one lactation). This number is automatically incremented each day by the ATL control system. |
| Cumulative Milk Yield |
|
The amount of milk collected from the cow since it was last reset (i.e. over one lactation). This is reset manually by the user at the beginning of the lactation. Maximum of 9999.9 litres; multiplied by 10 to remove the decimal place. |
| A.I. Flag |
|
A single byte flag to indicate if the cow is due for Artifical Insemination (A.I.). This flag is set/reset by the user, although it can also be changed using this datastream. Acceptable values are 0 for a clear flag or 1 for a set flag. |
| VET Flag |
|
A single byte flag to indicate if a cow requires vetinary attention. This flag is set/reset by the user, although it can also be changed by using this datastream. Acceptable values are 0 for a clear flag and 1 for a set flag. |
| MAS Flag |
|
A single byte flag to indicate if the cow has mastitis. This flag is set/reset by the user, although it can also be changed by using this datastream. Acceptable values are 0 for a clear flag and 1 for a set flag. |
| DRY Flag |
|
A single byte flag to indicate if a cow is dry. This flag is set/reset by the user, although it can also be changed by using this datastream. Acceptable values are 0 for a clear flag and 1 for a set flag. |
| Number Of Days Before Due |
|
This two byte field contains a value entered by the user that indicates how many days before the cow is due for A.I. (maximum of 99 days). This value is automatically decremented by the ATL control system each day until it reaches zero. |
| TEST Flag |
|
A general purpose single byte flag to indicate if a cow requires a test of some sort. This flag is set/reset by the user, although it can also be changed by using this datastream. Acceptable values are 0 for a clear flag and 1 for a set flag. |
| BULLING Flag |
|
A single byte flag to indicate if a cow has be seen bulling. This flag is set/reset by the user, although it can also be changed by using this datastream. Acceptable values are 0 for a clear flag and 1 for a set flag. |
| Group Number |
|
A two digit variable to indicate which group the cow is in. Group numbers are only used in the Out-Of-parlour Feeding System. This value can be any number between 0 and 99. |
| EID Code (Tag Number) |
|
A 16-byte encoded number stored in the EID (Electronic/Automatic Identification) tag in the cows ear. |
| Cow Name |
|
A 20-character field storing the name of the cow. This field is used solely by the PC software and not by the ATL control system. |
| Calving Date |
|
The calving date for the cow. This should be stored in the format 06/03/1998 to keep millenium compatibility. |
| Lactation Number |
|
The number of lactations passed since the cow was born. |
| Out-Of-Parlour Feed A |
|
Daily Feed A ration in kg's for the Out-Of-Parlour feed station. |
| Out-Of-Parour Feed B |
|
Daily Feed B ration in kg's for the Out-Of-Parlour feed station. |
| Out-Of-Parlour Uneaten Feed A |
|
Feed A in kg's left over from previous cycle. |
| Out-Of-Parlour Uneaten Feed B |
|
Feed B in kg's left over from previous cycle. |
| Out-Of-Parlour Total Feed A |
|
Total Feed A fed in kg's at the Out-Of-Parlour feed station. |
| Out-Of-Parlour Total Feed B |
|
Total Feed B fed in kg's at the Out-Of-Parlour feed station. |
| Out-Of-Parlour Feed To Add |
|
Feed A is kg's to be added over the next x days. |
| Out-Of-Parlour Days To Add |
|
Number of days to add xx.xkg feed. |
| Milk Yield - 0 |
|
Individual Milk Yield recording. |
| Milk Yield - 1 |
|
Individual Milk Yield recording. |
| Milk Yield - 2 |
|
Individual Milk Yield recording. |
| Milk Yield - 3 |
|
Individual Milk Yield recording. |
| SLOW Milker Flag |
|
A single byte flag to indicate if the cow is a slow milker. This flag is set/reset by the user, although it can also be changed by using this datastream. Acceptable values are 0 for a clear flag and 1 for a set flag. |
| Number Of Days To Withhold Milk |
|
When the Mastitis (MAS) flag has been set, the user can enter a period of days after which the MAS flag is turned off and the TEST flag is turned on. |
| Out-Of-Parlour Number Of Visits |
|
Total number of visits that the cow made to the Out-Of-Parlour system in the last 24 hours. |
| Out-Of-Parlour Time Spent In Stalls |
|
Total length of time (in minutes) the cow spent feeding at the Out-Of-Parlour system in the last 24 hours. |
| Yoke-L Number Of Visits |
|
Total number of visits that the cow made to the Yoke-L system during the last 24 hours. |
| Yoke-L Number Of Visits (Previous 24 Hours) |
|
Total number of visits that the cow made to the Yoke-L system during the 24 hour period previous to the one above (used for comparison). |
| Yoke-L Time Limit |
|
A value in this field will limit how long a cow can spend at the Yoke-L stalls. A value of 60 will limit the cow to 60 minutes of feeding time. If a cow spends more than this feeding, it will not be allowed access during the next visit. |
| Yoke-L Time At Stalls |
|
Time in minutes for the total amount of time a cow spent feeding at the Yoke-L stalls during the last 24 hour period. |
| Yoke-L Time At Stalls (Previous 24 Hours) |
|
Time in minutes for the total amount of time a cow spent feeding at the Yoke-L stalls during the 24 hour period previous to the one above (used for comparison). |
|