
B-63494EN/02 3.SAFETY FUNCTIONS
- 41 -
Reading of programmable safe-related input signals
[Function name] pmc_rdsafeprgio
[Format] #include <fwindow.h>
int pmc_rdsafeprgio( int datano , struct iodbsaftyprg *buf ) ;
struct iodbsaftyprg {
int datano ; /* Data number */
int dummy ; /* Not used */
char cdata[2] ; /* I/O signal */
} ;
[Argument] datano : Data number. Specify 0.
Buf : Programmable safe-related input signal storage area
[Return value] 0 : Normal termination
6 : The dual check safety option is not added.
[Description] This function reads the programmable safe-related input signals on the
FSSB side of the programmable safe-related I/O signal function of
Dual Check Safety.
cdata[0] Programmable safe-related input signal 1 (DI+002)
cdata[1] Programmable safe-related input signal 2 (DI+003)
[Example of use] The state of programmable safe-related input signals is indicated.
void print_safetyprgio( void )
{
int ret;
struct iodbsaftyprg buf;
ret = pmc_rdsafeprgio( 0 , &buf ) ;
if( ret == 0 ) {
printf( "G334 : %02xh ¥n" , buf.cdata[0] );
printf( "G335 : %02xh ¥n" , buf.cdata[1] );
}
}