Jump to content

Scott Mackey

Members
  • Posts

    1
  • Joined

  • Last visited

Scott Mackey's Achievements

Newbie

Newbie (1/4)

0

Reputation

  1. Hello, I am testing my PMD-1024HLS (same as USB-1024HLS) PortA, PortB, PortCL, PortCH using VB.net. My code is shown below. I am getting unexpected results when testing PortCH . The other three ports PortA, PortB, PortCL work fine in my test. In my test, I use both DOut() and DIn() methods. I use DOut() to write a hex value and then DIn() method to read the value back what was written and compare it. Am I misunderstanding the PortC nibble of PortCL and PortCH? My question is at the bottom. Thank you, Scott Mackey '// My code starts here: Private _daqBoard As MccDaq.MccBoard Private _portA As Short '// Byte Private _portB As Short '// Byte Private _portCL As Short '// Nibble low Private _portCH As Short '// Nibble high '// ** Constructor ************************************************************************************************** Public Sub New(ByVal outlet As OutletType) Dim ULStat As MccDaq.ErrorInfo Dim errPort As Boolean = False _daqBoard = New MccDaq.MccBoard() '// Create instance with access to all methods ULStat = _daqBoard.DConfigPort(FirstPortA, DigitalOut) '// Configure FirstPortA for output; all ports set low from this If (ULStat.Value <> NoErrors) Then errPort = True End If ULStat = _daqBoard.DConfigPort(FirstPortB, DigitalOut) '// Configure FirstPortB for output; all ports set low from this If (ULStat.Value <> NoErrors) Then errPort = True End If ULStat = _daqBoard.DConfigPort(FirstPortCL, DigitalOut) '// Configure FirstPortCL for output; all ports set low from this If (ULStat.Value <> NoErrors) Then errPort = True End If ULStat = _daqBoard.DConfigPort(FirstPortCH, DigitalOut) '// Configure FirstPortCH for output; all ports set low from this If (ULStat.Value <> NoErrors) Then errPort = True End If If errPort Then Throw New Exception("Driver Board for AC Controller did not configure properly.") End If End Sub '// PortA ** Works fine *************************************************************** _portA = &HAA ULStat = _daqBoard.DOut(FirstPortA, _portA) _portA = &H0 ULStat = _daqBoard.DIn(MccDaq.DigitalPortType.FirstPortA, _portA) '// PortB ** Works fine **************************************************************** _portB = &H55 ULStat = _daqBoard.DOut(FirstPortB, _portB) _portB = &H0 ULStat = _daqBoard.DIn(MccDaq.DigitalPortType.FirstPortB, _portB) '// PortCL ** Works fine *************************************************************** _portCL = &HA '// xxxx|1010 ULStat = _daqBoard.DOut(FirstPortCL, _portCL) _portCL = &H0 '// xxxx|0000 ULStat = _daqBoard.DIn(MccDaq.DigitalPortType.FirstPortCL, _portCL) '// PortCH ** NOT READING BACK WHAT WAS WRITTEN ******************************* _portCH = &HA0 '// 1010|xxxx ULStat = _daqBoard.DOut(FirstPortCH, _portCH) _portCH = &H0 '// 0000|xxxx ULStat = _daqBoard.DIn(MccDaq.DigitalPortType.FirstPortCH, _portCH) _portCH = 00H and not A0H
×
×
  • Create New...