SUB_TOD_TIME

Subtract TIME from TIME_OF_DAY

SUB_TOD_TIME subtracts a TIME value from a value of the data type TIME_OF_DAY. The result is stored in the output variable of the data type TIME_OF_DAY.

Parameters

Input

Unnamed input (TIME_OF_DAY)

1st input: minuend

Unnamed input (TIME)

2nd input: subtrahend

Output

Unnamed output (TIME_OF_DAY)

Result

Example

POU header

All input and output variables used for programming this function have been declared in the POU header. The same POU header is used for all programming languages.

	VAR
		TOD_value: TIME_OF_DAY:=TOD#18:29:59;
		TIME_value: TIME:=T#2h35m38s560ms;
		TOD_result: TIME_OF_DAY:=TOD#00:00:00;
	END_VAR

LD body

BODY
    WORKSPACE
        NETWORK_LIST_TYPE := NWTYPELD ;
        ACTIVE_NETWORK := 0 ;
    END_WORKSPACE
    NET_WORK
        NETWORK_TYPE := NWTYPELD ;
        NETWORK_LABEL :=  ;
        NETWORK_TITLE :=  ;
        NETWORK_HEIGHT := 5 ;
        NETWORK_BODY
B(B_F,SUB_TOD_TIME!,Instance,18,1,27,4,,?D?D?C);
B(B_VARIN,,TOD_value,16,1,18,3,);
B(B_VARIN,,TIME_value,16,2,18,4,);
B(B_VAROUT,,TOD_result,27,1,29,3,);
L(1,0,1,5);
        END_NETWORK_BODY
    END_NET_WORK
END_BODY

ST body

TOD_result := SUB_TOD_TIME(TOD_value, TIME_value);

Modified on: 2019-01-25Feedback on this pagePanasonic hotline