%%%
  VERSION:1
  LANGUAGE:ENGLISH
%%%

MODULE PAL_PDYN(SYSMODULE)
  !######################################################
  !# PalletWare module PAL_PDYN				#
  !# This module holds the public dynamic data.		#
  !# 							#
  !#							#
  !#							#
  !######################################################
  CONST string pal_pdyn_rev:="$Revision: 1.1 $";
  ! number of palcycle running for each context
  PERS num CycleNum{5}:=[1,0,0,0,0];
  ! number of layers to make for each context
  PERS num CycNbLay{5}:=[200,99,99,99,99];
  ! detection of the pick error
  VAR bool PickError;
  ! current infeeder request
  PERS num CurNbProd{5}:=[3,3,3,3,0];
  PERS num CurOrient{5}:=[1,1,1,1,0];
  ! previous infeeder request
  PERS num PrevNbProd{5}:=[3,3,3,3,0];
  PERS num PrevOrient{5}:=[1,1,1,1,0];
  
  ! robtarget for safety moves
  VAR robtarget saftarget;
  ! number of the last stack in the system
  PERS num last_stack:=3;
  ! flag stating if line is running
  PERS bool InCycle:=FALSE;
  ! number of palcycles loaded
  PERS num NbPalCycles:=4;
  ! tuning of pick pallet height
  PERS num PickPalHeight{3}:=[-20,-20,-20];
  ! tuning of place pallet height
  PERS num PlacePalHeight{3}:=[-20,0,0];
  ! moving to stack flag
  PERS bool reinit_search:=FALSE;
  ! main restarted flag for safety height calculation
  PERS bool MainRestarted:=FALSE;
  ! stop at end of pallet flags
  PERS bool StopAtPalEnd{5}:=[FALSE,FALSE,FALSE,FALSE,FALSE];
  ! feeder is empty flags
  PERS bool FeederEmpty{5}:=[FALSE,FALSE,FALSE,FALSE,FALSE];
ENDMODULE
