亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? pulse.c

?? 16 relay output channels and 16 isolated digital input channels LED indicators to show activated
?? C
?? 第 1 頁 / 共 2 頁
字號:
/*
 ***********************************************************************
 *  Program     : PULSE.C                                              *
 *  Description : Demo program for pulse output                        *
 *  Revision    : 1.00                                                 *
 *  Date        : 9/5/1996                     Advantech Co., Ltd.     *
 ***********************************************************************
 *
 * FUNCTIONS:
 *
 *   InitApplication() - Initializes window data and registers window class
 *
 *   InitInstance() - Saves instance handle and creates main window
 *
 *   MainWndProc() - Process main window messages
 *
 *   ConfigDlgProc() - Process the dialog box messages for configuration
 */


#include <windows.h>
#include <stdlib.h>
#include <dos.h>
#include <math.h>
#include <stdio.h>
#include <string.h>
#include "..\..\..\include\driver.h"
#include "..\..\..\include\os.h"
#include "resource.h"

// ------------------------------------------------------------------------
// CONSTANT DEFINITION
// ------------------------------------------------------------------------
#define     MAX_DEVICES     100


// ------------------------------------------------------------------------
// GLOBAL VARIABLES
// ------------------------------------------------------------------------
HANDLE      hInst;                      // current instance
HWND        hMainWnd;                   // main window handle


static      DEVFEATURES     DevFeatures;    // structure for device features
static      PT_CounterPulseStart ptCounterPulseStart;
static      PT_DeviceGetFeatures  ptDevFeatures;

char        szErrMsg[80];               // Use for MESSAGEBOX function
LRESULT     ErrCde;                     // Return error code

//
// used for dynamic allocation memory for the installed devices
//
// static  HGLOBAL     hDeviceList,hSubDeviceList;
// static  LPDEVLIST   DeviceList,SubDeviceList;
//

//
// used for fixed memory for the installed devices
//
DEVLIST     DeviceList[MAX_DEVICES];
DEVLIST     SubDeviceList[MAX_DEVICES];

LONG        DriverHandle = (LONG)NULL;          // driver handle
BOOL        bRun = FALSE;                       // flag for running
USHORT      gwDevice = 0, gwSubDevice = 0;      // device index
USHORT      gwChannel = 0;                      // input channel
USHORT      gwGateMode  = 0;                    // gate mode
//changping change
DOUBLE       gfGatePeriod = 1000;                // gate period
DOUBLE       gfUpCycle = 2000;                   // UpCycle
//changping change end
ULONG       gdwReading = 0;                     // read counter data
SHORT       gnNumOfDevices, gnNumOfSubdevices;  // number of installed devices
FARPROC     lpfnConfigDlgProc;                  // config. dialog procedure


// ------------------------------------------------------------------------
// FUNCTION DECLARATION
// ------------------------------------------------------------------------
BOOL InitApplication(HANDLE);
BOOL InitInstance(HANDLE, int);
long FTYPE MainWndProc(HWND, UINT, WPARAM, LPARAM);
int  FTYPE WinMain(HANDLE, HANDLE, LPSTR, int);


/***************************************************************************
    FUNCTION: WinMain(HANDLE, HANDLE, LPSTR, int)

    PURPOSE: calls initialization function, processes message loop
****************************************************************************/

int FTYPE WinMain(hInstance, hPrevInstance, lpCmdLine, nCmdShow)
HANDLE hInstance;                          /* current instance             */
HANDLE hPrevInstance;                      /* previous instance            */
LPSTR lpCmdLine;                           /* command line                 */
int nCmdShow;                              /* show-window type (open/icon) */
{
    MSG msg;                               /* message                      */

    if (!hPrevInstance)                /* Other instances of app running?  */
      if (!InitApplication(hInstance)) /* Initialize shared things         */
          return (FALSE);              /* Exits if unable to initialize    */

    // Perform initializations that apply to a specific instance
    if (!InitInstance(hInstance, nCmdShow))
        return (FALSE);

    // Acquire and dispatch messages until a WM_QUIT message is received.
    while (GetMessage(&msg,      /* message structure                      */
        (HWND)NULL,              /* handle of window receiving the message */
        (UINT)NULL,              /* lowest message to examine              */
        (UINT)NULL))             /* highest message to examine             */
    {
        TranslateMessage(&msg);  /* Translates virtual key codes           */
        DispatchMessage(&msg);   /* Dispatches message to window           */
    }
    return (msg.wParam);         /* Returns the value from PostQuitMessage */
}

