Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • The provider status for the corresponding data module, identifiable by the slot number, releases the respective process data.


Example for C/C++



Code Block
languagecpp
themeConfluence
titleSource-Code
linenumberstrue
collapsetrue
// Array in size of process-image
uint8_t		abRecvData[27] = {0};
uint8_t 	abSendData[22] = {0};
	...
	...
	...
// Set flags of header-states
abSendData[0] = 0x80;
abSendData[1] = 0x80;
abSendData[2] = 0x80;
abSendData[3] = 0x80;

// Do I/O data exchange until a key is hit
while(!kbhit())
{	
	if(CIFX_NO_ERROR != xChannelIORead(hChannel, 0, 0, sizeof(abRecvData), abRecvData, IO_WAIT_TIMEOUT)){
		// ERROR reading IO Data area!
		...
	}
	
	// Consumer-states for incomming data-slots - set to GOOD-Flag when all data could be received completely
	abRecvData[4] = 0x80;
	abRecvData[8] = 0x80;
	
	// check if provider flags from node are GOOD-Flag...
	if(abRecvData[8] != 0x80 || abRecvData[26] != 0x80){
		// Provider status are BAD ... data from node are not persistent
		...
	}
	
	// Handle I/O data-arrays
	... = abRecvData[/* {x: 4 .. 7 } */];
	... = abRecvData[/* {x: 10 .. 25 } */];
	abSendData[/* {x: 5, 6 } */] = ...
	abSendData[/* {x: 9 .. 20 } */] = ...

	// Provider-states for all outging data-slots - set to GOOD-Flag
	abSendData[7] = 0x80;
	abSendData[21] = 0x80;
	
	if(CIFX_NO_ERROR != xChannelIOWrite(hChannel, 0, 0, sizeof(abSendData), abSendData, IO_WAIT_TIMEOUT)){
		// ERROR writing IO data area!
		...
	}
	...
}



IO Monitor

The following figure shows the entire structure of the process image in the IO monitor. All modules are released by the set "GOOD" (0x80) flag and are transmitted. Reading the process data from the process image requires knowledge of the position of the user data.

...