Arduino Robogaia 3 Axis Encoder Shield Index Problem

I am trying to use the "3 Axis Encoder Counter Arduino Shield" by robogaia and am confused on how to make the encoder value reset to zero when the index or 'Z channel' is enabled. I have an encoder with A,B, and Z channels and want to reset the count after every revolution(the Z channel will only activate once per revolution). I will post my code below, what I have figured out is how to reset the encoder value to zero with the reset() function, but cannot figure out how to do this only when the z channel is HIGH (thus resetting it after each revolution). Any help would be helpful, thanks!

//Robogaia.com
// the sensor communicates using SPI, so include the library:
#include <SPI.h>



#define CNTR B00100000
#define CLR B00000000
int chipSelectPin1=10;
int chipSelectPin2=9;
int chipSelectPin3=8;
//end calibration values
//////////////////////////////////////////////


//*****************************************************
void setup() 
//*****************************************************
{
  Serial.begin(9600);

  pinMode(chipSelectPin1, OUTPUT);
  pinMode(chipSelectPin2, OUTPUT);
  pinMode(chipSelectPin3, OUTPUT);
  
  digitalWrite(chipSelectPin1, HIGH);
  digitalWrite(chipSelectPin2, HIGH);
  digitalWrite(chipSelectPin3, HIGH);
 
 LS7366_Init();

  

  delay(100);
}

//*****************************************************
void loop() 
//*****************************************************
{
        long encoder1Value;
        long encoder2Value;
        long encoder3Value;
        
        
        
        encoder1Value = getEncoderValue(1);  
        Serial.print("Encoder X= ");
        Serial.print(encoder1Value);
        
        encoder2Value = getEncoderValue(2);  
        Serial.print(" Encoder Y= ");
        Serial.print(encoder2Value);
        
        encoder3Value = getEncoderValue(3);  
        Serial.print(" Encoder Z= ");
        Serial.print(encoder3Value);
 
        Serial.print("\r\n");

  resetEncoder(1);

     delay(100); 
 
}//end loop

void resetEncoder(int encoder)
//*****************************************************
  {
    selectEncoder(encoder);
    SPI.transfer(CLR | CNTR);
    deselectEncoder(encoder);

  } //end func

  
//*****************************************************  
long getEncoderValue(int encoder)
//*****************************************************
{
    unsigned int count1Value, count2Value, count3Value, count4Value;
    long result;
    
    selectEncoder(encoder);
    
     SPI.transfer(0x60); // Request count
    count1Value = SPI.transfer(0x00); // Read highest order byte
    count2Value = SPI.transfer(0x00);
    count3Value = SPI.transfer(0x00);
    count4Value = SPI.transfer(0x00); // Read lowest order byte
    
    deselectEncoder(encoder);
   
    result= ((long)count1Value<<24) + ((long)count2Value<<16) + ((long)count3Value<<8) + (long)count4Value;
    
    return result;
}//end func

//*************************************************
void selectEncoder(int encoder)
//*************************************************
{
  switch(encoder)
  {
     case 1:
        digitalWrite(chipSelectPin1,LOW);
        break;
     case 2:
       digitalWrite(chipSelectPin2,LOW);
       break;
     case 3:
       digitalWrite(chipSelectPin3,LOW);
       break;    
  }//end switch
  
}//end func

//*************************************************
void deselectEncoder(int encoder)
//*************************************************
{
  switch(encoder)
  {
     case 1:
        digitalWrite(chipSelectPin1,HIGH);
        break;
     case 2:
       digitalWrite(chipSelectPin2,HIGH);
       break;
     case 3:
       digitalWrite(chipSelectPin3,HIGH);
       break;    
  }//end switch
  
}//end func



// LS7366 Initialization and configuration
//*************************************************
void LS7366_Init(void)
//*************************************************
{
   
    
    // SPI initialization
    SPI.begin();
    //SPI.setClockDivider(SPI_CLOCK_DIV16);      // SPI at 1Mhz (on 16Mhz clock)
    delay(10);
   
   digitalWrite(chipSelectPin1,LOW);
   SPI.transfer(0x88); 
   SPI.transfer(0x03);
   digitalWrite(chipSelectPin1,HIGH); 
   
   
   digitalWrite(chipSelectPin2,LOW);
   SPI.transfer(0x88); 
   SPI.transfer(0x03);
   digitalWrite(chipSelectPin2,HIGH); 
   
   
   digitalWrite(chipSelectPin3,LOW);
   SPI.transfer(0x88); 
   SPI.transfer(0x03);
   digitalWrite(chipSelectPin3,HIGH); 
   
}//end func