code: function checkRFCData(data){
     var ret=null;
     var RFC_Version = data[0];
     var TPKT_Length = data.readInt16BE(2);
     var TPDU_Code = data[5]; //Data==0xF0 !!
     var LastDataUnit = data[6];//empty fragmented frame => 0=not the last package; 1=last package
  
     if(RFC_Version !==0x03 && TPDU_Code !== 0xf0){
        //Check if its an RFC package and a Data package
        return 'error';
     }else if((LastDataUnit >> 7) === 0 && TPKT_Length == data.length &&  data.length === 7){
        // Check if its a Fast Acknowledge package from older PLCs or  WinAC or data is too long ...
        // For example: <Buffer 03 00 00 07 02 f0 00> => data.length==7
        ret='fastACK';
     }else if((LastDataUnit >> 7) == 1 && TPKT_Length <= data.length){
        // Check if its an  FastAcknowledge package + S7Data package
        // <Buffer 03 00 00 1b 02 f0 80 32 03 00 00 00 00 00 08 00 00 00 00 f0 00 00 01 00 01 00 f0> => data.length==7+20=27
        ret=data;
     }else if((LastDataUnit >> 7) == 0  && TPKT_Length !== data.length){
        // Check if its an  FastAcknowledge package + FastAcknowledge package+ S7Data package
        // Possibly because NodeS7 or Application is too slow at this moment!
        // <Buffer 03 00 00 07 02 f0 00 03 00 00 1b 02 f0 80 32 03 00 00 00 00 00 08 00 00 00 00 f0 00 00 01 00 01 00 f0>  => data.length==7+7+20=34
        ret=data.slice(7, data.length)//Cut off the first Fast Acknowledge Packet
     }else{
        ret='error';
     }
     return ret;
  }
docs: Internal Functions