Jump to content

PhilipW

Members
  • Posts

    25
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

PhilipW's Achievements

Member

Member (2/4)

0

Reputation

  1. Do you data loggers support linear position sensors? These sensors are sometimes referred to as linear encoders. Omega has a sensor for linear position with their data loggers. The sensor uses analog output. Cheers
  2. 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?
  3. So the I/O port has four-bits (0 - 3) Do these bits correspond the screw terminals labelled DIO0, DIO1, DIO2 and DIO3?
  4. To clarify, a digital port (AUXPORT) consists for 4 digital I/O lines. For the USB-1808X there are 4 screw terminals labelled DIO0, DIO1, DIO2 and DIO3. By default each I/O line has four bits. The maximum value for the digital port is 16 bits = 2^16 - 1 = 65,535 ? Can I configure the number of I/O lines are in digital port ? Can I configure the number of bits in an I/O line ? Could I configure AUXPORT to only use DIO0 and DIO0 have 16 bits?
  5. 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?
  6. 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 }
  7. Hi Fausto, And to configure the quadrature encoder, I must use the following parameters? MccDaq.CounterMode Mode = MccDaq.CounterMode.Encoder | MccDaq.CounterMode.EncoderModeX1; MccDaq.CounterDebounceTime DebounceTime = MccDaq.CounterDebounceTime.DebounceNone; MccDaq.CounterDebounceMode DebounceMode = 0; MccDaq.CounterEdgeDetection EdgeDetection = MccDaq.CounterEdgeDetection.RisingEdge; MccDaq.CounterTickSize TickSize = 0; int MapCounter = 0; int counterChannel = 2; // encoder channels are 2 and 3 daqBoard.CConfigScan(counterChannel, Mode, DebounceTime, DebounceMode, EdgeDetection, TickSize, MapCounter);
  8. The USB-1808X has 2 general purpose counters (0 and 1). There are also 2 counters for the quadrature encoder (2 and 3). In the wiring assignment, does counter 2 (quadrature encoder) correspond to screw terminals ENC0A, ENC0B and ENC0Z? Does counter 3 (quadrature encoder) correspond to screw terminals ENC1A, ENC1B and ENC1Z? Regards, Philip
  9. Hello Fausto, Sorry I could not respond earlier. I had other commitments. I've provided a sample application. I connected it to a USB-1808X. A Turck encoder is attached to the USB-1808X. The application can use the digital input or a counter. The application generates a text file which shows information. Data is collected and processed each second. The samples per channel per second is 2500. Data is collected with DaqInScan(). If using digital input, the application counts the rising edges ("0" followed by "1") to determine the number of pulses per second. I'm trying to show that using digital input or a counter will produce the same number of pulses per second. See attached zip file. Regards, Philip WpfAppEncoderPulses.zip
  10. If I use digital input (MccDaq.ChannelType.Digital16) I am able to read the output from an Turck encoder. The output looks like the following: 0 0 0 1 1 0 1 1 0 0 0 0 1 1 1 0 0 0 0 0 0 0 1 1 1 0 0 1 0 0 0 0 1 1 1 0 0 1 0 0 0 0 1 1 1 0 0 0 1 1 0 1 1 1 1 0 0 0 1 1 0 0 1 0 0 0 0 1 1 1 0 0 1 0 0 0 0 1 1 1 0 0 ... The output is a square wave. The samples per channel per second is 2500. I wrote a method to count the pulses per second and the average pulse count is around 900. If I use a counter (MccDaq.ChannelType.Ctr) to process the output from the Turck encoder and configure the counter as follows: MccDaq.CounterMode Mode = MccDaq.CounterMode.Totalize; MccDaq.CounterDebounceTime DebounceTime = MccDaq.CounterDebounceTime.DebounceNone; MccDaq.CounterDebounceMode DebounceMode = 0; MccDaq.CounterEdgeDetection EdgeDetection = MccDaq.CounterEdgeDetection.RisingEdge; MccDaq.CounterTickSize TickSize = 0; int MapCounter = 0; uLStat = daqBoard.CConfigScan(CounterNum, Mode, DebounceTime, DebounceMode, EdgeDetection, TickSize, MapCounter); The output looks like the following: 0 1 1 1 3 4 5 5 5 6 7 8 8 8 10 11 12 12 12 12 14 15 15 15 16 17 18 19 19 20 21 22 22 22 23 24 25 26 26 26 28 29 29 29 30 31 32 32 32 34 35 36 36 36 36 38 39 ... The samples per channel per second is also 2550. The average pulse count per second is around 3500. Any idea why my pulse counts don't match? In the encoder data, when a 1 follows a 0, is it a rising edge? Regards, Philip
  11. The online help for CConfigScan() and the only example program for counter type Counters.clsCounters.CTRQUAD (ClnScan03) indicate that the input channel counts pulses. In your last post, you indicate that the input channel measures distance. You mention a resolution of 1200. What is the 1200? Does your software need to know the length of the conveyor belt? You mentioned a length of 10 feet in your last post. How would you configure CConfigScan() with the values in your last post?
  12. You are correct to say that it would be nice if there was a status register that indicated direction. I have a situation where a conveyor belt has ONE speed (pulses per second = 392) and can go forward (clockwise) or backwards (counter clockwise). 1. From a stopped position (pulses per second = 0), the conveyor belt moves forward and the pulses per second is 392 2. From a stopped position (pulses per second = 0), the conveyor belt moves backward. Will the pulses per second be -392 since the USB-1808X decrements the pulse count from 0?
×
×
  • Create New...