/****************************************************************************
    FUNCTION: InitApplication(HANDLE)

    PURPOSE: Initializes window data and registers window class
****************************************************************************/

BOOL InitApplication(hInstance)
HANDLE hInstance;                            /* current instance           */
{
    WNDCLASS  wc;

    // Fill in window class structure with parameters that describe the
    // main window.
    wc.style = CS_HREDRAW | CS_VREDRAW; /* Class style(s).                 */
    wc.lpfnWndProc = (WNDPROC)MainWndProc;   /* window process procedure   */
    wc.cbClsExtra = 0;                  /* No per-class extra data.        */
    wc.cbWndExtra = 0;                  /* No per-window extra data.       */
    wc.hInstance = hInstance;           /* Application that owns the class.*/
    wc.hIcon = LoadIcon(hInstance, "IDI_ICON1");
    wc.hCursor = LoadCursor(NULL, IDC_ARROW);
    wc.hbrBackground = GetStockObject(WHITE_BRUSH);
    wc.lpszMenuName =  "MyMenu";   /* Name of menu resource in .RC file.  */
    wc.lpszClassName = "MyClass";  /* Name used in call to CreateWindow. */

    // Register the window class and return success/failure code.
    return (RegisterClass(&wc));

}

/***************************************************************************
    FUNCTION:  InitInstance(HANDLE, int)

    PURPOSE:  Saves instance handle and creates main window
****************************************************************************/

BOOL InitInstance
(
    HANDLE          hInstance,          // Current instance identifier.
    int             nCmdShow            // Param for first ShowWindow() call.
)
{
    // Save the instance handle in static variable, which will be used in
    // many subsequence calls from this application to Windows.
    hInst = hInstance;

    // Create a main window for this application instance.
    hMainWnd = CreateWindow(
        "MyClass",                 /* See RegisterClass() call.           */
        "Advantech Driver Demo : Pulse Output" , /* Window title bar  */
        WS_OVERLAPPEDWINDOW,        /* Window style.                       */
        CW_USEDEFAULT,              /* Default horizontal position.        */
        CW_USEDEFAULT,              /* Default vertical position.          */
        CW_USEDEFAULT,              /* Default width.                      */
        CW_USEDEFAULT,              /* Default height.                     */
        NULL,                       /* Overlapped windows have no parent.  */
        NULL,                       /* Use the window class menu.          */
        hInstance,                  /* This instance owns this window.     */
        NULL                        /* Pointer not needed.                 */
        );

    // If window could not be created, return "failure"
    if (!hMainWnd)
        return (FALSE);

    // Make the window visible; update its client area; and return "success"

    ShowWindow(hMainWnd, nCmdShow);   // Show the window
    UpdateWindow(hMainWnd);           // Sends WM_PAINT message
    return (TRUE);                // Returns the value from PostQuitMessage
}

/***************************************************************************
    FUNCTION: ConfigDlgProc(HWND, unsigned, WPARAM, LPARAM)

    PURPOSE:  Processes dialog box messages for configuration
****************************************************************************/

