Cowculator For Windows 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.

How to link to Cowculator For Windows - ATL Cowculator was designed with other PC software in mind and this is why the newest version of ATL Cowculator was designed to be invoked from the command line as well as through managed (.NET) code.

Invoking ATL Cowculator For Windows from the Command Line – ATL has produced datasheets containing all relevant information required to invoke ATL Cowculator For Windows from the command line.

Datasheet  
Description
Datasheet 59   Command Line Spec Sheet
Datasheet 60   Command Line Spec Sheet 1
Datasheet 61   Command Line Spec Sheet 2
Datasheet 62   Registry Keys

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 saem format but with more data. For this reason, it is easier for any 3rd parties writing software for use wit 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. However, 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 ) 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 ) 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 ) 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 ) 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 ) 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 ) 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).

Individual Milk Yield Recordings - Milk Yields 0 to 3 are used to store individual milk recordings for either twice-a-day or three-times-a-day milk recordings. As the recordings occur, they are shifted through the milk yield stores. Any recordings in Milk Yield 0 will be lost when a new recording takes place. Milk Yield 3 stores the most recent recording, Milk Yield 0 stores the oldest, and Milk Yields 1 and 2 store the recordings in between.

Assuming that the milk yield information was downloaded from the ATL control system after 11.00am (after the morning miking):

Twice-A-Day Milking  

Milk Yield 3 will store todays morning milk yields. Milk Yield 2 will store yesterday afternoons milk yields. Milk Yield 1 will store yesterday mornings milk yields - used for comparison with Milk Yield 3.

Daily Milk Yield = Milk Yield 3 + Milk Yield 2

Three-Times-A-Day  

Milk Yield 3 will store todays moring milk yields. Milk Yield 2 will store yesterday evenings milk yields. Milk Yield 1 will store yesterday afternoons milk yields. Milk Yield 0 will store yesterday mornings milk yields - used for comparison with Milk Yield 3.

Daily Milk Yield = MIlk Yield 3 + Milk Yield 2 + Milk Yield 1

NB - The Daily Milk Yield will only add up to the individual Milk Yields if the data has been downloaded after 11.00am and before the next milking.

Technical Support - For assistance with any of the above please contact ATL using the following e-mail address: support@atlagri.com

   
Copyright © ATL Agricultural Technology Ltd 2005-2008   Last Updated 20 August 2008