I’m using the USB-1808X. On the device there are labels for DIO0, DIO1 and GND. I assume that the label refer to digital input 0, digital input 1 and ground.
Within the code
short[] channelArray = null;
MccDaq.ChannelType[] channelTypeArray = null;
int numberOfDigitalChannels = 1;
channelArray = new short[numberOfDigitalChannels];
channelTypeArray = new MccDaq.ChannelType[numberOfDigitalChannels];
channelTypeArray[0] = MccDaq.ChannelType.Digital;
channelArray[0] = 0; // port 0
When I call daqBoard.DaqInScan(), I get the exception message “Invalid digital port number”
Is there no port 0?
If I use
channelArray[0] = (short)MccDaq.DigitalPortType.AuxPort; // port 1
calling daqBoard.DaqInScan() is successful.
I noticed that for enumerated type DigitalPortType, there is no enumeration whose value is 0.
Question
PhilipW
I’m using the USB-1808X. On the device there are labels for DIO0, DIO1 and GND. I assume that the label refer to digital input 0, digital input 1 and ground.
Within the code
short[] channelArray = null;
MccDaq.ChannelType[] channelTypeArray = null;
int numberOfDigitalChannels = 1;
channelArray = new short[numberOfDigitalChannels];
channelTypeArray = new MccDaq.ChannelType[numberOfDigitalChannels];
channelTypeArray[0] = MccDaq.ChannelType.Digital;
channelArray[0] = 0; // port 0
When I call daqBoard.DaqInScan(), I get the exception message “Invalid digital port number”
Is there no port 0?
If I use
channelArray[0] = (short)MccDaq.DigitalPortType.AuxPort; // port 1
calling daqBoard.DaqInScan() is successful.
I noticed that for enumerated type DigitalPortType, there is no enumeration whose value is 0.
How do I access digital Input 0?
public enum DigitalPortType
{
AuxPort = 1,
AuxPort0 = 1,
AuxPort1 = 2,
AuxPort2 = 3,
FirstPortA = 10,
FirstPortB = 11,
FirstPortC = 12,
FirstPortCL = 12,
FirstPortCH = 13,
SecondPortA = 14,
SecondPortB = 15,
SecondPortCL = 16,
SecondPortCH = 17,
ThirdPortA = 18,
ThirdPortB = 19,
ThirdPortCL = 20,
ThirdPortCH = 21,
FourthPortA = 22,
FourthPortB = 23,
FourthPortCL = 24,
FourthPortCH = 25,
FifthPortA = 26,
FifthPortB = 27,
FifthPortCL = 28,
FifthPortCH = 29,
SixthPortA = 30,
SixthPortB = 31,
SixthPortCL = 32,
SixthPortCH = 33,
SeventhPortA = 34,
SeventhPortB = 35,
SeventhPortCL = 36,
SeventhPortCH = 37,
EighthPortA = 38,
EighthPortB = 39,
EighthPortCL = 40,
EighthPortCH = 41
}
Link to comment
Share on other sites
3 answers to this question
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now