
Example of arguments specification
(1) Writing 250 to "D0100" (Word type data).
buf.type_a 9 or 'D'
buf.type_d 1
buf.datano_s 100
buf.datano_e 101
length 8+2*1 (=10)
buf.u.idata[0] 250
(2) Writing 0 to every "R0200" through "R0209" (Byte type data).
buf.type_a 5 or 'R'
buf.type_d 0
buf.datano_s 200
buf.datano_e 209
length 8+1*10 (=18)
buf.u.cdata[0] all 0
,..,buf.u.cdata[9]
[Example]
The following program sets the specified bit of a specified internal
relay (R) to "1".
#include <data.h>
#include <fwindow.h>
#include <stdio.h>
/* number is index number of R. */
/* bit is target bit index to be set. */
short example( short number, short bit )
{
short ret ;
struct iodbpmc buf ;
ret = pmc_rdpmcrng( 'R', 0, number, number, 8+1*1, &buf ) ;
if ( !ret ) {
buf.u.cdata[0] │= ( 1 << bit ) ;
ret = pmc_wrpmcrng( 8+1*1, &buf ) ;
}
return ( ret ) ;
}