12.07.2015 Views

こちらから - インタフェース

こちらから - インタフェース

こちらから - インタフェース

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

GPC-MA001 Help for Windows4.6 実 行 手 順 (カウンタ 入 力 )※マザコン 高 機 能 アナログ 入 出 力 モデル/エコ 3 アナログ 入 出 力 モデルのみ 使 用 できます。4.6.1 カウンタ 入 力CntReset 関 数 でカウンタリセットを 行 います。CntSetCountMode 関 数 でカウンタモードの 設 定 を 行 います。CntStart 関 数 でカウンタをスタートさせます。カウンタ 値 の 取 得 については、CntGetCounter 関 数 でカウンタ 値 を 取 得 します。HANDLE DeviceHandle;INT Ret;INT Channel = 1;DWORD pCounter;DWORD CntStatus;// IFMA1 をオープンDeviceHandle = MaOpen (“IFMA1”, 0);// カウンタリセットRet = CntReset(DeviceHandle, Channel);// カウンタモードの 設 定// ゲート 信 号 付 き 単 相 パルス 1 逓 倍 モード カウンタ UPRet = CntSetCountMode(DeviceHandle, Channel, CNT_COUNTMODE1,CNT_UP_COUNT, CNT_Z_LOGIC_LOW,CNT_CLEARMODE0, 0x00);// カウンタスタートnRet = CntStart(DeviceHandle, Channel);// カウンタ 値 を 取 得 / 表 示do {Ret = CntGetStatus(DeviceHandle, Channel, &CntStatus);if ((CntStatus & 0x01) == 0x01) {Ret = CntGetCounter(DeviceHandle, Channel, &pCounter);printf("CntStatus:%lxh Counter:%lxh\r", CntStatus, pCounter);}} while(!kbhit());// カウンタストップRet = CntStop(DeviceHandle, Channel);// デバイスをクローズRet = MaClose(DeviceHandle);© 2012, 2014 Interface Corporation. All rights reserved.51

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!