EasyManuals Logo
Home>Omron>Recording Equipment>SYSMAC NX-CIF101

Omron SYSMAC NX-CIF101 User Manual

Omron SYSMAC NX-CIF101
232 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #217 background imageLoading...
Page #217 background image
A - 37
Appendices
NX-series Communications Interface Units User’s Manual (W540)
A-4 Programming Samples
A
A-4-3 Programming Sample 2: Sending Data
//Set Output Data Length.
N1_Ch1_Output_Data_Length:=OutputDataLength;
//Set output data.
//Set the SendDat array
to the following size: Number of divisions of send
//data * Output divided data size [bytes]
AryMove(SendDat[SendDatOffset], N1_Ch1_Output_Data_01[0], UINT#4);
AryMove(SendDat[SendDatOffset+4], N1_Ch1_Output_Data_02[0], UINT#4);
AryMove(SendDat[SendDatOffset+8], N1_Ch1_Output_Data_03[0], UINT#4);
AryMove(SendDat[SendDatOffset+12], N1_Ch1_Output_Data_04[0], UINT#4);
AryMove(SendDat[SendDatOffset+16], N1_Ch1_Output_Data_05[0], UINT#4);
SendDatOffset:= SendDatOffset + OutputDataLength;
//Set Output Data Type.
IF( LastDatFlag = TRUE ) THEN
N1_Ch1_Send_Data_Flag := FALSE;
N1_Ch1_Send_Last_Data_Flag:=TRUE;
ELSE
N1_Ch1_Send_Data_Flag := TRUE;
N1_Ch1_Send_Last_Data_Flag:=FALSE;
END_IF;
//Get current Send Completed Toggle Bit status (before sending data).
PreSendCompletedToggle:=N1_Ch1_Send_Completed_Toggle_Bit;
// Set Output SID.
ExpectedOutputSID:=N1_Ch1_Output_SID + 1;
IF (ExpectedOutputSID=USINT#0) THEN
ExpectedOutputSID:=USINT#1; //If Output SID is 0, set 1.
END_IF;
N1_Ch1_Output_SID:=ExpectedOutputSID;
SendStage := INT#2;//Transition (to confirmation of send request completion)
2: //Confirm completion of send request from CIF Unit.
//Confirm Output SID Response.
IF (ExpectedOutputSID = N1_Ch1_Output_SID_Response) THEN
// Clear Output Data Type.
N1_Ch1_Send_Data_Flag:=FALSE;
N1_Ch1_Send_Last_Data_Flag:=FALSE;
IF( LastDatFlag = TRUE ) THEN
SendStage := INT#3;//Transition (to confirmation of send completion)
ELSE
SendStage := INT#1;//Transition (to send request)
END_IF;
END_IF;
3://Confirm completion of sending data on the serial line.
//Check Send Completed Toggle Bit.
IF (N1_Ch1_Send_Completed_Toggle_Bit <> PreSendCompletedToggle) THEN
SendStage:=INT#0; //Transition (return to initial status)
END_IF;
END_CASE;

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Omron SYSMAC NX-CIF101 and is the answer not in the manual?

Omron SYSMAC NX-CIF101 Specifications

General IconGeneral
BrandOmron
ModelSYSMAC NX-CIF101
CategoryRecording Equipment
LanguageEnglish

Related product manuals