⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 dosoftports.h

📁 16 relay output channels and 16 isolated digital input channels LED indicators to show activated
💻 H
字号:
// ############################################################################
//
// File:    $Header: DioSoftPorts.h$
// Author:  Advantech
// Created: 05/30/05(mm/dd/yy)
//
// Description: Include some header used by console programming and declare 
//          some functions necessary.
// ----------------------------------------------------------------------------
#ifndef DIOSOFTPORTS_H
#define DIOSOFTPORTS_H

#include <windows.h>
#include <iostream.h>

#include "..\..\..\include\driver.h"

// ======================================================================
// Name: ShowDevList
// Description:  Show the list of installed devices. 
// ----------------------------------------------------------------------
BOOL ShowDevList ( DWORD * *dwpDevNumList, SHORT & sDevCount);

// ======================================================================
// Name: Select device
// Description:  Select a device according to the number user input and 
//    return the device handle if successful, otherwise return 0. 
// ----------------------------------------------------------------------
LONG SelectDevice ( SHORT sDevCount );

// ======================================================================
// Name: ErrReport
// Description:  Report error message in more details.
// ----------------------------------------------------------------------
void ErrReport ( LRESULT lErrCde );

// ======================================================================
// Name: SelectPort
// Description:  Select the number of start port and port count for DI 
//             operation.
// ----------------------------------------------------------------------
void SelectPort (DWORD & lStartPort, DWORD & lPortCount, DWORD lMaxCount );

// ======================================================================
// Name: Change an charater to Hex number.
// Description: Read the selected ports.
// ----------------------------------------------------------------------
BYTE CharToHex ( char c );

// ======================================================================
// Name: InputNumStream
// Description: Input the numbers and empty the get stream.
// ----------------------------------------------------------------------
void InputNumStream ( DWORD & dwNum );

// ======================================================================
// Name: ClearStream
// Description: Input the numbers and empty the get stream.
// ----------------------------------------------------------------------
void ClearStream ();

// ======================================================================
// Name: WritePorts
// Description: Read the selected ports.
// ----------------------------------------------------------------------
BOOL WritePorts ( LONG lDevHandle, DWORD lPortStart, DWORD lPortCount );

// ======================================================================
// Name: GetStateOfPorts
// Description: Get DO state of the selected ports.
// ----------------------------------------------------------------------
BOOL GetStateOfPorts ( LONG lDevHandle, DWORD lPortStart, DWORD lPortCount );


#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -