bool ComediSubDeviceDIn::isOn( unsigned int bit /*= 0*/) const { unsigned int tmp; if (!myCard) return false; comedi_dio_read( myCard->getDevice()->it,_subDevice,bit, &tmp ); return (tmp == 1); }
bool ComediSubDeviceDOut::checkBit( unsigned int bit) const { unsigned int value = 0; // read DO or DIO comedi_dio_read(myCard->getDevice()->it, subDevice, bit, &value); return value == 1; }
double ComediDigitalInput::read() { uint readBit; // Add the following line if you need to change between input and output during the same simulation //comedi_dio_config(m_device, m_subdevice, m_channels[0],COMEDI_INPUT); comedi_dio_read(m_device,m_subdevice,m_channels[0], &readBit); return (double) readBit; }
static void dio_read( void ) { comedi_t *dev = lookup_dev( *sp++ ); unsigned int subdev = *sp++; unsigned int chan = *sp++; unsigned int data; int c = comedi_dio_read( dev, subdev, chan, &data ); if( c < 1 ) comedi_perror( "@dio " ); *--sp = data; }
int io_read(int channel) { unsigned int data=0; if(channel >= 1 && channel <= 3) { comedi_dio_read(it_g, IO_DEV, DI(channel), &data); return (int)data; } else { printf("Incorrect io channel\n"); return -1; } }
void com_dio_read(unsigned int index, BYTE* value) { //write input n to bit unsigned int b; comedi_dio_read(it, Comedi_subdev_i, index, &b); *value = (BYTE) b; }
void __po_hi_c_driver_exarm_ni_6071e_digital_poller (unsigned int* data1, unsigned int* data2) { comedi_dio_read(po_hi_driver_exarm_ni_6071e_digital_it, 2, 1, (unsigned int*)data1); comedi_dio_read(po_hi_driver_exarm_ni_6071e_digital_it, 2, 0, (unsigned int*)data2); return; }