Jump to content
  • 0

simultaneous analog and counter input with occasional digital output on USB-1808X



Using 3 analog inputs and 1 counter I am able to receive voltage and encoder data simultaneously using DaqInScan() on a USB-1808X. The scan options include MacDaq.ScanOptions.Background and MccDaq.ScanOptions.Continuous.


Now I want to include occasional digital output. Within an application a user will click a button and the following code will be executed:


ushort DataValue = 255;

PortOutputNum = MccDaq.DigitalPortType.AuxPort;

MccDaq.ErrorInfo ULStat = daqBoard.DOut(PortOutputNum, DataValue);


The universal library returns the error:


Digital port not configured correctly for requested operation.


What I’m I doing wrong?

Link to comment
Share on other sites

5 answers to this question

Recommended Posts

  • 0

In an earlier post, you suggested I use DConfigPort() or DConfigBit().

If I use DConfigBit(AuxPort, 0, DigitalOut) I have to wire screw terminal DIO0 since bitNum=0.

If I use DConfigPort(AuxPort, DigitalOut) which bitNum is being used? Which screw terminal do I wire?

Link to comment
Share on other sites

  • 0

DConfigPort sets all four bits to be output. DConfigBit is just one bit. So you could do:

 DConfigBit(AuxPort, 0, DigitalOut)

 DConfigBit(AuxPort, 1, DigitalOut)

 DConfigBit(AuxPort, 2, DigitalOut)

 DConfigBit(AuxPort, 3, DigitalOut)

or just

DConfigPort(AuxPort, DigitalOut)

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...