Hi Claes
I have create some classes for the IO Module
National Instruments NI-USB-6501
This module has no In en Output led to indicate the hardware input and output status.
I have create some visible tricks to indicate those status, but it is not perfect.
Is there a variable that indicate the status.
for example the Di signal has no input signal in the type pwr_sClass_ChanDi
#ifndef pwr_cClass_ChanDi
#define pwr_cClass_ChanDi 131336UL
typedef struct {
pwr_tString80 Description pwr_dAlignLW;
pwr_sAttrRef SigChanCon pwr_dAlignW;
pwr_tString40 Identity pwr_dAlignW;
pwr_tUInt16 Number pwr_dAlignW;
pwr_tBoolean ConversionOn pwr_dAlignW;
pwr_tBoolean InvertOn pwr_dAlignW;
pwr_tDataRepEnum Representation pwr_dAlignW;
} pwr_sClass_ChanDi;
/*_*
@Aref copyDiSignal copyDiSignal
*/
void copyDiSignal(io_tCtx ctx, io_sChannel *chanp, pwr_tInt32 ivalue) {
pwr_sClass_ChanDi *cop = (pwr_sClass_ChanDi *) chanp->cop;
pwr_sClass_Di *sop = (pwr_sClass_Di *) chanp->sop;
pwr_tBoolean sensed_Bit;
pwr_tBoolean actual_Bit;
//channel && signal object connect?
if cop && sop && cop->ConversionOn) {
sensed_Bit = (ivalue > 0); //get sensed_Bit from bytes
actual_Bit = cop->InvertOn ?
((sensed_Bit & 1) == 0) : (sensed_Bit); //reverse-input else, input
*(pwr_tBoolean *) (chanp->vbp) = actual_Bit; //new value
}
}
greeting cees