FUNCTION "FC_S7" : Void
{ S7_Optimized_Access := 'TRUE' }
VERSION : 0.1
   VAR_INPUT
      wInID : Word;
   END_VAR

   VAR_IN_OUT
      xInOutStart : Bool;
      xInOutError : Bool;
      wInOutStatus : Word;
      InOutAddr : Remote;
      InOutOrigin : Variant;
   END_VAR

   VAR_TEMP
      xDone : Bool;
      xError : Bool;
      wStatus : Word;
   END_VAR


BEGIN


	REGION PUT



	    "PUT_DB"(REQ := #xInOutStart,
	             ADDR_1 := #InOutAddr,//P#DB99.DBX68.0 BYTE 1,//Partner CPU,
	             SD_1 := #InOutOrigin,//Eigene CPU
	             ID := #wInID);

	    IF "PUT_DB".ERROR THEN
	        #xInOutError := "PUT_DB".ERROR;
	    END_IF;
	    IF "PUT_DB".STATUS <> 0 THEN
	        #wInOutStatus := "PUT_DB".STATUS;
	    END_IF;
	    IF "PUT_DB".DONE THEN
	        #xInOutStart := FALSE;
	    END_IF;
	END_REGION

	// REGION GET
	//     #rTrigGET(CLK := "DB_S7".xGetStart);
	//     IF #rTrigGET.Q THEN
	//         "DB_Test".rTimeResult := RUNTIME("DB_Test".rTimeMem);
	//     END_IF;
	//     "GET_DB"(REQ := "DB_S7".xGetStart,
	//              NDR => #xTemp,
	//              ADDR_1 := P#DB99.DBX2.0 DINT 1,//Partner CPU
	//              RD_1 := "DB_S7".arCarrier[1].nBarcode, //Eigene CPU
	//              ID := W#16#117);
	//     IF "GET_DB".NDR THEN
	//         "DB_Test".rTimeResult := RUNTIME("DB_Test".rTimeMem);
	//         "DB_S7".xGetStart := FALSE;
	//     END_IF;
	// END_REGION
END_FUNCTION

