Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC: Input Output status

Input Output status 6 years 4 months ago #9364

  • seec
  • seec's Avatar
  • OFFLINE
  • Senior Boarder
  • Posts: 78
  • Karma: 0
Hi Claes

I have create some classes for the IO Module
National Instruments NI-USB-6501
NI-USB-6501.jpg



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.
example.png



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
The administrator has disabled public write access.
The following user(s) said Thank You: brunad

Input Output status 6 years 4 months ago #9366

  • brunad
  • brunad's Avatar
  • OFFLINE
  • Gold Boarder
  • Posts: 247
  • Thank you received: 48
  • Karma: 11
Hi Seec

Very interesting indeed :)
Thank you.

Can you give me (us) a (your) sample project (as a link to a download server). It would be helpful to learn how one can create an IO Module and save lot of time.

/Bruno
Last Edit: 6 years 4 months ago by brunad.
The administrator has disabled public write access.

Input Output status 6 years 4 months ago #9368

  • claes
  • claes's Avatar
  • OFFLINE
  • Platinum Boarder
  • Posts: 3178
  • Thank you received: 502
  • Karma: 133
Hi cees,

No, there is no attribute for the signal status. I have often missed one myself but it's still waiting to be implemented.

/Claes
The administrator has disabled public write access.
  • Page:
  • 1
Time to create page: 8.725 seconds