Mitsubishi Electronics MELSEC Q series MELSEC L series Home Theater Server User Manual


 
5-78
5.3 Serial Communication
5.3.4 BIDOUT instruction
G_BIDOUT
[ST]
PLS(X20, Var_Flag_Inst); (* Transmission instruction pulse *)
IF(Var_Flag_Inst=TRUE)THEN
MOV(TRUE, H4241, D11); (* Sets send data *)
MOV(TRUE, H4443, D12);
MOV(TRUE, H4645, D13);
MOV(TRUE, H0047, D14);
MOV(TRUE, H0AD, D15);
MOV(TRUE, 1, Var_ControlData[0]); (* Sets transmission channel to 1 *)
MOV(TRUE, 5, Var_ControlData[2]);
(* Sets allowable number of words for send data to 5 words *)
G_BIDOUT(TRUE, H0, Var_ControlData, D11, Var_Result);
(* Sends data *)
END_IF;
IF(Var_Result[0]=TRUE)THEN (* Execution finished *)
IF(Var_Result[1]=FALSE)THEN (* Normal completion *)
SET(TRUE, Var_Flag_Normal); (* Turns normal completion flag ON *)
ELSE (* Error completion *)
MOV(TRUE, Var_ControlData[1], Var_ErrorCode);(* Stores error code *)
SET(TRUE, Var_Flag_Error); (* Turns error completion flag ON *)
END_IF;
END_IF;
IF(X21=TRUE)THEN
RST(TRUE, Var_Flag_Normal); (* Turns normal completion flag OFF *)
RST(TRUE, Var_Flag_Error); (* Turns error completion flag OFF *)
END_IF;