BOOL FTYPE ConfigDlgProc
(
    HWND        hDlg,                          // window handle
    unsigned    message,                       // type of message
    WPARAM      wParam,                        // additional information
    LPARAM      lParam                         // additional information
)
{
    int         i;
    DWORD       dwIndex;
    char        szBuffer[40];
    int         nOutEntries;

    switch (message)
    {
    case WM_INITDIALOG :

        // --------------------------------
        // Initialize Device List Combobox
        // --------------------------------

        // get number of the installed devices

        if ((ErrCde = DRV_DeviceGetNumOfList((SHORT far *)&gnNumOfDevices)) !=
            SUCCESS)
        {
             DRV_GetErrorMessage(ErrCde,(LPSTR)szErrMsg);
             MessageBox(hMainWnd,(LPCSTR)szErrMsg, "Driver Message", MB_OK);
             return TRUE;
        }


        // ----------------------------------------------------------------
        // used for dynamic allocation memory for these installed devices
        //
        // if ((hDeviceList = GlobalAlloc(GHND, gnNumOfDevices *
        //      sizeof(DEVLIST))) == NULL)
        // {
        //    MessageBox(hMainWnd, (LPCSTR)"Not Enough Memory",
        //        "Memory Allocation", MB_OK);
        //    return TRUE;
        // }
        // DeviceList = (LPDEVLIST)GlobalLock(hDeviceList);
        // ----------------------------------------------------------------


        if (gnNumOfDevices > MAX_DEVICES)
            gnNumOfDevices = MAX_DEVICES;

        // retrieve the information of all installed devices

        if ((ErrCde = DRV_DeviceGetList((DEVLIST far *)&DeviceList[0],
            (SHORT)gnNumOfDevices, (SHORT far *)&nOutEntries)) != (LONG)SUCCESS)
        {
            DRV_GetErrorMessage(ErrCde,(LPSTR)szErrMsg);
            MessageBox(hMainWnd,(LPCSTR)szErrMsg,"Driver Message",MB_OK);
            return TRUE;
        }

        // initialize the Device List Combobox with the retrieved information

        for (i = 0; i < gnNumOfDevices; i ++)
            SendDlgItemMessage(hDlg, IDC_DEVICE, CB_ADDSTRING, 0,
                        (LPARAM)((LPSTR)DeviceList[i].szDeviceName));

        SendDlgItemMessage(hDlg, IDC_DEVICE, CB_SETCURSEL,(WPARAM)gwDevice,
                        (LPARAM)0);


        // -----------------------------------------------------------
        // Initialize Module List Combobox for COM port or CAN devices
        // -----------------------------------------------------------

        // check if there is any device attached on this COM port or CAN

        gnNumOfSubdevices = DeviceList[gwDevice].nNumOfSubdevices;
        if (gnNumOfSubdevices > MAX_DEVICES)
            gnNumOfSubdevices = MAX_DEVICES;


        // --------------------------------------------------------------
        // used for dynamic allocation memory for these installed devices
        //
        // if ((hSubDeviceList = GlobalAlloc(GHND, gnNumOfSubdevices *
        //    sizeof(DEVLIST))) == NULL)
        // {
        //    MessageBox(hMainWnd, (LPCSTR)"Not Enough Memory",
        //        "Memory Allocation", MB_OK);
        //    return TRUE;
        // }
        //
        // SubDeviceList = (LPDEVLIST)GlobalLock(hSubDeviceList);
        // --------------------------------------------------------------


        // retrieve the information of all installed devices
        if (gnNumOfSubdevices != 0)
        {
            if ((ErrCde = DRV_DeviceGetSubList(
                (DWORD)DeviceList[gwDevice].dwDeviceNum,
                (DEVLIST far *)&SubDeviceList[0],
                (SHORT)gnNumOfSubdevices,
                (SHORT far *)&nOutEntries)) != (LONG)SUCCESS)
            {
                DRV_GetErrorMessage(ErrCde,(LPSTR)szErrMsg);
                MessageBox(hMainWnd,(LPCSTR)szErrMsg,"Driver Message",MB_OK);
                return TRUE;
            }


            // initialize the Module List Combobox with the retrieved
            // information

            EnableWindow(GetDlgItem(hDlg, IDC_MODULE), TRUE);
            SendDlgItemMessage(hDlg, IDC_MODULE, CB_RESETCONTENT, 0,
                    (LPARAM)((LPSTR)0));

            for (i = 0; i < gnNumOfSubdevices; i++)
                SendDlgItemMessage(hDlg, IDC_MODULE, CB_ADDSTRING, 0,
                        (LPARAM)((LPSTR)SubDeviceList[i].szDeviceName));

            SendDlgItemMessage(hDlg, IDC_MODULE, CB_SETCURSEL,
					(WPARAM)gwSubDevice, (LPARAM)0);
        }
        else
        {
            EnableWindow(GetDlgItem(hDlg, IDC_MODULE), FALSE);
            SendDlgItemMessage(hDlg, IDC_MODULE, CB_RESETCONTENT, 0,
                    (LPARAM)((LPSTR)0));
        }


        //
        // Initialize Input Channel Edit
        //

        itoa(gwChannel, szBuffer, 10);
        SendDlgItemMessage(hDlg, IDC_ECHANNEL, EM_REPLACESEL, 0,
                        (LPARAM)((LPSTR)szBuffer));


        //
        // Initialize Gate Period Edit
        //
        //Changping chang
        sprintf(szBuffer, "%2.1f", gfGatePeriod);
        SendDlgItemMessage(hDlg, IDC_GATEPERIOD, EM_REPLACESEL, 0,

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲成av人片一区二区三区| 依依成人精品视频| 欧美日韩国产综合视频在线观看| 国产成人免费在线观看不卡| 国产乱码精品一区二区三区五月婷| 老司机一区二区| 日韩 欧美一区二区三区| 亚洲国产色一区| 日韩av中文在线观看| 日本不卡在线视频| 黄色精品一二区| 高清av一区二区| proumb性欧美在线观看| 欧美综合视频在线观看| 欧美人与禽zozo性伦| 日韩欧美在线1卡| 日韩欧美黄色影院| 欧美激情自拍偷拍| 亚洲老妇xxxxxx| 美女视频黄频大全不卡视频在线播放 | 精品国产不卡一区二区三区| 2020国产精品自拍| 成人欧美一区二区三区黑人麻豆| 亚洲免费观看高清完整版在线观看| 一区二区三区毛片| 青青草精品视频| 成人国产在线观看| 欧美美女bb生活片| 久久久久久久电影| 亚洲综合激情小说| 国产精品一级二级三级| 91麻豆.com| 欧美大片在线观看| 亚洲乱码国产乱码精品精98午夜| 亚洲成人动漫在线观看| 国产成人av电影免费在线观看| 91丝袜美女网| 精品国产电影一区二区| 亚洲婷婷综合色高清在线| 日韩电影在线观看电影| 成人午夜视频福利| 日韩一区二区免费在线电影| 亚洲欧美日韩成人高清在线一区| 日av在线不卡| 91国模大尺度私拍在线视频 | 国产高清不卡一区二区| 在线免费观看日韩欧美| 久久日韩粉嫩一区二区三区| 亚洲午夜一区二区三区| 99久久久国产精品| 国产欧美一区二区精品忘忧草 | 《视频一区视频二区| 麻豆免费看一区二区三区| www.欧美日韩国产在线| 久久久久久久久久美女| 免费高清成人在线| 欧美三级视频在线观看| 国产精品久久久久一区二区三区共| 毛片av一区二区三区| 精品婷婷伊人一区三区三| 中文字幕日韩av资源站| 国产成人午夜精品5599| 久久网站热最新地址| 美日韩一区二区三区| 欧美色爱综合网| 一区二区三区免费在线观看| 成人激情黄色小说| 中文字幕不卡在线播放| 国产v综合v亚洲欧| 久久亚区不卡日本| 国产一区在线视频| 久久综合中文字幕| 国产一区三区三区| 国产午夜精品一区二区三区视频 | 国产精品一区二区久久精品爱涩| 欧美日韩成人激情| 日日摸夜夜添夜夜添国产精品| 欧美亚洲另类激情小说| 亚洲图片欧美一区| 欧美蜜桃一区二区三区| 天堂va蜜桃一区二区三区| 4438x成人网最大色成网站| 日韩精品成人一区二区三区| 欧美一区中文字幕| 精品一区二区三区久久久| 精品少妇一区二区三区在线播放| 激情图区综合网| 亚洲国产成人午夜在线一区 | 亚洲综合小说图片| 欧美日韩精品欧美日韩精品| 天天影视网天天综合色在线播放| 欧美一级黄色录像| 国产一级精品在线| 1024亚洲合集| 欧美日韩国产片| 久久精品72免费观看| 中文av一区二区| 欧美性色综合网| 黑人巨大精品欧美一区| 欧美国产日本韩| 欧美日韩大陆一区二区| 精品一区二区免费看| 国产精品美日韩| 欧美精品自拍偷拍| 国产成人精品影视| 亚洲国产精品久久人人爱| 精品理论电影在线观看| 99久久综合99久久综合网站| 亚洲bt欧美bt精品777| 久久久久高清精品| 欧美在线视频不卡| 国产一区二区调教| 亚洲一区二区三区中文字幕在线| 精品日韩在线一区| 色综合久久99| 夫妻av一区二区| 午夜精品一区二区三区三上悠亚| 精品国产a毛片| 欧美影院一区二区| 粉嫩aⅴ一区二区三区四区| 三级亚洲高清视频| 亚洲美女区一区| 久久综合九色综合欧美就去吻| 91浏览器在线视频| 成人三级伦理片| 精品一区二区三区在线播放| 亚洲成人资源网| 亚洲桃色在线一区| 欧美韩国日本一区| 久久综合一区二区| 日韩欧美在线影院| 欧美日韩综合在线| 日本韩国欧美一区| av不卡在线播放| 国产精品1区2区| 日本va欧美va瓶| 午夜婷婷国产麻豆精品| 亚洲伦在线观看| 国产精品无遮挡| 国产欧美日韩三级| 久久亚洲精华国产精华液| 日韩一区国产二区欧美三区| 欧美午夜不卡视频| 欧美亚洲国产一区二区三区va | 丝袜美腿亚洲综合| 一区二区久久久| 一区二区三区在线影院| 一区免费观看视频| 亚洲三级免费电影| 亚洲视频免费在线| 亚洲人123区| 一区二区三区91| 亚洲国产精品麻豆| 日韩不卡手机在线v区| 亚洲 欧美综合在线网络| 亚洲综合精品自拍| 午夜精品久久久久久久| 视频一区二区中文字幕| 男男视频亚洲欧美| 久久电影网电视剧免费观看| 蜜臀国产一区二区三区在线播放 | 亚洲伦理在线免费看| 亚洲精品国产无套在线观| 亚洲欧美日韩在线| 亚洲影视在线播放| 青青青伊人色综合久久| 久久99在线观看| 成人av在线影院| 欧美网站一区二区| 91精品视频网| 国产亚洲午夜高清国产拍精品| 国产婷婷精品av在线| 亚洲日本韩国一区| 日韩电影免费在线观看网站| 国产一区二区三区国产| 色综合夜色一区| 欧美理论片在线| 久久综合色播五月| 亚洲男同1069视频| 美女视频一区二区三区| a亚洲天堂av| 欧美精品1区2区| 久久久久久久免费视频了| 亚洲视频电影在线| 美美哒免费高清在线观看视频一区二区| 精品亚洲porn| 一本到三区不卡视频| 日韩欧美精品在线视频| 国产精品久久久久久久久久免费看| 亚洲尤物在线视频观看| 激情欧美一区二区| 在线日韩av片| 国产精品色哟哟网站| 午夜av电影一区| 99综合电影在线视频| 91精品国产aⅴ一区二区| 日韩毛片高清在线播放| 免费美女久久99| 91成人免费在线| 日本一区二区三区视频视频|