Anonymous Anonymous - 7 months ago
394 0

fsafsa

C#

vsafsa

IF intUpdateRemainingSelectedAmount = 1 THEN
	FOR intCounter:=1 TO NUM_PALLETS BY 1 DO
	//intAssignedSelectedArticleAmount[1] := aArticleInput[(aArticleInput[1].intArticleListItem)+((aArticleInput[1].intArticleListPage-1)*5)].intArticleAmountInput;
	intAssignedSelectedArticleAmount[intCounter] := aViewingArticleItems[1, (aArticleInput[intCounter].intArticleListItem)+((aArticleInput[intCounter].intArticleListPage-1)*5)].intAssignedArticleAmount;
	intUpdateRemainingSelectedAmount := 0;
	END_FOR
END_IF

VAR_GLOBAL
	
	//ERRORCODES// 0=FALSE, 1=TRUE
	intOrderQueueEmpty					: INT;
	intPalletPatternMissing				: INT;
	intPalletResetRequired				: ARRAY [0..NUM_PALLETS+2] OF INT; // [0]=FRAME
	
	//-----------------------//
	//INPUT// (FROM HMI TO PLC)
	//-----------------------//
	
	//CPL// 
	bCycleStart 						: BOOL;
	bCycleStop 							: BOOL;
	bRobotStart 						: BOOL;
	bRobotHold							: BOOL;
	bReset								: BOOL;
	bAutomaticMode 						: BOOL;
	
	//System//
	sSystemOrderFilePath 				: STRING; //(.CNC)
	sSystemNestFilePath 				: STRING; //(.CSV)
	sSystemMachineProgramFilePath		: STRING; //(.CNC)
	
	//Frame//
	intFrameProducedPartsInput 			: INT;
	intFrameProcessedSheetsInput 		: INT;
	
	//Order//
	intOrderListItem 					: INT := 1; // SELECTED ITEM IN ORDER LIST
	intOrderListPage 					: INT := 1; // CURRENT PAGE NUMBER
	intOrderListQuantity 				: INT := 1; // ORDER QUANTITY FOR TRANSFER INPUT
	intOrderListUpdate					: INT; //1=TRUE, 0=FALSE
	bOrderListSwitchPage 				: BOOL; // ACTIVATE WHEN BUTTON PRESSED
	bOrderListTransfer 					: BOOL; // ACTIVATE WHEN BUTTON PRESSED
	
	//Queue//
	intQueueListItem 					: INT := 1; //DEFAULT VALUE
	intQueueListSort 					: INT; //-1 = SORT UP, 1 = SORT DOWN
	bQueueListSort 						: BOOL;
	bQueueListDelete 					: BOOL;
	bQueueListActiveOrderDeleteA 		: BOOL;
	bQueueListActiveOrderDeleteB 		: BOOL;
	bQueueListSetActiveOrder 			: BOOL;
	
	//Pattern//
	intPatternListItem 					: INT := 1; //DEFAULT VALUE
	intPatternListPage 					: INT := 1; //DEFAULT VALUE
 	intPatternListUpdate 				: INT; //1=TRUE, 0=FALSE
	bPatternListSwitchPage 				: BOOL; // ACTIVATE WHEN BUTTON PRESSED
	intPatternAllocate 					: INT; //ACTIVATE PALLET PATTERN 1-9 ALLOCATING
	intPatternRemove 					: INT; //ACTIVATE PALLET PATTERN 1-9 REMOVING
	//intPalletActivation					: INT;
	
	//Article//
	aArticleInput 						: ARRAY [1..NUM_PALLETS] OF ST_PalletArticleInput;
	
	//DO NOT REMOVE THIS!
	aDummyArticleInput 					: ARRAY [1..NUM_PALLETS] OF ST_PalletArticleInput;
	
	//Gripper// 
	aGripper							: ARRAY [1..4] OF ST_Gripper;
	aZoneInputSheetGripper				: ARRAY [1..4] OF INT; // 1=ACTIVE, 0=INACTIVE
	
	//Sequence//
	bSequenceCuttingTableAUnload		: BOOL;
	bSequenceCuttingTableALoad			: BOOL;
	bSequenceCuttingTableBUnload		: BOOL;
	bSequenceCuttingTableBLoad			: BOOL;
	
	//-----------------------//
	//OUTPUT// (FROM PLC TO HMI)
	//-----------------------//
	
	//CPL//
	//1=TRUE, 0=FALSE
	intCycleStartInd 					: INT;
	intCycleStopInd 					: INT;
	intRobotStartInd 					: INT;
	intRobotHoldInd						: INT;
	intResetInd							: INT;
	intAutomaticModeInd 				: INT;
	intCellStatusInd					: INT;	//0=STOPPED, 1=REDUCED, 1=STARTED
	
	//Overview//
	aPalletStatus						: ARRAY [1..(NUM_PALLETS+2)] OF INT; // 0=ACTIVE, 1=FULL, PALL: [10] = SKELLETPALL, [9]=INPALL (0=ACTIVE, 1=EMPTY !IMPORTANT)
	aPalletReset						: ARRAY [0..(NUM_PALLETS+2)] OF BOOL; // [0]=TRIGGER RESET
	aSystemStatus						: ARRAY [1..3] OF INT; // 0=FALSE, 1=TRUE, 	// [1]=PLÅTTÄNGER, [2]=MASKINDÖRR, ...
	
	//Frame//
	intFrameProducedParts 				: INT;
	intFrameTotalParts 					: INT;
	intFrameRemainingParts 				: INT;
	intFrameProcessedSheets 			: INT;
	intFrameTotalSheets 				: INT;
	intFrameRemainingSheets 			: INT;
	bFrameAlarmActive 					: BOOL;
	bFrameMessageActive 				: BOOL;
	intFrameAlarmActive 				: INT := 1; //DEFAULT DEMO VALUE
	intFrameMessageActive 				: INT := 1; //DEFAULT DEMO VALUE
	intFrameSequenceNumber 				: INT; //MIRROR
	intFrameSequenceStepNumber			: INT; //MIRROR
	intFrameSequenceAnchor				: INT; //1001 = Seq 1.1, 4002 = Seq 4.2
	sFrameSequenceInfo 					: STRING;
	sFrameRobotInfoOne 					: STRING;
	sFrameRobotInfoTwo 					: STRING;
	intFrameQueueOrders 				: INT;
	intFrameQueueSheets 				: INT;
	intFrameStepNumber 					: INT;
	intFrameSequenceInd 				: INT;
	bFrameResetSequence					: BOOL;
	
	//Order//
	arrQueueList 						: ARRAY [1..7] OF ST_Order; //OBJECTS CURRENTLY VIEWED IN HMI ORDER QUEUE
	//aQueueListNames					: ARRAY [1..7] OF T_MaxString; //OBJECTS CURRENTLY VIEWED IN HMI ORDER QUEUE
	//aQueueListIterations				: ARRAY [1..7] OF UINT; //OBJECTS CURRENTLY VIEWED IN HMI ORDER QUEUE
	
	sActiveOrderA						: STRING; // SELECTED ORDER, SEND TO MACHINE AT CYCLE START
	sActiveOrderB						: STRING;// SELECTED ORDER, SEND TO MACHINE AT CYCLE START
	intOrderListItemAmount 				: INT;
	intOrderListMaxPageAmount 			: INT := 1;
	intQueueListCurrentItems 			: INT;
	aViewingOrderItems					: ARRAY [1..7] OF STRING; // OBJECTS CURRENTLY VIEWED IN HMI ORDER LIST
	intActiveOrderADeleteInd			: INT;
	intActiveOrderBDeleteInd			: INT;
	
	//Pattern//
	intPatternListItemAmount 			: INT;
	intPatternListMaxPageAmount 		: INT := 1; // DEFAULT VALUE
	intPatternListCurrentItems 			: INT;
	aViewingPatternItems				: ARRAY [1..7] OF STRING; // OBJECTS CURRENTLY VIEWED IN HMI PATTERN LIST
	aActivePattern 						: ARRAY [1..9] OF STRING; // ACTIVE PATTERN ON PALLET (1-9)
	
	//Article//
	aViewingArticleItems				: ARRAY [1..NUM_PALLETS, 1..5] OF ST_PalletArticleList; // One for each visible item in the HMI.
	intRemainingSelectedArticleAmount 	: ARRAY [1..NUM_PALLETS] OF INT; //The remaining articles to assign 
	intAssignedSelectedArticleAmount	: ARRAY [1..NUM_PALLETS] OF INT;
	intUpdateRemainingSelectedAmount	: INT; // 1=True, 0=false
	intArticleAmountSaved				: ARRAY [1..NUM_PALLETS] OF INT; // Enable save button if value is changed, 1=true, 0=false
	
	//Gripper//
	aZoneSheetGripper					: ARRAY [1..4] OF INT; // 1=ACTIVE, 0=INACTIVE
	
	//Sequence//
	intSequenceCuttingTableAInd			: INT; //0= NO ACTION, 1= LOAD, 2= UNLOAD
	intSequenceCuttingTableBInd			: INT; //0= NO ACTION, 1= LOAD, 2= UNLOAD
	
END_VAR