卒 業 研 究 報 告題目高速パルススキャニング C-V 測定装置開発

指 導 教 員
河 津

哲 教授

報 告 者
大 橋

健 二

平成１３年 ２月 ９日

高知工科大学 電子・光システム工学科

目

次

1. まえがき.........................................................................................3
2. Pulse Scanning C-V 法
2.1
2.2

基本回路.................................................................................3
静電容量測定原理....................................................................4

2.3

C-V 特性測定原理

2.3.1 pn 接合...............................................................................5
2.3.2 MOS 構造............................................................................8
3. 測定システム
3.1
3.2

概要......................................................................................12
装置解説................................................................................123.3

測定回路................................................................................15

3.4
3.5

計測ソフトウェア..................................................................19
測定システム評価..................................................................21

4. C-V 特性測定実験
4.1 pn 接合..................................................................................25
4.2 MOS Diode.............................................................................25
5. 実験結果........................................................................................26
6. 考察..............................................................................................30
7. まとめ...........................................................................................30
8. 謝辞..............................................................................................31
参考文献
付 録

-2-

1. まえがき
近年、ＩＴ革命すなわち情報技術革命とういうことが盛んに言われている。コンピュータは低価格化、高性能化し、携帯通信端末は爆発的に普及した。まさに情報技術革命といって相応しい。これは情報産業の基本となる、半導体・集積回路技術の発展によってもたらされたことは周知の通りであり、今後の発展も当然のことであろう。しかしながら最近では「ムーアの法則に限界が見えてきた」とも言われ始め、これからの技術開発は徐々に困難になってきつつある。このような状況となっている原因の一つとして、微量なリーク電流及び担体発生測定が必要となっているにもかかわらず、今までの評価方法では非常に長時間を要したり、測定不可能であるということが挙げられる。
そこで、これらの測定に対応できる新たな測定方法として、高速パルススキャニング C-V 法を用いた測定システムを構築した。このシステムでは高速な A/D・D/A 変換器を用いることによって、数ミリ秒の短時間に数千回の測定を行うことを可能としている。
本研究では今までに行われていなかった高速な半導体評価方法について実験を行い、開発に必要な測定、評価結果をより早く得ることを目的とすると共に、今後の技術開発のブレークスルーとなるような新たな事象の発見を目指している。

2. Pulse Scanning C-V 法
2.1 基本回路
まず、基本的な測定回路の概念図を図 2.1 に示す。この図において、正弦波発振器は静電容量の測定、台形波パルスジェネレータはバイアスを印加するためのものである。また、CCは台形波パルスジェネレータの直流成分が正弦波発振器に、L は正弦波発振器の高周波が台
形波パルスジェネレータに、それぞれ影響を与えないようにするためである。

図 2.1 Pulse Scanning C-V 基本測定回路-3-2.2 静電容量測定原理
次に出力 vout について考えるが、台形波パルスジェネレータはバイアスを印加するためのものであるから、ここでは考えない。
まず、正弦波発振器の出力電圧 vi を
vi = Vi sin ω t(2.1)と置く。また、 CC と C の合成静電容量 CS は以下のように与えられる。
CS ==CC ⋅ CCC + C

(2.2)

(

)

(2.3)

1
1
1
CC + C

よって、 CS 及び R の合成インピーダンス Z は
Z = R 2 + ω1CS

2であるから、流れる電流 i は
vi
=
Z

i=

Vi cos ω t(

R + ω1CS
2

)

2

(2.4)

となる。ここで、 C がC  CC( ω1C )  R
2

(2.5)
2

(2.6)

の条件を満たすとき、 CS は(2.2)式より
Cs = C

(2.7)

1

(2.8)

また、 Z は(2.3)式より
Z =ωCとなるから、(2.4)式は
i = Vi cos ω t ⋅ ω C(2.9)と置き換えられる。よって出力電圧 vout は
vout = Ri = R ⋅ Vi cos ω t ⋅ ω C(2.10)

で与えられる。したがって、 C は正弦波発振器の出力 vi と直列抵抗 R の関数として、
C=

vout

ω RVi cos ω tを得る。これより、 vout は C に比例することが分かる。

-4-(2.11)

2.3 C-V 特性測定原理
2.3.1 pn 接合
ここではまず、図 2.2(b)のように不純物濃度が階段状に変化している、pn 階段接合の空乏層容量について述べる。
図 2.2(a)のように pn 接合に逆方向電圧 V が加えられている場合に、p 形領域と空乏層の境界を原点として n 形領域方向に x 軸を取り、p と n の接合面を x1 、空乏層と n 形領域の境界を x 2 とし、電位を V ( x) とすれば、電荷密度 ρ と電位 V の関係はポアソン方程式
d 2V ( x)ρ=−dx 2ε sε 0(2.12)

で表される。ただし、 0 c x < x1 では ρ = −qNA 、 x1 c x c x 2 では ρ = qND である。ここで、 NA, ND
はイオン化したアクセプタ及びドナーである。また、 ε S は半導体の比誘電率、 ε 0 は真空の誘電率である。これを以下のような境界条件
∂v(0)
=0
∂x
x = x1 で V ( x) は連続∂v( x 2)=0x = x 2 で V ( x 2) = Φ D + V ,∂x(2.13)∂V ( x) qNA=
x + C1ε Sε 0∂x(0 c x < x1)(2.14)∂V ( x)qND=−
x + C2ε Sε 0∂x( x1 c x c x 2)

(2.15)

x = 0 で V (0) = 0,で積分すると、となる。ここでそれぞれの境界条件から、 C1 = 0, C 2 =qNDε Sε 0x 2 となる。そして、 x = x1 で V は連続であるから、式(2.14),(2.15)の x を x1 として−qNAε Sε 0x1 =qNDε Sε 0x1 −qNDε Sε 0x2(2.16)となり、
qNAx1 = qND ( x 2 − x1)(2.17)を得る。これは、p 形領域の空乏層中の負電荷と n 形領域の空乏層中の正電荷量が等しいことを表している。また、空乏層幅と不純物濃度が反比例の関係にあることも分かる。空乏層中の電界
Ex = − dVを図 2.2(c)に示す。
dx

次に空乏層中の電界分布を求める。式(2.14)，(2.15)をもう一度積分して、V ( x) =qNA 2
x + C32ε Sε 0-5-

(0 c x < x1)(2.18)

qND 2 qNDx +x2 x + C 42ε Sε 0ε Sε 0V ( x) = −を 得 る 。 こ こ で 、 境 界 条 件 と 式 (2.17) よ り C 3 = 0, C 4 = −( x c x c x 2)

(2.19)

qND 2 x 2 2( NA + ND) で あ る 。 x = x 2 で2ε Sε 0V ( x 2) = ΦD + V であるから
qND 2 qND 2
qND 2 x 2 2
x2 +
x2 −
2ε Sε 0ε Sε 02ε Sε 0( NA + ND)
qNAND
=
x22
2ε Sε 0( NAND )ΦD + V = −(2.20)となり、電位 V ( x) は図 2.2(d)のように、 x の 2 次関数で変化することが分かる。また、全空乏層幅 x 2と V の関係は式(2.20)より
x2 =2ε Sε 0( NA + ND )(Φ D + V )qNAND(2.21)と求められる。これより空乏層幅は、ほぼ V に比例して増加することが分かる。
この空乏層には図 2.2(b)のように電荷が存在していることから、 V によって容量が変化するコン
デンサと考えることができる。空乏層中の電荷量を ±Q (V ) とすると、式(2.21)より、

Q (V ) = qND ( x 2 − x1) = qNAx1 = qNA=

ND
x2
NA + ND

2qε Sε 0 NAND
(ΦD + V )NA + ND(2.22)となり、 C はC=となる。この式から空乏層容量 C は

dQ
=
dV

qε Sε 0 NAND
2( NA + ND)(ΦD + V )(2.23)

1に比例して減少することがわかる。このことは空乏層幅がV

V に比例して増加することからも明らかである。また、前述したとおり空乏層は不純物濃度が低いほど拡がりやすく、 NA と ND の差が大きい場合、小さい方の値に依存する。
次に、今回システム評価及び pn 接合 C-V 特性測定実験に用いるバリキャップダイオードについて説明する。バリキャップダイオードは可変容量ダイオードとも呼ばれるもので、バイアス電圧に対する静電容量の変化が非常に大きいのが特徴である。バリキャップダイオードは超階段接合と呼ばれる、図 2.3 に示すような不純物分布となっており、その静電容量 CV は次式で表される。
V 
CV = C 0 1 + −γ ΦD 

(2.24)

ここで、 V :逆バイアス電圧、 C 0 : V = 0 のときの静電容量、 ΦD :拡散電位、 γ :接合近傍の不純物
濃度で決まる定数 である。

-6-

図 2.2 逆方向バイアス時の pn 接合バンド図及び電荷、電界、電位分布

図 2.3 超階段接合の不純物分布-7-2.3.2 MOS 構造
MOS とは Metal-Oxide-Semiconductor の頭文字をとったもので、図 2.4 に示すような、金属・絶縁膜・半導体が重なった構造になっているものである。

図 2.4 MOS 構造
MOS 構造は、酸化膜が持っている静電容量 COX と半導体の空乏層容量 CD を持っており、その合成静電容量 C は
1
C= 1
1
+
COX

(2.25)

CDで与えられる。図 2.5 は、ｎ形基盤を用いた MOS 構造においてゲート電圧 VG を変化させたときのキャリア分布及び容量の変化を定性的に示したものである。
図 2.5(a)のようにゲートに正電圧を印加すると、SiO2 との界面にQ = CV に相当する量の電子が集まる。この状態を蓄積状態と呼び、このときは基盤は金属と同じように考えることができる。よって
容量は COX のみとなる。
図 2.5(b)のようにゲートに負の小さい電圧を印加すると、電子は界面から追い払われ、ドナーイオンが固定電荷として残り空乏層が形成される。この時を空乏状態と呼び、容量は COX と空乏層容
量 CD の直列接続となる。
次に、図 2.5(c)のようにゲート電圧を負の大きな電圧にすると、ドナーイオンだけでは Q = CV を満足する正電荷を供給できなくなり、少数キャリアである正孔が界面に集まってくる。すると界面付
近は多数キャリアの電子の濃度より、少数キャリアの正孔の濃度の方が大きくなる。この部分を反転層と呼び、この状態を反転状態と言う。この状態ではゲート電圧をさらに負に増しても、空乏層幅は変化せず、よって容量は一定値となる。ただしこれは高周波信号で計測した場合である。反転層中の正孔は熱励起による電子正孔対の発生によって供給されているため、この速度より遅い低周波信号で計測した場合は空乏層容量 CD は短絡された状態となり、容量は COX となる。
これらのようにゲート電圧を変化させたときのバンド図が図 2.6 である。図 2.6(b)は、金属と半導体の仕事関数が等しいとした場合であり、このときは VG = 0 でフラットバンド状態となる。

-8-

この一連の C の変化を表したのが図 2.7 である。(a)は低周波、(b)は高周波における場合である。
また、(c)はゲート電圧にパルス状の電圧を印加した場合である。ゲート電圧を急激に変化させると、少数キャリア数の増減がこれに追従できず、反転層が形成されるまでの間空乏層が拡がり、容量はさらに減少する。
パルススキャニング C-V 法は、図 2.7(b)と(c)の曲線の関係から、発生した少数キャリアの数を求める方法である。図 2.8 はパルススキャニング C-V 法による C-V 特性の概念図である。急速にゲート電圧を印加すると、少数キャリアの発生が追従しないことから、C-V 曲線は a 点から b 点を経て
c 点に到達する。c 点で THOLD 時間ゲート電圧 −VG を印加し、急にゲート電圧をゼロに戻すと、今度は c 点から d 点を経て b,a 点の曲線に沿って推移する。また、abde の曲線は少数キャリアがバイア
ス電圧に追従する場合の C-V 曲線である。
これより、電圧を 0 に戻したとき cdba に沿って推移すれば、d 点における熱平衡状態の少数キャ
リアの数と、 −VG を THOLD 時間印加した場合に発生する少数キャリアの数が等しいとすることができる。故に、d 点の電圧から発生する少数キャリアの数を測定できる。
また、 ∆ V と少数キャリアの数 n との間には
q × n = COX × ∆ Vの関係がある。ここで、 q は単位電荷である。

図 2.5 MOS 構造のキャリア分布と容量の変化-9-(2.26)

(a) 蓄積状態 VG > 0(b) フラットバンド状態 VG = 0(c) 空乏状態 VG < 0(d) 反転状態 VG  0
図 2.6 MOS 構造バンド図- 10 -

図 2.7 MOS 構造の C-V 特性

図 2.8 パルススキャニング C-V 法における C-V 特性概念図- 11 -

3. 測定システム
3.1 概要図 3.1 に測定システムの簡単なブロック図を示した。矢印は信号及びデータの流れを表す。

図 3.1 測定システムブロック図

3.2 装置解説(1) D/A・A/D 変換器
D/A はバイアス印加のための台形パルスを作成、また A/D は測定回路（3 章 3 項参照）から出力される信号を D/A の出力と同期してコンピュータに取り込む。同期させることで、D/A と A/D を関連付けたデータを得ることができる。
今回使用した D/A・A/D 変換器は、それぞれ Interface 社の PCI-3305,PCI-3163 というパソコンの PCI スロットに搭載して使用するボードタイプのものである。図 3.2 にその外観写真を示す。
また、表 3.1 に基本的な仕様を示す。

- 12 -

D/A:PCI-3305

A/D:PCI-3163
図 3.2 D/A・A/D 変換器

分解能
サンプリング周波数
入出力仕様

レンジ
相対精度
誤差

D/A : PCI-3305
12bit
最高 5MHz
インピーダンス：1Ω 以下
負荷抵抗：2kΩ 以上
負荷容量：500pF 以下-10.24～+10.24V 可変
最大±3LSB
最大±0.55%

A/D : PCI-3163
12bit
最高 10MHz
インピーダンス：10MΩ

-5～+5V 可変
最大±3LSB
最大±0.5%

表 3.1 基本仕様
サンプリング周波数が D/A-5MHz,A/D-10MHz の仕様となっているが、今回は D/A と A/D を同期させる必要があるので、システムとしての最高サンプリング周波数は 5MHz となる。このサンプリン
グクロックは A/D に内蔵された発振器を用い、D/A にも供給される。また、サンプリングのタイミング
は D/A と A/D が反対になる。つまり、サンプリングクロックの立ち上がりで D/A がサンプリング、立
ち下がりで A/D がサンプリングを行う。これは、D/A の出力が十分安定してから A/D のサンプリングを行わせるためである。また、トリガ信号は D/A から A/D へ送られる。これは A/D が先にサンプ
リングの準備を行い、D/A がサンプリングを開始したら A/D も開始するというシーケンスを行うためである。
なお、サンプリングに関する設定、データ取得等すべての操作はコンピュータ上から行わなければならない。
(2) 電流アンプ
D/A 変換器の出力インピーダンスが高いため、直接測定回路に入力すると目的の電圧を出力できなくなる。そのため、パワーアンプを用いて電圧はそのままで電流のみを増幅している。使用機- 13 -

種は Hewlett-Packard 社 6827A である。
(3) ファンクションジェネレータ
容量測定用の正弦波を得るために用いる。使用機種は岩崎通信機 FG-350 である。
(4) 周波数カウンタ
ファンクションジェネレータが出力する正弦波の周波数を確認するために用いる。使用機種は
Hewlett-Packard 社 5316A である。
(5) 電圧計
ファンクションジェネレータが出力する正弦波の電圧を確認するために用いる。今回は 1MHz という高周波の電圧を測定するため、それに対応した電圧計が必要となる。使用した FLUKE 8500A
は最高 1MHz の交流電圧が測定できる。古い機種のため、正確な値を示していないようであるが、今回の測定では値そのものではなく、電圧が一定かどうかを見るためだけであるから問題ないと判断した。
(6) シールドボックス
暗箱のように内側を黒くした箱で、外部からのノイズ及び光の影響を遮断するために用いる。電気的なノイズはもとより、光によるキャリアジェネレーションを防止し、正確な測定を行うために用いた。図 3.3 に外観写真を示す。

図 3.3 シールドボックス(7) ウェーハプローバ
ウェーハ状の試料を測定するために用いる。先端に鋭利なタングステン針が付いており、ウェー
ハの測定個所に接触して測定を行う。写真を図 3.4 に示す。

- 14 -

図 3.4 ウェーハプローバ

3.3 測定回路
ここでは実際の測定に使用した回路について述べる。2 章 1 項で示した基本回路(図 2.1)は、実際に測定を行う上では様々な不具合が生じる。それは主に次のようなものである。
1.

出力電圧 vout が非常に小さいため、増幅しなければ A/D に取り込むことができない。併せて、ノイズを極力抑える必要がある。

2.

バイアス印加のための台形波によって CC へ充電電流が発生し、そのために C 測定用の正弦波にパルス状の波形が乗る。

3.

2 と同じく台形波による C への充電電流によって出力電圧が安定しない。

4.

リンギングにより各波形が歪む。

まず 1 の問題であるが、 C を測るための正弦波の電圧は測定誤差を小さくするため、数十ミリボ
ルトと小さく、しかも R は(2.6)式の条件を満たさなければならない。例えば C を 100pF と仮定し、
2(2.6)式の R 2 が ( ω1C ) よりも 2 桁小さいとした場合、 R は約 160Ω となる。 vi を 20mVp-p, 1MHz としてこのときの vout を概算すると約 1.8mVp-p となり、数ボルトのレンジしか持たない A/D でデータを取り込むためには 50dB ～ 60dB の電圧増幅を行わなければならない。しかし、小信号であるが故にノイズを抑えなければ直接測定誤差となってしまう。このため、ローノイズの素子を用いるとともに回路を小さくし、シールドの意味と併せ小さなケースに収めた。
次に 2 の問題について考える。図 3.5 に実際にこの問題が起きている状態を観測したオシロスコープの写真を示す。この図から分かるように台形波が変化する部分、つまり立ち上がり及び立ち下がりの部分で正弦波が+及び-方向にシフトしている。台形波の立ち上がり立ち下がりでは時間に関する 1 次関数として電圧が与えられるため、その時間微分値は一定であり、これはつまり CC に流れる電流が一定であることを表す。時間微分値が 0 となる台形波の上辺の部分ではシフト量は 0 に- 15 -

戻っている。 CC に流れる電流によって電位差が生じるのであるから、台形波の入力端子から CC を通ってグランドまでの経路のインピーダンスを下げればよく、低抵抗で CC をグランドへ繋ぐ。

図 3.5 台形波による正弦波の歪み
問題点 3 は、2 と同様の理由により発生するが、対策は別の方法を採らなければならない。得たい信号は 1MHz の正弦波の成分のみであるが、台形波はこれより十分に低い周波数である。従って、出力電圧から低周波成分を取り除く回路を付加する。
次に 4 の問題であるが、リンギングとは高周波を扱う回路において、主にインピーダンスの不整合によって信号が反射を起こす現象である。この現象が起きている様子を図 3.6 に示す。本来一定であるべき信号が反射波によって振動し、徐々に減衰しているのが分かる。

図 3.6 リンギングの例
今回使用するファンクションジェネレータの出力インピーダンスは 50Ω であるから、入力側でも50Ω に近いインピーダンスに設定することが必要である。また、アッテネータを挿入して信号対反射波の比を大きくすることも必要である。
以上のような問題に対する対策を施した回路図を図 3.7 に示す。また、図 3.7 中のアンプ、ローカ
ットフィルタ(LCF)をまとめた回路を図 3.8 に、それぞれの写真を図 3.9 に示す。

- 16 -

- 17 -

- 18 -

(a) 測定回路(b) 増幅 1 段目(c) 増幅 2 段目,LCF,検波

図 3.9 測定回路,アンプ及び LCF 写真

3.4 計測ソフトウェア
3 章 2 項でも述べたように、サンプリングの設定やデータの取得等 D/A,A/D に関する操作はす
べてコンピュータ上から行わなければならない。また、この研究に特化した制御、データ処理を行うためにも、ソフトウェアの開発は必須である。利用した言語は Microsoft 社の Visual Basic 6.0 である。
この言語を使用した根拠は、他の言語に比較して短時間で必要十分なソフトウェアが開発可能なことである。
この研究 を始めた当初 、D/A,A/D 変換 器の発売元であ る Interface 社からはドライバとDLL(Dinamic Link Library)しか提供されておらず(現在では簡単に利用可能な ActiveX コンポーネントが公開されている)、ソフトウェア開発には相当な時間を要した。
主に•

詳細なサンプリング条件設定が可能•

D/A 出力データ作成•

ノイズキャンセル•

D/A,A/D 電圧－時間グラフ、D/A 電圧－A/D 電圧グラフの描画•

A/D の 2 チャンネル目を利用した D/A 出力真値表示•

サンプリングデータのファイル書き出し等の機能を持っている。図 3.13 に画面表示の例を示す。また付録にソースファイルを添付する。

- 19 -

(a) バージョン情報(b) サンプリング条件設定(c) D/A 出力設定(d) 電圧-時間グラフ(e) 電圧-電圧グラフ
図 3.10 計測ソフトウェア実行画面- 20 -

3.5 測定システム評価
すべての計測装置において、そのシステムで正確な測定が行えるかは大変重要な項目である。
今回構築したシステムでもこれを確かめなければならない。そこで、様々な容量のコンデンサを測定して出力電圧との関係を確かめた。このシステムの測定回路は C の容量に合わせて R の値を 3通りに変更できるため、それぞれの値で測定を行っている。なお、いずれの結果も他の計測器で得られた静電容量に基づいている。
R = 10Ω の時の測定結果を図 3.11 に示す。測定には、バイアス電圧に依存せず一定値を示す

定容量のコンデンサを用いている。グラフより、この抵抗値では概ね 300pF～2000pF の範囲でリニ
アな特性が得られることが分かる。
次に R = 100Ω の時の測定結果を図 3.12 に示す。この測定にも定容量コンデンサを用いている。
グラフから、測定点の全域でリニアな特性となっていることがわかり、30pF～500pF の測定が可能である。
図 3.13 は R = 1kΩ 時の測定結果である。この測定に使用したサンプルは、25pF 以上の点ではこれまで通り定容量コンデンサ、それ未満の点ではバリキャップ、もしくは通常のダイオードを用いたものである。また、0pF の点は測定端子を解放して測定している。この結果も全域で直線性が認められるが、0pF の点は若干直線上から外れている。これは測定装置及び使用した配線類の浮遊容量であると考えられる。
以上の結果より、このシステムでは R の値を変える、即ちレンジを変更することによって数 pF～
2000pF までの測定が可能であると認められる。

- 21 -

- 22 -

- 23 -

- 24 -

4. C-V 特性測定実験
4.1 pn 接合
この実験に用いるのは、図 4.1 に示すような完全に封印されたバリキャップダイオードである。封印されているが故に、この測定において光の影響はない。
このダイオードに、図 4.2 に示すような逆バイアス電圧を加え、そのときの C-V 特性を測定する。
ノイズによる誤差を抑えるため同じ測定を 100 回行い、それぞれの測定点の単純平均を求める。

図 4.1 バリキャップダイオード

図 4.2 印加バイアス電圧

4.2 MOS Diode
この実験ではウェーハ上に形成された図 4.3 に示すような MOS 構造を用いる。ウェーハ状態の測定であるから、３章２項で述べたシールドボックス及びウェーハプローバを使用する。ゲート
部分に針を立て図 4.4 で示す電圧を印加し、光を遮断した場合と微弱な光を照射した場合のC-V 特性を測定する。
pn 接合の場合と同じく、100 回測定を行い、それぞれの測定点で単純平均を求める。
測定する MOS 構造のパラメータは、ゲート電極面積 A = 0.002cm 2 ,酸化膜膜厚 tOX = 25nm である。

- 25 -

図 4.3 測定する MOS Diode の構造

図 4.4 印加ゲート電圧

5. 実験結果
pn 接合の測定結果のグラフを図 5.1 に示す。
光を遮断した場合の MOS Diode の測定結果のグラフを図 5.2 に、微弱な光を照射した場合の測定結果のグラフを図 5.3 に示す。

- 26 -

- 27 -

- 28 -

- 29 -

6. 考察pn 接合及び MOS Diode の光を当てない場合の実験結果で、台形波の立ち上がりと立ち下がり
におけるグラフが、どちらも同じ軌跡を描いている。これは、構築したシステムが高速でも正しい値を測定可能であるという証拠である。
また、MOS Diode に微弱な光を当てた場合の結果では、光によるキャリアジェネレーションの効
果がはっきりと見て取れる。
これらの結果から、実際のデバイスにおいても正確に C-V 特性の測定が可能な測定システムであることを証明した。

7. まとめpn 接合においても、MOS 構造においても、最速 0.2µ sec /点という高速で C-V 特性を測定できるシステムを完成させた。また、このシステムを構築する課程で 1pF 以下、つまり 10−16 アンペア相当のリーク電流に対応する容量測定の目途が得られた。大学院では、評価用デバイス設計と VDEC
での評価試料の設計を通して測定システムの改良を進めると共に、金属汚染や赤外線が与える影
響、結晶欠陥を含む半導体における担体発生のメカニズムについて測定・解析を行う。これに対応できるものとして、この高速パルススキャニング C-V 測定システムを構築した。

- 30 -

8. 謝辞本研究において、終始御指導と御教示を賜りました高知工科大学工学部電子・光システム工学科 河津 哲教授に謹んで感謝の意を捧げます。
また、ウェーハパターンの設計に関して御指導いただきました高知工科大学工学部電子・光シ
ステム工学科 矢野政顕教授に厚くお礼申し上げます。
さらに、入学当初より多くの御指導、御助言をいただきました高知工科大学工学部電子・光シス
テム工学科 井上昌昭助教授に深く感謝の意を表します。
この研究を通じて楽しい時間を共に過ごし、種々の面でお世話になりました同研究室の安澤慎介氏、家村伸吾氏、石松幸三氏、大畠旬平氏に心より感謝します。
最後に、様々な面で支えていただきました寺西正臣氏、浜小路欣大氏、九州東海大学工学部
電子情報工学科 向井岳信氏をはじめとする多くの友人に感謝します。

- 31 -

参考文献(1) 古川静二郎 : 半導体デバイス (1982)(2) 國岡昭夫ほか : 新版基礎半導体工学 (1996)(3) 宇佐美 晶 : １００例にみる半導体評価技術 (1988)(4) 河東田 隆 : 半導体評価技術 (1989)(5) 河津ほか : 三菱電機技報 ,44,670(6) 河津ほか : 三菱電機技報 ,47,741(7) W.Shockley : The Theory of p-n junctions in Semiconductors and p-n Junction Transisters(8) Hewlett-Packard アプリケーションノート 322(9) Interface USER’S MANUAL PCI-3305(10) Interface USER’S MANUAL PCI-3163- 32 -

付録
ソースとなるファイルは以下の２５個のファイルである。
ADDAFMS2.vbp
SamplingConf.frm
OptionForm.frm
OpenDevice.frm
MakeDaData.frm
Main.frm
Infomation.frm
frmSplash.frm
frmAbout.frm
CloseDevice.frm
FbiDa.bas
DaModule.bas
CommonModule.bas

ADDAFMS2.vbw
SamplingConf.frx
OptionForm.frx
OpenDevice.frx
MakeDaData.frx
Main.frx
Infomation.frx
frmSplash.frx
frmAbout.frx
CloseDevice.frx
FbiAd.bas
AdModule.bas

以下にそれぞれのファイルの内容を添付する。
‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑・ADDAFMS2.vbp
Type=Exe
Reference=*¥G{00020430‑0000‑0000‑C000‑000000000046}#2.0#0#..¥..¥..¥..¥WINDOWS¥SYSTEM¥stdole2.tlb#OLE
Automation
Object={F9043C88‑F6F2‑101A‑A3C9‑08002B2F49FB}#1.2#0; COMDLG32.OCX
Reference=*¥G{00000200‑0000‑0010‑8000‑00AA006D2EA4}#2.0#0#..¥..¥..¥COMMONFILES¥SYSTEM¥ADO¥msado20.tlb#Microsoft ActiveX Data Objects 2.0 Library
Reference=*¥G{7C0FFAB0‑CD84‑11D0‑949A‑00A0C91110ED}#1.0#0#..¥..¥..¥..¥WINDOWS¥SYSTEM¥msdatsrc.tlb#Microsoft Data Source Interfaces
Reference=*¥G{56BF9020‑7A2F‑11D0‑9482‑00A0C91110ED}#1.0#0#..¥..¥..¥..¥WINDOWS¥SYSTEM¥MSBIND.DLL#Microsoft
Data Binding Collection VB 6.0 (SP4)
Reference=*¥G{6B263850‑900B‑11D0‑9484‑00A0C91110ED}#1.0#0#..¥..¥..¥..¥WINDOWS¥SYSTEM¥MSSTDFMT.DLL#Microsoft Data Formatting Object Library 6.0 (SP4)
Form=Main.frm
Module=FbiDa; FbiDa.bas
Module=FbiAd; FbiAd.bas
Module=DaModule; DaModule.bas
Module=AdModule; AdModule.bas
Form=OpenDevice.frm
Form=CloseDevice.frm
Form=Infomation.frm
Form=SamplingConf.frm
Module=CommonModule; CommonModule.bas
Form=MakeDaData.frm
Form=OptionForm.frm
Form=frmAbout.frm
Form=frmSplash.frm
IconForm="frmMain"
Startup="Sub Main"
HelpFile=""Title="ADDAFMS"
ExeName32="ADDAFMS.exe"
Command32=""
Name="ADDAFMS"
HelpContextID="0"
CompatibleMode="0"
MajorVer=1
MinorVer=8
RevisionVer=6
AutoIncrementVer=0
ServerSupportFiles=0
VersionCompanyName="高知工科大学 電子・光システム工学科 河津研究室"
VersionLegalCopyright="高知工科大学 電子・光システム工学科 河津研究室
大橋 健二"
VersionProductName="A/D・D/A 高速計測システム"
CompilationType=0
OptimizationType=0
FavorPentiumPro(tm)=0
CodeViewDebugInfo=0- 33 -

NoAliasing=0
BoundsCheck=0
OverflowCheck=0
FlPointCheck=0
FDIVCheck=0
UnroundedFP=0
StartMode=0
Unattended=0
Retained=0
ThreadPerObject=0
MaxNumberOfThreads=1
DebugStartupOption=0‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑・ADDAFMS2.vbw
frmMain = 5, 13, 738, 666, , 2, 0, 741, 569, C
FbiDa = ‑166, 14, 557, 658, C
FbiAd = ‑236, 17, 520, 654, C
DaModule = 1, 87, 747, 656, C
AdModule = 7, 5, 751, 660, C
frmOpenDevice = 20, 56, 738, 608, C, 90, 8, 615, 449, C
frmCloseDevice = 33, 92, 696, 561, C, 23, 24, 475, 398, C
frmInfomation = 162, 26, 687, 467, C, 1, 1, 725, 639, C
frmSamplingConf = 7, 6, 697, 611, C, 5, 3, 716, 604, C
CommonModule = 19, 43, 754, 598, C
frmMakeDaData = 30, 26, 740, 636, C, 3, 4, 720, 525, C
frmOption = 108, 135, 717, 576, C, 146, 83, 672, 524, C
frmAbout = 73, 83, 607, 532, C, 4, 80, 485, 385, C
frmSplash = 155, 48, 689, 497, C, 42, 45, 576, 494, C‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑
・SamplingConf.frm
VERSION 5.00
Begin VB.Form frmSamplingConf
BorderStyle= 3 '固定ﾀﾞｲｱﾛｸﾞ
Caption= "サンプリング条件設定"
ClientHeight= 7770ClientLeft= 45
ClientTop= 330
ClientWidth= 10110
Icon= "SamplingConf.frx":0000
LinkTopic= "Form1"
MaxButton= 0 'False
MinButton= 0 'False
ScaleHeight= 7770ScaleWidth= 10110ShowInTaskbar = 0 'False
StartUpPosition = 1 'ｵｰﾅｰ ﾌｫｰﾑの中央
Begin VB.CommandButton LoadButton
Caption= "Load"Height= 375
Left= 6480TabIndex
= 61
Top
= 600
Width
= 1335End
Begin VB.CommandButton SaveButton
Caption= "Save"
Height= 375
Left= 4800TabIndex
= 60
Top
= 600
Width
= 1335End
Begin VB.CommandButton Command1
Caption= "OK"
Default= ‑1 'True
Height= 495
Left= 8160TabIndex
= 0
Top
= 480

- 34 -

Width= 1695End
Begin VB.Frame Frame8
Caption= "D/A"
BeginProperty Font
Name
= "ＭＳ Ｐゴシック"
Size= 9Charset= 128
Weight= 700
Underline= 0 'False
Italic= 0 'False
Strikethrough = 0 'False
EndProperty
Height= 3615
Left= 120
TabIndex= 41
Top= 4080Width= 9855
Begin VB.Frame Frame16
Caption= "繰り返し回数"
Height= 615
Left= 5760TabIndex= 58
Top= 2880Width= 2055
Begin VB.TextBox DaRepeatNum
Alignment= 1 '右揃え
Height
= 270
Left
= 240
TabIndex
= 59
Text
= "1"
Top
= 240
Width
= 1575End
End
Begin VB.Frame Frame15
Caption= "D/A ラッチクリア"
Height= 615
Left= 3000TabIndex= 55
Top= 2880Width= 2535
Begin VB.OptionButton DaLatch
Caption= "しない"Height
= 255
Index
= 1
Left
= 1440TabIndex
= 57
Top
= 240
Width
= 945
End
Begin VB.OptionButton DaLatch
Caption= "する"Height
= 255
Index
= 0
Left
= 360
TabIndex
= 56
Top
= 240
Value
= ‑1 'True
Width
= 855
End
End
Begin VB.Frame Frame14
Caption= "ローパスフィルタ"
Height
= 615
Left
= 240
TabIndex= 53
Top= 2880Width= 2535
Begin VB.OptionButton DaFilter
Caption= "ON"Height
= 255
Index
= 0

- 35 -Left= 360
TabIndex
= 19
Top
= 240
Width
= 615
End
Begin VB.OptionButton DaFilter
Caption= "OFF"
Height
= 255
Index
= 1
Left
= 1560TabIndex
= 20
Top
= 240
Value
= ‑1 'True
Width
= 700
End
End
Begin VB.Frame Frame13
Caption= "サンプリング周波数"
Height
= 855
Left
= 240
TabIndex
= 50
Top
= 240
Width
= 4575
Begin VB.OptionButton DaTimer
Caption= "5MHz 固定"
Height
= 255
Index
= 1
Left
= 3360TabIndex
= 17
Top
= 480
Width
= 1095End
Begin VB.OptionButton DaTimer
Caption= "8254"
Height
= 255
Index
= 0
Left
= 2640TabIndex
= 16
Top
= 480
Value
= ‑1 'True
Width
= 735
End
Begin VB.ComboBox DaFreq
Height= 300
ItemData= "SamplingConf.frx":000C
Left
= 240
List
= "SamplingConf.frx":0034
TabIndex
= 15
Top
= 360
Width
= 1815End
Begin VB.Label Label12
Caption= "Hz"Height= 255
Left= 2160TabIndex
= 52
Top
= 480
Width
= 375
End
Begin VB.Label Label11
Caption= "タイマ選択"
Height= 255
Left= 3120TabIndex
= 51
Top
= 240
Width
= 1215End
End
Begin VB.Frame Frame12
Caption= "トリガ設定"
Height= 1815
Left= 5040TabIndex= 46- 36 -

Top
= 240
Width
= 4575
Begin VB.OptionButton DaTrigSwitch
Caption= "トリガなし"
Height
= 255
Index
= 0
Left
= 360
TabIndex
= 21
Top
= 240
Value
= ‑1 'True
Width= 1095End
Begin VB.OptionButton DaTrigSwitch
Caption= "外部トリガ"
Height
= 255
Index
= 1
Left
= 1800TabIndex
= 22
Top
= 240
Width
= 1095End
Begin VB.TextBox DaDelayNum
Alignment= 1 '右揃え
Enabled= 0 'False
Height= 270
Left= 2160
MaxLength= 6
TabIndex
= 24
Top
= 960
Width
= 1935End
Begin VB.ComboBox DaTrigPoint
Enabled= 0 'False
Height= 300
ItemData= "SamplingConf.frx":009B
Left= 2160
List= "SamplingConf.frx":00A8
Style= 2 'ﾄﾞﾛｯﾌﾟﾀﾞｳﾝ ﾘｽﾄ
TabIndex
= 23
Top
= 600
Width
= 1935End
Begin VB.ComboBox DaTrigEdge
Enabled= 0 'False
Height= 300
ItemData= "SamplingConf.frx":00D4
Left= 2160
List= "SamplingConf.frx":00DEStyle= 2 'ﾄﾞﾛｯﾌﾟﾀﾞｳﾝ ﾘｽﾄ
TabIndex= 25
Top= 1320Width= 1935End
Begin VB.Label Label10
Caption= "トリガエッジ極性"
Enabled= 0 'False
Height
= 255
Left
= 720
TabIndex= 49
Top= 1380Width= 1335End
Begin VB.Label Label9
Caption= "ディレイ件数"
Enabled= 0 'False
Height
= 255
Left
= 720
TabIndex= 48
Top= 1020Width= 1215End
Begin VB.Label Label5
Caption= "トリガポイント"- 37 -

Enabled= 0 'False
Height
= 255
Left
= 720
TabIndex
= 47
Top
= 680
Width
= 1215End
End
Begin VB.Frame Frame11
Caption= "レンジ"Height
= 855
Left
= 240
TabIndex= 45
Top= 1200Width= 4575
Begin VB.ComboBox DaRange
Height= 300
ItemData= "SamplingConf.frx":0106
Left
= 600
List
= "SamplingConf.frx":0122
Style= 2 'ﾄﾞﾛｯﾌﾟﾀﾞｳﾝ ﾘｽﾄ
TabIndex
= 18
Top
= 300
Width
= 3375End
End
Begin VB.Frame Frame10
Caption= "CN3"Height
= 615
Left
= 240
TabIndex= 44
Top= 2160Width= 2535
Begin VB.ComboBox DaCn3
Height= 300
ItemData= "SamplingConf.frx":01EA
Left
= 240
List
= "SamplingConf.frx":01F4
Style= 2 'ﾄﾞﾛｯﾌﾟﾀﾞｳﾝ ﾘｽﾄ
TabIndex
= 26
Top
= 240
Width
= 1935End
End
Begin VB.Frame Frame9
Caption= "CN4"Height= 615
Left= 3000TabIndex= 42
Top= 2160Width= 6615
Begin VB.ComboBox DaCn4
Height= 300
ItemData= "SamplingConf.frx":0210
Left
= 240
List
= "SamplingConf.frx":021A
Style= 2 'ﾄﾞﾛｯﾌﾟﾀﾞｳﾝ ﾘｽﾄ
TabIndex
= 27
Top
= 240
Width
= 1935End
Begin VB.ComboBox DaCn4Edge
Enabled= 0 'False
Height= 300
ItemData= "SamplingConf.frx":023A
Left= 4560
List= "SamplingConf.frx":0244
Style= 2 'ﾄﾞﾛｯﾌﾟﾀﾞｳﾝ ﾘｽﾄ
TabIndex
= 28
Top
= 240
Width
= 1815End
Begin VB.Label Label3- 38 -

Caption= "外部クロックエッジ極性"
Enabled= 0 'False
Height= 255
Left= 2640TabIndex
= 43
Top
= 300
Width
= 1815End
End
End
Begin VB.Frame Frame3
Caption= "共通設定"
BeginProperty Font
Name
= "ＭＳ Ｐゴシック"
Size= 9Charset= 128
Weight= 700
Underline= 0 'False
Italic= 0 'False
Strikethrough = 0 'False
EndProperty
Height
= 855
Left
= 120
TabIndex
= 31
Top
= 120
Width
= 3975
Begin VB.ComboBox AdSampleNum
Height= 300
ItemData= "SamplingConf.frx":026C
Left= 1920
List= "SamplingConf.frx":029A
TabIndex
= 2
Top
= 360
Width
= 1695End
Begin VB.Label Label2
Caption= "サンプリング件数"
Height
= 255
Left
= 240
TabIndex
= 32
Top
= 420
Width
= 1455End
End
Begin VB.Frame Frame1
Caption= "A/D"
BeginProperty Font
Name
= "ＭＳ Ｐゴシック"
Size= 9Charset= 128
Weight= 700
Underline= 0 'False
Italic= 0 'False
Strikethrough = 0 'False
EndProperty
Height= 2895
Left= 120
TabIndex= 1
Top= 1080Width= 9855
Begin VB.Frame Frame7
Caption= "CN4"Height= 615
Left= 3000TabIndex= 39
Top= 2160Width= 6615
Begin VB.ComboBox AdCn4Edge
Enabled= 0 'False
Height= 300
ItemData= "SamplingConf.frx":02F6
Left= 4560
List= "SamplingConf.frx":0300- 39 -

Style= 2 'ﾄﾞﾛｯﾌﾟﾀﾞｳﾝ ﾘｽﾄ
TabIndex
= 14
Top
= 240
Width
= 1815End
Begin VB.ComboBox AdCn4
Height= 300
ItemData= "SamplingConf.frx":0328
Left
= 240
List
= "SamplingConf.frx":0332
Style= 2 'ﾄﾞﾛｯﾌﾟﾀﾞｳﾝ ﾘｽﾄ
TabIndex
= 13
Top
= 240
Width
= 1935End
Begin VB.Label Label1
Caption= "外部クロックエッジ極性"
Enabled= 0 'False
Height= 255
Left= 2640TabIndex
= 40
Top
= 300
Width
= 1815End
End
Begin VB.Frame Frame6
Caption= "CN3"Height
= 615
Left
= 240
TabIndex= 38
Top= 2160Width= 2535
Begin VB.ComboBox AdCn3
Height= 300
ItemData= "SamplingConf.frx":0352
Left
= 240
List
= "SamplingConf.frx":035C
Style= 2 'ﾄﾞﾛｯﾌﾟﾀﾞｳﾝ ﾘｽﾄ
TabIndex
= 12
Top
= 240
Width
= 1935End
End
Begin VB.Frame Frame5
Caption= "レンジ"Height
= 855
Left
= 240
TabIndex= 37
Top= 1200Width= 4575
Begin VB.ComboBox AdRange
Height= 300
ItemData= "SamplingConf.frx":0378
Left
= 600
List
= "SamplingConf.frx":038E
Style= 2 'ﾄﾞﾛｯﾌﾟﾀﾞｳﾝ ﾘｽﾄ
TabIndex
= 6
Top
= 300
Width
= 3375End
End
Begin VB.Frame Frame4
Caption= "トリガ設定"
Height= 1815
Left= 5040TabIndex
= 33
Top
= 240
Width
= 4575
Begin VB.ComboBox AdTrigEdge
Enabled= 0 'False
Height= 300
ItemData= "SamplingConf.frx":0418
Left= 2160- 40 -

List= "SamplingConf.frx":0422
Style= 2 'ﾄﾞﾛｯﾌﾟﾀﾞｳﾝ ﾘｽﾄ
TabIndex= 11
Top= 1320Width= 1935End
Begin VB.ComboBox AdTrigPoint
Enabled= 0 'False
Height= 300
ItemData= "SamplingConf.frx":044A
Left= 2160
List= "SamplingConf.frx":0457
Style= 2 'ﾄﾞﾛｯﾌﾟﾀﾞｳﾝ ﾘｽﾄ
TabIndex
= 9
Top
= 600
Width
= 1935End
Begin VB.TextBox AdDelayNum
Alignment= 1 '右揃え
Enabled= 0 'False
Height= 270
Left= 2160
MaxLength= 6
TabIndex
= 10
Top
= 960
Width
= 1935End
Begin VB.OptionButton AdTrigSwitch
Caption= "外部トリガ"
Height
= 255
Index
= 1
Left
= 1800TabIndex
= 8
Top
= 240
Width
= 1095End
Begin VB.OptionButton AdTrigSwitch
Caption= "トリガなし"
Height
= 255
Index
= 0
Left
= 360
TabIndex
= 7
Top
= 240
Value
= ‑1 'True
Width= 1095End
Begin VB.Label Label6
Caption= "トリガポイント"
Enabled= 0 'False
Height
= 255
Left
= 720
TabIndex
= 36
Top
= 680
Width
= 1215End
Begin VB.Label Label7
Caption= "ディレイ件数"
Enabled= 0 'False
Height
= 255
Left
= 720
TabIndex= 35
Top= 1020Width= 1215End
Begin VB.Label Label8
Caption= "トリガエッジ極性"
Enabled= 0 'False
Height
= 255
Left
= 720
TabIndex= 34
Top= 1380Width= 1335End- 41 -

End
Begin VB.Frame Frame2
Caption= "サンプリング周波数"
Height
= 855
Left
= 240
TabIndex
= 29
Top
= 240
Width
= 4575
Begin VB.ComboBox AdFreq
Height= 300
ItemData= "SamplingConf.frx":0483
Left
= 240
List
= "SamplingConf.frx":04B7
Style= 2 'ﾄﾞﾛｯﾌﾟﾀﾞｳﾝ ﾘｽﾄ
TabIndex
= 3
Top
= 360
Width
= 1935End
Begin VB.OptionButton AdFastMode
Caption= "ON"Height
= 255
Index
= 0
Left
= 2640TabIndex
= 4
Top
= 480
Width
= 735
End
Begin VB.OptionButton AdFastMode
Caption= "OFF"
Height
= 255
Index
= 1
Left
= 3480TabIndex
= 5
Top
= 480
Value
= ‑1 'True
Width
= 735
End
Begin VB.Label Label4
Caption= "倍速モード(x2)"
Height= 255
Left= 2880TabIndex
= 30
Top
= 240
Width
= 1215End
End
End
Begin VB.Label ErrorLabel
Caption= "エラーです"
BeginProperty Font
Name
= "ＭＳ Ｐゴシック"
Size= 11.25
Charset= 128
Weight= 400
Underline= 0 'False
Italic= 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor= &H000000FF&
Height= 255
Left= 8520TabIndex
= 54
Top
= 120
Visible= 0 'False
Width= 1095End
End
Attribute VB̲Name = "frmSamplingConf"
Attribute VB̲GlobalNameSpace = False
Attribute VB̲Creatable = False
Attribute VB̲PredeclaredId = True
Attribute VB̲Exposed = False- 42 -

Private Sub AdCn3̲Click()
If AdCn3.ListIndex = 0 Then
AdTrigSwitch(0).Value = TrueLabel6.Enabled = False
Label7.Enabled = False
Label8.Enabled = False
AdTrigPoint.Enabled = False
AdDelayNum.Enabled = False
AdTrigEdge.Enabled = False
Else
AdTrigSwitch(1).Value = TrueLabel6.Enabled = TrueLabel7.Enabled = TrueLabel8.Enabled = True
AdTrigPoint.Enabled = True
AdDelayNum.Enabled = True
AdTrigEdge.Enabled = True
End IfEnd Sub
Private Sub AdCn4̲Click()
If AdCn4.ListIndex = 0 Then
AdFreq.Enabled = TrueLabel1.Enabled = False
AdCn4Edge.Enabled = False
Else
AdFreq.Enabled = False
Label1.Enabled = True
AdCn4Edge.Enabled = True
End IfEnd Sub
Private Sub AdDelayNum̲GotFocus()
AdDelayNum.SelStart = 0
AdDelayNum.SelLength = Len(AdDelayNum.Text)
End Sub
Private Sub AdDelayNum̲KeyPress(KeyAscii As Integer)
If KeyAscii < Asc(" ") Then
Exit SubEnd IfIf (KeyAscii < Asc("0") Or KeyAscii > Asc("9")) And KeyAscii <> Asc("‑") Then
KeyAscii = 0
End IfEnd Sub
Private Sub AdSampleNum̲KeyPress(KeyAscii As Integer)
If KeyAscii < Asc(" ") Then
Exit SubEnd IfIf KeyAscii < Asc("0") Or KeyAscii > Asc("9") Then
KeyAscii = 0
End If
If Len(AdSampleNum.Text) >= 6 Then
KeyAscii = 0
End IfEnd Sub
Private Sub Command1̲Click()Dim nRet As Long
'A/D サンプリング件数を変数へ
adConfig.ulSmplNum = Val(AdSampleNum.Text)'A/D サンプリング周波数を変数へ
Select Case AdFreq.ListIndex
Case 0adConfig.fSmplFreq = 10000000
Case 1adConfig.fSmplFreq = 8000000
Case 2adConfig.fSmplFreq = 5000000
Case 3- 43 -

adConfig.fSmplFreq = 4000000
Case 4adConfig.fSmplFreq = 2500000
Case 5adConfig.fSmplFreq = 2000000
Case 6adConfig.fSmplFreq = 1250000
Case 7
adConfig.fSmplFreq = 1000000
Case 8adConfig.fSmplFreq = 625000
Case 9adConfig.fSmplFreq = 500000
Case 10adConfig.fSmplFreq = 312500
Case 11
adConfig.fSmplFreq = 250000
Case 12
adConfig.fSmplFreq = 156250
Case 13
adConfig.fSmplFreq = 125000
Case 14
adConfig.fSmplFreq = 78125
Case 15
adConfig.fSmplFreq = 62500
End Select'A/D 倍速モードを変数へ
If AdFastMode(0).Value = True Then
adConfig.ulFastMode = AD̲FAST̲MODE
Else
adConfig.ulFastMode = AD̲NORMAL̲MODE
End If'A/D レンジを変数へ
Select Case AdRange.ListIndex
Case 0adConfig.SmplChReq(0).ulRange = AD̲0̲1V
adVmax = 1#
adVmin = 0
Case 1adConfig.SmplChReq(0).ulRange = AD̲0̲2P5V
adVmax = 2.5
adVmin = 0
Case 2adConfig.SmplChReq(0).ulRange = AD̲0̲5V
adVmax = 5#
adVmin = 0
Case 3adConfig.SmplChReq(0).ulRange = AD̲1V
adVmax = 1#
adVmin = ‑1#
Case 4adConfig.SmplChReq(0).ulRange = AD̲2P5V
adVmax = 2.5
adVmin = ‑2.5
Case 5adConfig.SmplChReq(0).ulRange = AD̲5V
adVmax = 5#
adVmin = ‑5#
End Select'A/D トリガを変数へ
If AdTrigSwitch(0).Value = True Then
adConfig.ulTrigMode = AD̲FREERUN
Else
adConfig.ulTrigMode = AD̲EXTTRGEnd If'A/D トリガポイントを変数へ
Select Case AdTrigPoint.ListIndex
Case 0adConfig.ulTrigPoint = AD̲TRIG̲START- 44 -

Case 1adConfig.ulTrigPoint = AD̲TRIG̲STOP
Case 2adConfig.ulTrigPoint = AD̲TRIG̲START̲STOPEnd Select'A/D ディレイ件数を変数へ
adConfig.lTrigDelay = Val(AdDelayNum.Text)'A/D トリガエッジ極性を変数へ
Select Case AdTrigEdge.ListIndex
Case 0adConfig.ulTrigEdge = AD̲DOWN̲EDGE
Case 1adConfig.ulTrigEdge = AD̲UP̲EDGE
End Select'A/D クロックエッジ極性を変数へ
Select Case AdCn4Edge.ListIndex
Case 0adConfig.ulEClkEdge = AD̲DOWN̲EDGE
Case 1adConfig.ulEClkEdge = AD̲UP̲EDGE
End Select'A/D CN4 が入力(外部クロック入力)ならばサンプリング周波数を０に
If AdCn4.ListIndex = 1 Then
adConfig.fSmplFreq = 0
If DaCn4.ListIndex = 1 Then
horiScaleMode = 0
ElsehoriScaleAd = 0
End IfEnd If'サンプリング件数のチェック
If adConfig.ulSmplNum > 524288 Then
ErrorLabel.Visible = True
Call AdDispErrMessage(AD̲ERROR̲INVALID̲PARAMETER)
Exit SubEnd If'チャンネル数
adConfig.ulChCount = 2
adConfig.SmplChReq(0).ulChNo = 1
adConfig.SmplChReq(1).ulChNo = 2'D/A サンプリング周波数を変数へ
daConfig.fSmplFreq = Val(DaFreq.Text)'D/A タイマ選択を変数へ
If DaTimer(0).Value = True ThendaMode.ulSamplingClock = DA̲CLOCK̲TIMER
ElsedaMode.ulSamplingClock = DA̲CLOCK̲FIXEDEnd If'D/A レンジを変数へ
Select Case DaRange.ListIndex
Case 0daMode.ModeChReq(0).ulRange = DA̲RANGE̲UNIPOLAR
daMode.ModeChReq(0).fVolt = 1.025
frmMain.opReal.Enabled = True
adConfig.SmplChReq(1).ulRange = AD̲0̲1V
daVmax = 1.025
daVmin = 0
Case 1
daMode.ModeChReq(0).ulRange = DA̲RANGE̲UNIPOLAR- 45 -

daMode.ModeChReq(0).fVolt = 2.5
frmMain.opReal.Enabled = True
adConfig.SmplChReq(1).ulRange = AD̲0̲2P5V
daVmax = 2.5
daVmin = 0
Case 2
daMode.ModeChReq(0).ulRange = DA̲RANGE̲UNIPOLAR
adConfig.SmplChReq(1).ulRange = AD̲0̲5V
frmMain.opReal.Enabled = True
daMode.ModeChReq(0).fVolt = 5#
daVmax = 5#
daVmin = 0
Case 3
daMode.ModeChReq(0).ulRange = DA̲RANGE̲UNIPOLAR
daMode.ModeChReq(0).fVolt = 10#
adConfig.SmplChReq(1).ulRange = AD̲0̲5V
frmMain.opReal.Enabled = False
frmMain.opReal.Value = False
MsgBox "A/D の CN2 には何も接続しないでください"
daVmax = 10#
daVmin = 0
Case 4
daMode.ModeChReq(0).ulRange = DA̲RANGE̲BIPOLAR
daMode.ModeChReq(0).fVolt = 1.025
frmMain.opReal.Enabled = True
adConfig.SmplChReq(1).ulRange = AD̲1V
daVmax = 1.025
daVmin = ‑1.025
Case 5daMode.ModeChReq(0).ulRange = DA̲RANGE̲BIPOLAR
daMode.ModeChReq(0).fVolt = 2.5
frmMain.opReal.Enabled = True
adConfig.SmplChReq(1).ulRange = AD̲2P5V
daVmax = 2.5
daVmin = ‑2.5
Case 6
daMode.ModeChReq(0).ulRange = DA̲RANGE̲BIPOLAR
daMode.ModeChReq(0).fVolt = 5#
frmMain.opReal.Enabled = True
adConfig.SmplChReq(1).ulRange = AD̲5V
daVmax = 5#
daVmin = ‑5#Case 7
daMode.ModeChReq(0).ulRange = DA̲RANGE̲BIPOLAR
daMode.ModeChReq(0).fVolt = 10#
adConfig.SmplChReq(1).ulRange = AD̲5V
frmMain.opReal.Enabled = False
frmMain.opReal.Value = False
MsgBox "D/A View の Real は使えません。A/D の CN2 には何も接続しないでください。"
daVmax = 10#
daVmin = ‑10#
End Select'D/A ローパスフィルタを変数へ
If DaFilter(0).Value = True ThendaMode.ModeChReq(0).ulFilter = DA̲FILTER̲ON
ElsedaMode.ModeChReq(0).ulFilter = DA̲FILTER̲OFF
End If'D/A トリガを変数へ
If DaTrigSwitch(0).Value = True ThendaConfig.ulTrigMode = DA̲FREERUN
Else
daConfig.ulTrigMode = DA̲EXTTRGEnd If'D/A トリガポイントを変数へ
Select Case DaTrigPoint.ListIndex
Case 0
daConfig.ulTrigPoint = DA̲TRIG̲START
Case 1
daConfig.ulTrigPoint = DA̲TRIG̲STOP- 46 -

Case 2daConfig.ulTrigPoint = DA̲TRIG̲START̲STOPEnd Select'D/A ディレイ件数を変数へ
daConfig.ulTrigDelay = Val(DaDelayNum.Text)'D/A トリガエッジ極性を変数へ
Select Case DaTrigEdge.ListIndex
Case 0
daConfig.ulTrigEdge = DA̲DOWN̲EDGE
Case 1
daConfig.ulTrigEdge = DA̲UP̲EDGE
End Select'D/A 外部クロックエッジ極性を変数へ
Select Case DaCn4Edge.ListIndex
Case 0
daConfig.ulEClkEdge = DA̲DOWN̲EDGE
Case 1
daConfig.ulEClkEdge = DA̲UP̲EDGE
End Select'D/A CN3 を変数へ
Select Case DaCn3.ListIndex
Case 0daMode.ulExControl = DA̲EXTRG̲OUT
Case 1
daMode.ulExControl = DA̲EXTRG̲IN
End Select'D/A CN4 を変数へ
Select Case DaCn4.ListIndex
Case 0daMode.ulExClock = DA̲EXCLK̲OUT
Case 1
daMode.ulExClock = DA̲EXCLK̲IN
daConfig.fSmplFreq = 0
If AdCn4.ListIndex = 1 Then
horiScaleMode = 0
ElsehoriScaleAd = 1
End IfEnd Select'D/A リピート回数を変数へ
daConfig.ulSmplRepeat = Val(DaRepeatNum.Text)'D/A ラッチクリアするしないを変数へ
If DaLatch(0).Value = True ThendaMode.ulDaLatch = DA̲LATCH̲CLEAR
ElsedaMode.ulDaLatch = DA̲LATCH̲NONCLEAR
End If'D/A の設定を適用
nRet = DaSetSamplingConfig(daDeviceHandle, daConfig)
If nRet <> DA̲ERROR̲SUCCESS Then
ErrorLabel.Visible = True
Call DaDispErrMessage(nRet)
Exit SubEnd IfnRet = DaSetMode(daDeviceHandle, daMode)If nRet <> DA̲ERROR̲SUCCESS Then
ErrorLabel.Visible = True
Call DaDispErrMessage(nRet)
Exit SubEnd IffrmMain.InfoBox.SelStart = Len(frmMain.InfoBox.Text) + 1
frmMain.InfoBox.SelText = vbCrLf & "D/A ‑ サンプリング条件設定ＯＫ"
ulSmplBufferSize = adConfig.ulSmplNum
nRet = DaSetBoardConfig(daDeviceHandle, ulSmplBufferSize, 0, AddressOf DaCallBackProc, 0)
If nRet <> DA̲ERROR̲SUCCESS Then

- 47 -

ErrorLabel.Visible = True
Call DaDispErrMessage(nRet)
Exit SubEnd IffrmMain.InfoBox.SelStart = Len(frmMain.InfoBox.Text) + 1
frmMain.InfoBox.SelText = vbCrLf & "D/A ‑ ボード条件設定ＯＫ"'A/D の設定を適用
nRet = AdSetSamplingConfig(adDeviceHandle, adConfig)
If nRet <> AD̲ERROR̲SUCCESS Then
ErrorLabel.Visible = True
Call AdDispErrMessage(nRet)
Exit SubEnd IffrmMain.InfoBox.SelStart = Len(frmMain.InfoBox.Text) + 1
frmMain.InfoBox.SelText = vbCrLf & "A/D ‑ サンプリング条件設定ＯＫ"'設定済みフラグを立てる
samplingConfFlag = 1'サンプリングデータセットフラグリセット'daMakeDataFlag = 0'メインウィンドウの目盛りの処理'V‑t グラフ
Call DispHoriScale
If adVmax > daVmax ThenfrmMain.MesureMax.Caption = LTrim(Str(adVmax)) & "V"vMaxNum = adVmax
Else
frmMain.MesureMax.Caption = LTrim(Str(daVmax)) & "V"vMaxNum = daVmax
End IfIf daMode.ModeChReq(0).ulRange = DA̲RANGE̲BIPOLAR Or (adConfig.SmplChReq(0).ulRange And &HF0000) ThenfrmMain.MesureCenter.Caption = "0V"
frmMain.MesureMin.Caption = "‑" & frmMain.MesureMax.Caption
vMinNum = (‑1) * vMaxNum
Else
frmMain.MesureMin.Caption = "0V"
vMinNum = 0#
If adVmax > daVmax ThenfrmMain.MesureCenter.Caption = LTrim(Str(adVmax / 2)) & "V"Else
frmMain.MesureCenter.Caption = LTrim(Str(daVmax / 2)) & "V"
End IfEnd If'V‑V グラフ
frmMain.LabelAdMax.Caption = LTrim(Str(adVmax))
frmMain.LabelAdMin.Caption = LTrim(Str(adVmin))frmMain.LabelAdMid.Caption = LTrim(Str((adVmax + adVmin) / 2))
frmMain.LabelDaMax.Caption = LTrim(Str(daVmax))
frmMain.LabelDaMin.Caption = LTrim(Str(daVmin))frmMain.LabelDaMid.Caption = LTrim(Str((daVmax + daVmin) / 2))'A/D データ配列サイズ宣言
ReDim adData(adConfig.ulSmplNum * 2)'閉じる
Unload Me
End Sub
Private Sub Command2̲Click()
Unload Me
End Sub
Private Sub DaCn3̲Click()
If DaCn3.ListIndex = 0 Then
DaTrigSwitch(0).Value = TrueLabel5.Enabled = False
Label9.Enabled = False- 48 -

Label10.Enabled = False
DaTrigPoint.Enabled = False
DaDelayNum.Enabled = False
DaTrigEdge.Enabled = False
Else
DaTrigSwitch(1).Value = TrueLabel5.Enabled = TrueLabel9.Enabled = TrueLabel10.Enabled = True
DaTrigPoint.Enabled = True
DaDelayNum.Enabled = True
DaTrigEdge.Enabled = True
End IfEnd Sub
Private Sub DaCn4̲Click()
If DaCn4.ListIndex = 0 Then
If DaTimer(0).Value = True Then
DaFreq.Enabled = True
End IfLabel3.Enabled = False
DaCn4Edge.Enabled = False
Label11.Enabled = True
DaTimer(0).Enabled = True
DaTimer(1).Enabled = True
Else
DaFreq.Enabled = False
Label3.Enabled = True
DaCn4Edge.Enabled = TrueLabel11.Enabled = False
DaTimer(0).Enabled = False
DaTimer(1).Enabled = False
End IfEnd Sub
Private Sub DaDelayNum̲GotFocus()
DaDelayNum.SelStart = 0
DaDelayNum.SelLength = Len(DaDelayNum.Text)
End Sub
Private Sub DaDelayNum̲KeyPress(KeyAscii As Integer)
If KeyAscii < Asc(" ") Then
Exit SubEnd IfIf (KeyAscii < Asc("0") Or KeyAscii > Asc("9")) And KeyAscii <> Asc("‑") Then
KeyAscii = 0
End IfEnd Sub
Private Sub DaRepeatNum̲GotFocus()
DaRepeatNum.SelStart = 0
DaRepeatNum.SelLength = Len(DaRepeatNum.Text)
End Sub
Private Sub DaTimer̲Click(Index As Integer)
Select Case Index
Case 0
DaFreq.Enabled = TrueLabel12.Enabled = True
Case 1
DaFreq.Enabled = False
Label12.Enabled = False
End SelectEnd Sub
Private Sub DaTrigSwitch̲Click(Index As Integer)
If Index = 1 Then
Label5.Enabled = TrueLabel9.Enabled = TrueLabel10.Enabled = True
DaTrigPoint.Enabled = True
DaDelayNum.Enabled = True

- 49 -

DaTrigEdge.Enabled = True
DaCn3.ListIndex = 1
ElseLabel5.Enabled = False
Label9.Enabled = False
Label10.Enabled = False
DaTrigPoint.Enabled = False
DaDelayNum.Enabled = False
DaTrigEdge.Enabled = False
DaCn3.ListIndex = 0
End IfEnd Sub
Private Sub Form̲Load()'現在の設定を表示するためのもの'A/D'サンプリング件数
AdSampleNum.Text = LTrim(Str(adConfig.ulSmplNum))'サンプリング周波数
Select Case adConfig.fSmplFreq
Case 10000000
AdFreq.ListIndex = 0
AdCn4.ListIndex = 0
Label1.Enabled = False
AdCn4Edge.Enabled = False
Case 8000000
AdFreq.ListIndex = 1
AdCn4.ListIndex = 0
Label1.Enabled = False
AdCn4Edge.Enabled = False
Case 5000000
AdFreq.ListIndex = 2
AdCn4.ListIndex = 0
Label1.Enabled = False
AdCn4Edge.Enabled = False
Case 4000000
AdFreq.ListIndex = 3
AdCn4.ListIndex = 0
Label1.Enabled = False
AdCn4Edge.Enabled = False
Case 2500000
AdFreq.ListIndex = 4
AdCn4.ListIndex = 0
Label1.Enabled = False
AdCn4Edge.Enabled = False
Case 2000000
AdFreq.ListIndex = 5
AdCn4.ListIndex = 0
Label1.Enabled = False
AdCn4Edge.Enabled = False
Case 1250000
AdFreq.ListIndex = 6
AdCn4.ListIndex = 0
Label1.Enabled = False
AdCn4Edge.Enabled = False
Case 1000000
AdFreq.ListIndex = 7
AdCn4.ListIndex = 0
Label1.Enabled = False
AdCn4Edge.Enabled = False
Case 625000
AdFreq.ListIndex = 8
AdCn4.ListIndex = 0
Label1.Enabled = False
AdCn4Edge.Enabled = False
Case 500000
AdFreq.ListIndex = 9
AdCn4.ListIndex = 0
Label1.Enabled = False
AdCn4Edge.Enabled = False- 50 -

Case 312500
AdFreq.ListIndex = 10
AdCn4.ListIndex = 0
Label1.Enabled = False
AdCn4Edge.Enabled = False
Case 250000
AdFreq.ListIndex = 11
AdCn4.ListIndex = 0
Label1.Enabled = False
AdCn4Edge.Enabled = False
Case 156250
AdFreq.ListIndex = 12
AdCn4.ListIndex = 0
Label1.Enabled = False
AdCn4Edge.Enabled = False
Case 125000
AdFreq.ListIndex = 13
AdCn4.ListIndex = 0
Label1.Enabled = False
AdCn4Edge.Enabled = False
Case 78125
AdFreq.ListIndex = 14
AdCn4.ListIndex = 0
Label1.Enabled = False
AdCn4Edge.Enabled = False
Case 62500
AdFreq.ListIndex = 15
AdCn4.ListIndex = 0
Label1.Enabled = False
AdCn4Edge.Enabled = False
Case 0
AdFreq.Enabled = False'AdCn4.Enabled = True
AdCn4.ListIndex = 1
Label1.Enabled = True
AdCn4Edge.Enabled = True
Case Else
AdFreq.ListIndex = ‑1
End Select'A/D 倍速モード
Select Case adConfig.ulFastMode
Case AD̲NORMAL̲MODE
AdFastMode(1).Value = True
Case AD̲FAST̲MODE
AdFastMode(0).Value = True
End Select'A/D レンジ
Select Case adConfig.SmplChReq(0).ulRange
Case AD̲0̲1V
AdRange.ListIndex = 0
Case AD̲0̲2P5V
AdRange.ListIndex = 1
Case AD̲0̲5V
AdRange.ListIndex = 2
Case AD̲1V
AdRange.ListIndex = 3
Case AD̲2P5V
AdRange.ListIndex = 4
Case AD̲5V
AdRange.ListIndex = 5
Case Else
AdRange.ListIndex = ‑1
End Select'A/D トリガ
Select Case adConfig.ulTrigMode
Case AD̲FREERUN
AdTrigSwitch(0).Value = TrueLabel6.Enabled = False
Label7.Enabled = False- 51 -

Label8.Enabled = False
AdTrigPoint.Enabled = False
AdDelayNum.Enabled = False
AdTrigEdge.Enabled = False
AdCn3.ListIndex = 0
Case AD̲EXTTRG
AdTrigSwitch(1).Value = TrueLabel6.Enabled = TrueLabel7.Enabled = TrueLabel8.Enabled = True
AdTrigPoint.Enabled = True
AdDelayNum.Enabled = True
AdTrigEdge.Enabled = True
AdCn3.ListIndex = 1
End Select'A/D トリガポイント
Select Case adConfig.ulTrigPoint
Case AD̲TRIG̲START
AdTrigPoint.ListIndex = 0
Case AD̲TRIG̲STOP
AdTrigPoint.ListIndex = 1
Case AD̲TRIG̲START̲STOP
AdTrigPoint.ListIndex = 2
End Select'A/D ディレイ件数
AdDelayNum.Text = LTrim(Str(adConfig.lTrigDelay))'A/D トリガエッジ極性
Select Case adConfig.ulTrigEdge
Case AD̲DOWN̲EDGE
AdTrigEdge.ListIndex = 0
Case AD̲UP̲EDGE
AdTrigEdge.ListIndex = 1
End Select'A/D 外部クロックエッジ極性
Select Case adConfig.ulEClkEdge
Case AD̲DOWN̲EDGE
AdCn4Edge.ListIndex = 0
Case AD̲UP̲EDGE
AdCn4Edge.ListIndex = 1
End Select'D/A'サンプリング周波数
DaFreq.Text = LTrim(Str(daConfig.fSmplFreq))'D/A タイマ選択
Select Case daMode.ulSamplingClock
Case DA̲CLOCK̲TIMER
DaTimer(0).Value = True
DaFreq.Enabled = True
Case DA̲CLOCK̲FIXED
DaTimer(1).Value = True
DaFreq.Enabled = False
End Select'D/A レンジ
Select Case daMode.ModeChReq(0).ulRange
Case DA̲RANGE̲UNIPOLAR
Select Case daMode.ModeChReq(0).fVolt
Case 1.025
DaRange.ListIndex = 0
Case 2.5
DaRange.ListIndex = 1
Case 5#
DaRange.ListIndex = 2
Case 10#
DaRange.ListIndex = 3
Case Else- 52 -

DaRange.ListIndex = ‑1
End SelectCase DA̲RANGE̲BIPOLAR
Select Case daMode.ModeChReq(0).fVolt
Case 1.025
DaRange.ListIndex = 4
Case 2.5
DaRange.ListIndex = 5
Case 5#
DaRange.ListIndex = 6
Case 10#
DaRange.ListIndex = 7
Case Else
DaRange.ListIndex = ‑1
End SelectEnd Select'D/A ローパスフィルタ
Select Case daMode.ModeChReq(0).ulFilter
Case DA̲FILTER̲OFF
DaFilter(1).Value = True
Case DA̲FILTER̲ON
DaFilter(0).Value = True
End Select'D/A トリガ
Select Case daConfig.ulTrigMode
Case DA̲FREERUN
DaTrigSwitch(0).Value = TrueLabel5.Enabled = False
Label9.Enabled = False
Label10.Enabled = False
DaTrigPoint.Enabled = False
DaDelayNum.Enabled = False
DaTrigEdge.Enabled = False
DaCn3.ListIndex = 0
Case DA̲EXTTRG
DaTrigSwitch(1).Value = TrueLabel5.Enabled = TrueLabel9.Enabled = TrueLabel10.Enabled = True
DaTrigPoint.Enabled = True
DaDelayNum.Enabled = True
DaTrigEdge.Enabled = True
DaCn3.ListIndex = 1
End Select'D/A トリガポイント
Select Case daConfig.ulTrigPoint
Case DA̲TRIG̲START
DaTrigPoint.ListIndex = 0
Case DA̲TRIG̲STOP
DaTrigPoint.ListIndex = 1
Case DA̲TRIG̲START̲STOP
DaTrigPoint.ListIndex = 2
End Select'D/A ディレイ件数
DaDelayNum.Text = LTrim(Str(daConfig.ulTrigDelay))'D/A トリガエッジ極性
Select Case daConfig.ulTrigEdge
Case DA̲DOWN̲EDGE
DaTrigEdge.ListIndex = 0
Case DA̲UP̲EDGE
DaTrigEdge.ListIndex = 1
End Select'D/A 外部クロックエッジ極性
Select Case daConfig.ulEClkEdge
Case DA̲DOWN̲EDGE
DaCn4Edge.ListIndex = 0
Case DA̲UP̲EDGE- 53 -

DaCn4Edge.ListIndex = 1
End Select'D/A CN3
Select Case daMode.ulExControl
Case DA̲EXTRG̲IN
DaCn3.ListIndex = 1
Label5.Enabled = TrueLabel9.Enabled = TrueLabel10.Enabled = True
DaTrigPoint.Enabled = True
DaDelayNum.Enabled = True
DaTrigEdge.Enabled = True
DaTrigSwitch(1).Value = True
Case DA̲EXTRG̲OUT
DaCn3.ListIndex = 0
Label5.Enabled = False
Label9.Enabled = False
Label10.Enabled = False
DaTrigPoint.Enabled = False
DaDelayNum.Enabled = False
DaTrigEdge.Enabled = False
DaTrigSwitch(0).Value = True
End Select'D/A CN4
Select Case daMode.ulExClock
Case DA̲EXCLK̲IN
Label3.Enabled = True
DaCn4Edge.Enabled = TrueLabel11.Enabled = False
DaTimer(0).Enabled = False
DaTimer(1).Enabled = False
DaCn4.ListIndex = 1
DaFreq.Enabled = False
Case DA̲EXCLK̲OUT
Label3.Enabled = False
DaCn4Edge.Enabled = False
Label11.Enabled = True
DaTimer(0).Enabled = True
DaTimer(1).Enabled = True
DaCn4.ListIndex = 0
If DaTimer(1).Value = True Then
DaFreq.Enabled = False
Else
DaFreq.Enabled = True
End IfEnd Select'D/A リピート回数
DaRepeatNum = LTrim(Str(daConfig.ulSmplRepeat))'D/A ラッチ
Select Case daMode.ulDaLatch
Case DA̲LATCH̲CLEAR
DaLatch(0).Value = True
Case DA̲LATCH̲NONCLEAR
DaLatch(1).Value = True
End SelectEnd Sub
Private Sub AdTrigSwitch̲Click(Index As Integer)
If Index = 1 Then
Label6.Enabled = TrueLabel7.Enabled = TrueLabel8.Enabled = True
AdTrigPoint.Enabled = True
AdDelayNum.Enabled = True
AdTrigEdge.Enabled = True
AdCn3.ListIndex = 1
ElseLabel6.Enabled = False
Label7.Enabled = False- 54 -

Label8.Enabled = False
AdTrigPoint.Enabled = False
AdDelayNum.Enabled = False
AdTrigEdge.Enabled = False
AdCn3.ListIndex = 0
End IfEnd Sub
Private Sub LoadButton̲Click()'設定をレジストリからロードして表示する'A/D'サンプリング件数
AdSampleNum.Text = GetSetting(appName, secName, "AdSampleNum")'サンプリング周波数
Select Case GetSetting(appName, secName, "AdFreq")
Case 0
AdFreq.ListIndex = 0
AdCn4.ListIndex = 0
Label1.Enabled = False
AdCn4Edge.Enabled = False
Case 1
AdFreq.ListIndex = 1
AdCn4.ListIndex = 0
Label1.Enabled = False
AdCn4Edge.Enabled = False
Case 2
AdFreq.ListIndex = 2
AdCn4.ListIndex = 0
Label1.Enabled = False
AdCn4Edge.Enabled = False
Case 3
AdFreq.ListIndex = 3
AdCn4.ListIndex = 0
Label1.Enabled = False
AdCn4Edge.Enabled = False
Case 4AdFreq.ListIndex = 4
AdCn4.ListIndex = 0
Label1.Enabled = False
AdCn4Edge.Enabled = False
Case 5AdFreq.ListIndex = 5
AdCn4.ListIndex = 0
Label1.Enabled = False
AdCn4Edge.Enabled = False
Case 6AdFreq.ListIndex = 6
AdCn4.ListIndex = 0
Label1.Enabled = False
AdCn4Edge.Enabled = False
Case 7
AdFreq.ListIndex = 7
AdCn4.ListIndex = 0
Label1.Enabled = False
AdCn4Edge.Enabled = False
Case 8AdFreq.ListIndex = 8
AdCn4.ListIndex = 0
Label1.Enabled = False
AdCn4Edge.Enabled = False
Case 9AdFreq.ListIndex = 9
AdCn4.ListIndex = 0
Label1.Enabled = False
AdCn4Edge.Enabled = False
Case 10AdFreq.ListIndex = 10
AdCn4.ListIndex = 0
Label1.Enabled = False
AdCn4Edge.Enabled = False
Case 11
AdFreq.ListIndex = 11

- 55 -

AdCn4.ListIndex = 0
Label1.Enabled = False
AdCn4Edge.Enabled = False
Case 12AdFreq.ListIndex = 12
AdCn4.ListIndex = 0
Label1.Enabled = False
AdCn4Edge.Enabled = False
Case 13
AdFreq.ListIndex = 13
AdCn4.ListIndex = 0
Label1.Enabled = False
AdCn4Edge.Enabled = False
Case 14
AdFreq.ListIndex = 14
AdCn4.ListIndex = 0
Label1.Enabled = False
AdCn4Edge.Enabled = False
Case 15
AdFreq.ListIndex = 15
AdCn4.ListIndex = 0
Label1.Enabled = False
AdCn4Edge.Enabled = False
Case ‑1
AdFreq.Enabled = False'AdCn4.Enabled = True
AdCn4.ListIndex = 1
Label1.Enabled = True
AdCn4Edge.Enabled = True
AdFreq.ListIndex = ‑1
'Case Else'
AdFreq.ListIndex = ‑1
End Select'A/D 倍速モード
Select Case GetSetting(appName, secName, "AdFastMode")
Case True
AdFastMode(0).Value = True
Case False
AdFastMode(1).Value = True
End Select'A/D レンジ
AdRange.ListIndex = GetSetting(appName, secName, "AdRange")'A/D トリガ
Select Case GetSetting(appName, secName, "AdTrigSwitch")
Case True
AdTrigSwitch(0).Value = TrueLabel6.Enabled = False
Label7.Enabled = False
Label8.Enabled = False
AdTrigPoint.Enabled = False
AdDelayNum.Enabled = False
AdTrigEdge.Enabled = False
AdCn3.ListIndex = 0
Case False
AdTrigSwitch(1).Value = TrueLabel6.Enabled = TrueLabel7.Enabled = TrueLabel8.Enabled = True
AdTrigPoint.Enabled = True
AdDelayNum.Enabled = True
AdTrigEdge.Enabled = True
AdCn3.ListIndex = 1
End Select'A/D トリガポイント
AdTrigPoint.ListIndex = GetSetting(appName, secName, "AdTrigPoint")'A/D ディレイ件数
AdDelayNum.Text = GetSetting(appName, secName, "AdDelayNum")- 56 -

'A/D トリガエッジ極性
AdTrigEdge.ListIndex = GetSetting(appName, secName, "AdTrigEdge")'A/D ＣＮ４
Select Case GetSetting(appName, secName, "AdCn4")
Case 0AdCn4.ListIndex = 0
AdFreq.Enabled = TrueLabel1.Enabled = False
AdCn4Edge.Enabled = False
Case 1
AdCn4.ListIndex = 1
AdFreq.Enabled = False
Label1.Enabled = True
AdCn4Edge.Enabled = True
End Select'A/D 外部クロックエッジ極性
AdCn4Edge.ListIndex = GetSetting(appName, secName, "AdCn4Edge")'D/A'サンプリング周波数
DaFreq.Text = GetSetting(appName, secName, "DaFreq")'D/A タイマ選択
Select Case GetSetting(appName, secName, "DaTimer")
Case True
DaTimer(0).Value = True
DaFreq.Enabled = True
Case False
DaTimer(1).Value = True
DaFreq.Enabled = False
End Select'D/A レンジ
DaRange.ListIndex = GetSetting(appName, secName, "DaRange")'D/A ローパスフィルタ
Select Case GetSetting(appName, secName, "DaFilter")Case True
DaFilter(0).Value = True
Case False
DaFilter(1).Value = True
End Select'D/A トリガ
Select Case GetSetting(appName, secName, "DaTrigSwitch")
Case True
DaTrigSwitch(0).Value = TrueLabel5.Enabled = False
Label9.Enabled = False
Label10.Enabled = False
DaTrigPoint.Enabled = False
DaDelayNum.Enabled = False
DaTrigEdge.Enabled = False
DaCn3.ListIndex = 0
Case False
DaTrigSwitch(1).Value = TrueLabel5.Enabled = TrueLabel9.Enabled = TrueLabel10.Enabled = True
DaTrigPoint.Enabled = True
DaDelayNum.Enabled = True
DaTrigEdge.Enabled = True
DaCn3.ListIndex = 1
End Select'D/A トリガポイント
DaTrigPoint.ListIndex = GetSetting(appName, secName, "DaTrigPoint")'D/A ディレイ件数
DaDelayNum.Text = GetSetting(appName, secName, "DaDelayNum")- 57 -

'D/A トリガエッジ極性
DaTrigEdge.ListIndex = GetSetting(appName, secName, "DaTrigEdge")'D/A 外部クロックエッジ極性
DaCn4Edge.ListIndex = GetSetting(appName, secName, "DaCn4Edge")'D/A CN3
Select Case GetSetting(appName, secName, "DaCn3")
Case 1
DaCn3.ListIndex = 1
Label5.Enabled = TrueLabel9.Enabled = TrueLabel10.Enabled = True
DaTrigPoint.Enabled = True
DaDelayNum.Enabled = True
DaTrigEdge.Enabled = True
DaTrigSwitch(1).Value = True
Case 0
DaCn3.ListIndex = 0
Label5.Enabled = False
Label9.Enabled = False
Label10.Enabled = False
DaTrigPoint.Enabled = False
DaDelayNum.Enabled = False
DaTrigEdge.Enabled = False
DaTrigSwitch(0).Value = True
End Select'D/A CN4
Select Case GetSetting(appName, secName, "DaCn4")
Case 1
Label3.Enabled = True
DaCn4Edge.Enabled = TrueLabel11.Enabled = False
DaTimer(0).Enabled = False
DaTimer(1).Enabled = False
DaCn4.ListIndex = 1
DaFreq.Enabled = False
Case 0Label3.Enabled = False
DaCn4Edge.Enabled = False
Label11.Enabled = True
DaTimer(0).Enabled = True
DaTimer(1).Enabled = True
DaCn4.ListIndex = 0
If DaTimer(1).Value = True Then
DaFreq.Enabled = False
Else
DaFreq.Enabled = True
End IfEnd Select'D/A リピート回数
DaRepeatNum = GetSetting(appName, secName, "DaRepeatNum")'D/A ラッチ
Select Case GetSetting(appName, secName, "DaLatch")
Case True
DaLatch(0).Value = True
Case False
DaLatch(1).Value = True
End SelectEnd Sub
Private Sub SaveButton̲Click()Dim nRet As Long
SaveSetting appName, secName, "AdSampleNum", AdSampleNum.Text
SaveSetting appName, secName, "AdFreq", AdFreq.ListIndex
SaveSetting appName, secName, "AdFastMode", AdFastMode(0).Value
SaveSetting appName, secName, "AdRange", AdRange.ListIndex
SaveSetting appName, secName, "AdTrigSwitch", AdTrigSwitch(0).Value
SaveSetting appName, secName, "AdTrigPoint", AdTrigPoint.ListIndex- 58 -

SaveSetting appName, secName, "AdDelayNum", AdDelayNum.Text
SaveSetting appName, secName, "AdTrigEdge", AdTrigEdge.ListIndex
SaveSetting appName, secName, "AdCn3", AdCn3.ListIndex
SaveSetting appName, secName, "AdCn4", AdCn4.ListIndex
SaveSetting appName, secName, "AdCn4Edge", AdCn4Edge.ListIndex
SaveSetting appName, secName, "DaFreq", DaFreq.Text
SaveSetting appName, secName, "DaTimer", DaTimer(0).Value
SaveSetting appName, secName, "DaRange", DaRange.ListIndex
SaveSetting appName, secName, "DaTrigSwitch", DaTrigSwitch(0).Value
SaveSetting appName, secName, "DaTrigPoint", DaTrigPoint.ListIndex
SaveSetting appName, secName, "DaDelayNum", DaDelayNum.Text
SaveSetting appName, secName, "Datrigedge", DaTrigEdge.ListIndex
SaveSetting appName, secName, "DaCn3", DaCn3.ListIndex
SaveSetting appName, secName, "DaCn4", DaCn4.ListIndex
SaveSetting appName, secName, "DaCn4Edge", DaCn4Edge.ListIndex
SaveSetting appName, secName, "DaFilter", DaFilter(0).Value
SaveSetting appName, secName, "DaLatch", DaLatch(0).Value
SaveSetting appName, secName, "DaRepeatNum", DaRepeatNum.Text
End Sub‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑
・SamplingConf.frx
ADDRESS 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F 0123456789ABCDEF‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑
00000000 08 00 00 00 6C 74 00 00 00 00 00 00 0C 00 03 00 ....lt..........
00000010 01 00 30 01 00 30 01 00 30 01 00 30 01 00 30 01 ..0..0..0..0..0.
00000020 00 30 01 00 30 01 00 30 01 00 30 01 00 30 01 00 .0..0..0..0..0..
00000030 30 01 00 30 0C 00 07 00 07 00 32 35 30 30 30 30 0..0......250000
00000040 30 07 00 32 30 30 30 30 30 30 07 00 31 32 35 30 0..2000000..1250
00000050 30 30 30 07 00 31 30 30 30 30 30 30 06 00 36 32 000..1000000..62
00000060 35 30 30 30 06 00 35 30 30 30 30 30 06 00 33 31 5000..500000..31
00000070 32 35 30 30 06 00 32 35 30 30 30 30 06 00 31 35 2500..250000..15
00000080 36 32 35 30 06 00 31 32 35 30 30 30 06 00 37 38 6250..125000..7800000090 31 32 35 30 05 00 36 32 35 30 30 03 00 03 00 01 1250..62500.....
000000A0 00 30 01 00 30 01 00 30 03 00 12 00 08 00 83 58 .0..0..0......ス
000000B0 83 5E 81 5B 83 67 08 00 83 58 83 67 83 62 83 76 タート..ストップ
000000C0 12 00 83 58 83 5E 81 5B 83 67 81 95 83 58 83 67 ..スタート＆スト
000000D0 83 62 83 76 02 00 03 00 01 00 30 01 00 30 02 00 ップ......0..0..
000000E0 10 00 10 00 97 A7 82 BF 89 BA 82 AA 82 E8 83 47 ....立ち下がりエ
000000F0 83 62 83 57 10 00 97 A7 82 BF 8F E3 82 AA 82 E8 ッジ..立ち上がり
00000100 83 47 83 62 83 57 08 00 03 00 01 00 30 01 00 30 エッジ......0..000000110 01 00 30 01 00 30 01 00 30 01 00 30 01 00 30 01 ..0..0..0..0..0.
00000120 00 30 08 00 1C 00 1C 00 83 86 83 6A 83 7C 81 5B .0......ユニポー
00000130 83 89 81 40 82 4F 81 60 82 50 81 44 82 4F 82 51 ラ ０〜１．０２
00000140 82 54 82 75 18 00 83 86 83 6A 83 7C 81 5B 83 89 ５Ｖ..ユニポーラ
00000150 81 40 82 4F 81 60 82 51 81 44 82 54 82 75 14 00
０〜２．５Ｖ..
00000160 83 86 83 6A 83 7C 81 5B 83 89 81 40 82 4F 81 60 ユニポーラ ０〜
00000170 82 54 82 75 16 00 83 86 83 6A 83 7C 81 5B 83 89 ５Ｖ..ユニポーラ
00000180 81 40 82 4F 81 60 82 50 82 4F 82 75 1A 00 83 6F
０〜１０Ｖ..バ00000190 83 43 83 7C 81 5B 83 89 81 40 81 7D 82 50 81 44 イポーラ ±１．
000001A0 82 4F 82 51 82 54 82 75 16 00 83 6F 83 43 83 7C ０２５Ｖ..バイポ
000001B0 81 5B 83 89 81 40 81 7D 82 51 81 44 82 54 82 75 ーラ ±２．５Ｖ000001C0 12 00 83 6F 83 43 83 7C 81 5B 83 89 81 40 81 7D ..バイポーラ ±000001D0 82 54 82 75 14 00 83 6F 83 43 83 7C 81 5B 83 89 ５Ｖ..バイポーラ
000001E0 81 40 81 7D 82 50 82 4F 82 75 02 00 03 00 01 00±１０Ｖ......
000001F0 30 01 00 30 02 00 0A 00 0A 00 83 67 83 8A 83 4B 0..0......トリガ
00000200 8F 6F 97 CD 0A 00 83 67 83 8A 83 4B 93 FC 97 CD 出力..トリガ入力
00000210 02 00 03 00 01 00 30 01 00 30 02 00 0C 00 0C 00 ......0..0......
00000220 83 4E 83 8D 83 62 83 4E 8F 6F 97 CD 0C 00 83 4E クロック出力..ク00000230 83 8D 83 62 83 4E 93 FC 97 CD 02 00 03 00 01 00 ロック入力......
00000240 30 01 00 30 02 00 10 00 10 00 97 A7 82 BF 89 BA 0..0......立ち下00000250 82 AA 82 E8 83 47 83 62 83 57 10 00 97 A7 82 BF がりエッジ..立ち00000260 8F E3 82 AA 82 E8 83 47 83 62 83 57 0E 00 03 00 上がりエッジ....
00000270 01 00 30 01 00 30 01 00 30 01 00 30 01 00 30 01 ..0..0..0..0..0.
00000280 00 30 01 00 30 01 00 30 01 00 30 01 00 30 01 00 .0..0..0..0..0..
00000290 30 01 00 30 01 00 30 01 00 30 0E 00 06 00 02 00 0..0..0..0......
000002A0 36 34 03 00 31 32 38 03 00 32 35 36 03 00 35 31 64..128..256..51
000002B0 32 04 00 31 30 32 34 04 00 32 30 34 38 04 00 34 2..1024..2048..4000002C0 30 39 36 04 00 38 31 39 32 05 00 31 36 33 38 34 096..8192..16384
000002D0 05 00 33 32 37 36 38 05 00 36 35 35 33 36 06 00 ..32768..65536..
000002E0 31 33 31 30 37 32 06 00 32 36 32 31 34 34 06 00 131072..262144..

- 59 -

000002F0
00000300
00000310
00000320
00000330
00000340
00000350
00000360
00000370
00000380
00000390
000003A0000003B0
000003C0000003D0000003E0000003F000000400
00000410
00000420
00000430
00000440
00000450
00000460
00000470
00000480
00000490
000004A0000004B0
000004C0000004D0000004E0000004F000000500
00000510
00000520
00000530

35 32 34 32 38 38 02 00
02 00 10 00 10 00 97 A7
83 47 83 62 83 57 10 00
82 E8 83 47 83 62 83 57
00 30 02 00 0C 00 0C 00
8F 6F 97 CD 0C 00 83 4E
97 CD 02 00 03 00 01 00
0A 00 83 67 83 8A 83 4B
83 8A 83 4B 93 FC 97 CD
00 30 01 00 30 01 00 30
18 00 14 00 83 86 83 6A
82 4F 81 60 82 50 82 75
81 5B 83 89 81 40 82 4F
82 75 14 00 83 86 83 6A
82 4F 81 60 82 54 82 75
81 5B 83 89 81 40 81 7D
83 43 83 7C 81 5B 83 89
82 54 82 75 12 00 83 6F
81 40 81 7D 82 54 82 75
00 30 02 00 10 00 10 00
82 E8 83 47 83 62 83 57
82 AA 82 E8 83 47 83 62
30 01 00 30 01 00 30 03
5E 81 5B 83 67 08 00 83
00 83 58 83 5E 81 5B 83
62 83 76 10 00 03 00 01
01 00 30 01 00 30 01 00
00 30 01 00 30 01 00 30
30 01 00 30 01 00 30 10
48 7A 04 00 38 4D 48 7A
34 4D 48 7A 06 00 32 2E
48 7A 07 00 31 2E 32 35
7A 06 00 36 32 35 6B 48
7A 08 00 33 31 32 2E 35
6B 48 7A 09 00 31 35 36
31 32 35 6B 48 7A 09 00
7A 07 00 36 32 2E 35 6B

03 00 01 00 30 01 00 30
82 BF 89 BA 82 AA 82 E8
97 A7 82 BF 8F E3 82 AA
02 00 03 00 01 00 30 01
83 4E 83 8D 83 62 83 4E
83 8D 83 62 83 4E 93 FC
30 01 00 30 02 00 0A 00
8F 6F 97 CD 0A 00 83 67
06 00 03 00 01 00 30 01
01 00 30 01 00 30 06 00
83 7C 81 5B 83 89 81 40
18 00 83 86 83 6A 83 7C
81 60 82 51 81 44 82 54
83 7C 81 5B 83 89 81 40
12 00 83 6F 83 43 83 7C
82 50 82 75 16 00 83 6F
81 40 81 7D 82 51 81 44
83 43 83 7C 81 5B 83 89
02 00 03 00 01 00 30 01
97 A7 82 BF 89 BA 82 AA
10 00 97 A7 82 BF 8F E3
83 57 03 00 03 00 01 00
00 12 00 08 00 83 58 83
58 83 67 83 62 83 76 12
67 81 95 83 58 83 67 83
00 30 01 00 30 01 00 30
30 01 00 30 01 00 30 01
01 00 30 01 00 30 01 00
00 09 00 05 00 31 30 4D
04 00 35 4D 48 7A 04 00
35 4D 48 7A 04 00 32 4D
4D 48 7A 04 00 31 4D 48
7A 06 00 35 30 30 6B 48
6B 48 7A 06 00 32 35 30
2E 32 35 6B 48 7A 06 00
37 38 2E 31 32 35 6B 48
48 7A

524288......0..0......立ち下がり
エッジ..立ち上がりエッジ......0.
.0......クロック
出力..クロック入力......0..0....
..トリガ出力..ト
リガ入力......0.
.0..0..0..0..0..
....ユニポーラ
０〜１Ｖ..ユニポ
ーラ ０〜２．５
Ｖ..ユニポーラ
０〜５Ｖ..バイポ
ーラ ±１Ｖ..バ
イポーラ ±２．
５Ｖ..バイポーラ±５Ｖ......0.
.0......立ち下がりエッジ..立ち上がりエッジ......
0..0..0......スタ^ート..ストップ.
.スタート＆ストッb プ......0..0..0..0..0..0..0..0.
.0..0..0..0..0..
0..0..0......10M
Hz..8MHz..5MHz..
4MHz..2.5MHz..2M
Hz..1.25MHz..1MHz..625kHz..500kH
z..312.5kHz..250
kHz..156.25kHz..
125kHz..78.125kH
z..62.5kHz‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑
・OptionForm.frm
VERSION 5.00
Begin VB.Form frmOption
BorderStyle= 3 '固定ﾀﾞｲｱﾛｸﾞ
Caption= "オプション"
ClientHeight= 4260ClientLeft= 45
ClientTop= 330
ClientWidth= 6015
Icon= "OptionForm.frx":0000
LinkTopic= "Form1"
MaxButton= 0 'False
MinButton= 0 'False
ScaleHeight= 4260ScaleWidth= 6015ShowInTaskbar = 0 'False
StartUpPosition = 1 'ｵｰﾅｰ ﾌｫｰﾑの中央
Begin VB.Frame Frame1
Caption= "ノイズ低減"
Height= 2175
Left= 3240TabIndex
= 11
Top
= 240
Width
= 2535
Begin VB.TextBox txtMeasureInt
Alignment= 1 '右揃え
Height= 270
Left= 1440
MaxLength= 5
TabIndex
= 16
Top
= 920
Width
= 615
End

- 60 -

Begin VB.TextBox txtMeasureTimes
Alignment= 1 '右揃え
Height= 270
Left= 1440
MaxLength= 5
TabIndex
= 13
Top
= 480
Width
= 615
End
Begin VB.Label Label6
Caption= "秒"
Height= 255
Left= 2160TabIndex
= 18
Top
= 960
Width
= 255
End
Begin VB.Label Label5
Caption= "回"
Height= 255
Left= 2160TabIndex
= 17
Top
= 540
Width
= 255
End
Begin VB.Label Label4
Caption= "インターバル"
Height
= 255
Left
= 240
TabIndex
= 15
Top
= 960
Width
= 1095End
Begin VB.Label Label3
Caption= "測定回数"
Height
= 255
Left
= 360
TabIndex
= 14
Top
= 540
Width
= 735
End
Begin VB.Label Label2
Caption= "指定回数測定し、その平均値を求めることによってノイズによる誤差を低減します。"
Height
= 615
Left
= 240
TabIndex= 12
Top= 1440Width= 2175End
End
Begin VB.CommandButton Command2
Cancel= ‑1 'True
Caption= "キャンセル"
Height= 375
Left= 4560TabIndex= 9
Top= 3720Width= 1215End
Begin VB.CommandButton Command1
Caption= "OK"
Default= ‑1 'True
Height= 375
Left= 3120TabIndex= 8
Top= 3720Width= 1215End
Begin VB.Frame Frame2
Caption= "レジストリのお掃除"
Height
= 975
Left
= 240
TabIndex= 6- 61 -

Top= 2640Width= 2775
Begin VB.CommandButton RegClear
Caption= "設定情報を削除"
Height
= 375
Left
= 360
TabIndex
= 7
Top
= 360
Width
= 1935End
End
Begin VB.Frame frameScale
Caption= "目盛表示"
Height= 2175
Left= 240
TabIndex
= 0
Top
= 240
Width
= 2775
Begin VB.Frame frameCal
BorderStyle= 0 'なし
Height
= 735
Left
= 480
TabIndex
= 3
Top
= 960
Width
= 2055
Begin VB.OptionButton opDa
Caption= "D/A の周波数で計算"
Height
= 255
Left
= 0
TabIndex
= 5
Top
= 480
Width
= 2055End
Begin VB.OptionButton opAd
Caption= "A/D の周波数で計算"
Height
= 255
Left
= 0
TabIndex
= 4
Top
= 120
Value
= ‑1 'True
Width= 2055End
End
Begin VB.OptionButton opTime
Caption= "時間"Height
= 255
Left
= 240
TabIndex
= 2
Top
= 720
Width
= 1215End
Begin VB.OptionButton opSample
Caption= "サンプル数"
Height
= 375
Left
= 240
TabIndex
= 1
Top
= 240
Value
= ‑1 'True
Width= 1695End
Begin VB.Label Label1
Caption= "サンプリング条件を設定しないと変更できません"
BeginProperty Font
Name
= "ＭＳ Ｐゴシック"
Size= 8.25
Charset= 128
Weight= 400
Underline= 0 'False
Italic= 0 'False
Strikethrough = 0 'False
EndProperty
Height
= 300
Left
= 360

- 62 -TabIndex= 10
Top= 1800Width= 2175End
End
End
Attribute VB̲Name = "frmOption"
Attribute VB̲GlobalNameSpace = False
Attribute VB̲Creatable = False
Attribute VB̲PredeclaredId = True
Attribute VB̲Exposed = False
Private Sub Command1̲Click()If opSample.Value = True Then
horiScaleMode = 0
Else
If opAd.Value = True Then
horiScaleMode = 1
horiScaleAd = 1
ElsehoriScaleMode = 1
horiScaleAd = 0
End IfEnd IfIf txtMeasureTimes.Text = "" Then
txtMeasureTimes.Text = "1"
End IfmeasureTimes = Val(txtMeasureTimes.Text)
If txtMeasureInt.Text = "" Then
txtMeasureInt.Text = "0"
End IfmeasureInt = Val(txtMeasureInt.Text)
SaveSetting appName, "Option", "HoriScaleMode", horiScaleMode
SaveSetting appName, "Option", "HoriScaleAd", horiScaleAd
SaveSetting appName, "Option", "MeasureTimes", txtMeasureTimes.Text
SaveSetting appName, "Option", "MeasureInt", txtMeasureInt.Text
If samplingConfFlag = 1 Then
Call DispHoriScale
End If
Unload Me
End Sub
Private Sub Command2̲Click()
Unload Me
End Sub
Private Sub Form̲Load()
If horiScaleMode = 0 Then
opSample.Value = True
opAd.Enabled = False
opDa.Enabled = False
Else
opTime.Value = True
End IfIf horiScaleAd = 1 Then
opAd.Value = True
Else
opDa.Value = True
End IfIf samplingConfFlag = 0 ThenframeScale.Enabled = False
opSample.Enabled = False
opTime.Enabled = False
opAd.Enabled = False
opDa.Enabled = False
Else
If adConfig.fSmplFreq = 0 And daMode.ulExClock = DA̲EXCLK̲IN Then

- 63 -

opTime.Enabled = False
opAd.Enabled = False
opDa.Enabled = False
Else
If adConfig.fSmplFreq = 0 Then
opAd.Enabled = False
Else
opDa.Enabled = False
End IfEnd IfEnd IftxtMeasureTimes.Text = measureTimes
txtMeasureInt.Text = measureInt
End Sub
Private Sub opSample̲Click()If opSample.Value = True Then
opAd.Enabled = False
opDa.Enabled = False
End IfEnd Sub
Private Sub opTime̲Click()If opTime.Value = True Then
opAd.Enabled = True
opDa.Enabled = True
If adConfig.fSmplFreq = 0 And daMode.ulExClock = DA̲EXCLK̲IN Then
opTime.Enabled = False
opAd.Enabled = False
opDa.Enabled = False
Else
If adConfig.fSmplFreq = 0 Then
opAd.Enabled = False
Else
opDa.Enabled = False
End IfEnd IfEnd IfEnd Sub
Private Sub RegClear̲Click()nRet = MsgBox("本当に削除してよろしいですか？", vbDefaultButton2 + vbQuestion + vbYesNo)
If nRet = 7 Then
Exit SubEnd IfOn Error GoTo ErrHandler
DeleteSetting "ADDAFMS"
nRet = MsgBox("削除しました。", vbExclamation + vbOKOnly + vbDefaultButton1)
ErrHandler:
Exit SubEnd Sub
Private Sub txtMeasureTimes̲GotFocus()
txtMeasureTimes.SelStart = 0
txtMeasureTimes.SelLength = Len(txtMeasureTimes.Text)
End Sub
Private Sub txtMeasureInt̲GotFocus()
txtMeasureInt.SelStart = 0
txtMeasureInt.SelLength = Len(txtMeasureInt.Text)
End Sub
Private Sub txtMeasureTimes̲KeyPress(KeyAscii As Integer)
If KeyAscii < Asc(" ") Then
Exit Sub- 64 -

End If
If (KeyAscii < Asc("0") Or KeyAscii > Asc("9")) Then
KeyAscii = 0
End IfEnd Sub
Private Sub txtMeasureInt̲KeyPress(KeyAscii As Integer)
If KeyAscii < Asc(" ") Then
Exit SubEnd IfIf (KeyAscii < Asc("0") Or KeyAscii > Asc("9")) Then
KeyAscii = 0
End IfEnd Sub‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑
・OptionForm.frx
ADDRESS 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F 0123456789ABCDEF‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑
00000000 08 00 00 00 6C 74 00 00 00 00 00 00....lt......
‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑
・OpenDevice.frm
VERSION 5.00
Begin VB.Form frmOpenDevice
BorderStyle= 3 '固定ﾀﾞｲｱﾛｸﾞ
Caption= "デバイスオープン"
ClientHeight= 3885
ClientLeft= 45
ClientTop= 330
ClientWidth= 5145
Icon= "OpenDevice.frx":0000
LinkTopic= "Form1"
MaxButton= 0 'False
MinButton= 0 'False
ScaleHeight= 3885
ScaleWidth= 5145ShowInTaskbar = 0 'False
StartUpPosition = 1 'ｵｰﾅｰ ﾌｫｰﾑの中央
Begin VB.CommandButton cmdClose
Caption= "閉じる"Height= 375
Left= 3600TabIndex= 7
Top= 3360Width= 1335End
Begin VB.CheckBox chkDaAuto
Caption= "起動時自動オープン"
Height= 255
Left= 2520TabIndex= 6
Top= 2640Width= 2295End
Begin VB.CheckBox chkAdAuto
Caption= "起動時自動オープン"
Height= 375
Left= 2520TabIndex= 5
Top= 1200Width= 2175End
Begin VB.TextBox txtDa
Alignment= 2 '中央揃え
BeginProperty Font
Name
= "ＭＳ Ｐゴシック"
Size= 20.25
Charset= 128
Weight= 400- 65 -

Underline= 0 'False
Italic= 0 'False
Strikethrough = 0 'False
EndProperty
Height= 540
Left= 1800
MaxLength= 2
TabIndex
= 2
Text
= "1"
Top
= 1860
Width
= 615
End
Begin VB.TextBox txtAd
Alignment= 2 '中央揃え
BeginProperty Font
Name
= "ＭＳ Ｐゴシック"
Size= 20.25
Charset= 128
Weight= 400
Underline= 0 'False
Italic= 0 'False
Strikethrough = 0 'False
EndProperty
Height= 540
Left= 1800
MaxLength= 2
TabIndex
= 1
Text
= "1"
Top
= 420
Width
= 615
End
Begin VB.CommandButton cmdDaOpen
Caption= "オープン"
Height= 495
Left= 3000TabIndex= 4
Top= 1920Width= 1455End
Begin VB.CommandButton cmdAdOpen
Caption= "オープン"
Height= 495
Left= 3000TabIndex
= 3
Top
= 480
Width
= 1455End
Begin VB.Label Label2
Caption= "FBIDA"
BeginProperty Font
Name
= "ＭＳ Ｐゴシック"
Size= 20.25
Charset= 128
Weight= 400
Underline= 0 'False
Italic= 0 'False
Strikethrough = 0 'False
EndProperty
Height
= 495
Left
= 480
TabIndex= 8
Top= 1920Width= 1335End
Begin VB.Label Label1
Caption= "FBIAD"
BeginProperty Font
Name
= "ＭＳ Ｐゴシック"
Size= 20.25
Charset= 128
Weight= 400
Underline= 0 'False
Italic= 0 'False- 66 -

Strikethrough = 0 'False
EndProperty
Height
= 495
Left
= 480
TabIndex
= 0
Top
= 480
Width
= 1335End
End
Attribute VB̲Name = "frmOpenDevice"
Attribute VB̲GlobalNameSpace = False
Attribute VB̲Creatable = False
Attribute VB̲PredeclaredId = True
Attribute VB̲Exposed = False
Private Sub cmdClose̲Click()
Unload Me
End Sub
Public Sub cmdAdOpen̲Click()
SaveSetting appName, "Open", "AdDevice", txtAd.Text
Call AdOpenSub
End Sub
Public Sub cmdDaOpen̲Click()
SaveSetting appName, "Open", "DaDevice", txtDa.Text
Call DaOpenSub
End Sub
Private Sub Form̲Load()
txtAd.Text = GetSetting(appName, "Open", "AdDevice", 1)
txtDa.Text = GetSetting(appName, "Open", "DaDevice", 1)
chkAdAuto.Value = GetSetting(appName, "Open", "AdAuto", 0)chkDaAuto.Value = GetSetting(appName, "Open", "DaAuto", 0)
End Sub
Private Sub Form̲Unload(Cancel As Integer)
SaveSetting appName, "Open", "AdDevice", txtAd.Text
SaveSetting appName, "Open", "DaDevice", txtDa.Text
SaveSetting appName, "Open", "AdAuto", chkAdAuto.Value
SaveSetting appName, "Open", "DaAuto", chkDaAuto.ValueEnd Sub‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑
・OpenDevice.frx
ADDRESS 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F 0123456789ABCDEF‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑
00000000 08 00 00 00 6C 74 00 00 00 00 00 00....lt......
‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑
・MakeDaData.frm
VERSION 5.00
Begin VB.Form frmMakeDaData
BorderStyle= 3 '固定ﾀﾞｲｱﾛｸﾞ
Caption= "出力波形設定"
ClientHeight= 6435
ClientLeft= 45
ClientTop= 330
ClientWidth= 9870Icon= "MakeDaData.frx":0000
LinkTopic= "Form1"
MaxButton= 0 'False
MinButton= 0 'False
ScaleHeight= 6435
ScaleWidth= 9870ShowInTaskbar = 0 'False
StartUpPosition = 1 'ｵｰﾅｰ ﾌｫｰﾑの中央
Begin VB.ComboBox comboLow
Height= 300
ItemData= "MakeDaData.frx":000C
Left
= 360
List
= "MakeDaData.frx":0019- 67 -

Style= 2 'ﾄﾞﾛｯﾌﾟﾀﾞｳﾝ ﾘｽﾄ
TabIndex= 15
Top= 5520Width= 1095End
Begin VB.ComboBox comboHigh
Height= 300
ItemData= "MakeDaData.frx":003C
Left
= 360
List
= "MakeDaData.frx":0049
Style= 2 'ﾄﾞﾛｯﾌﾟﾀﾞｳﾝ ﾘｽﾄ
TabIndex= 14
Top= 4440Width= 1095End
Begin VB.CommandButton Close
Caption= "閉じる"Height= 495
Left= 8280TabIndex= 13
Top= 5760Width= 1455End
Begin VB.CommandButton WriteData
Caption= "データ書込"
Enabled= 0 'False
Height= 495
Left= 8280TabIndex= 12
Top= 4920Width= 1455End
Begin VB.CommandButton Preview
Caption= "プレビュ"
Height= 495
Left= 8280TabIndex= 11
Top= 4200Width= 1455End
Begin VB.PictureBox Mie2
Appearance= 0 'ﾌﾗｯﾄ
AutoRedraw= ‑1 'True
BackColor= &H00000000&
FillColor= &H0000FF00&
ForeColor= &H00C0C000&
Height= 3375Left= 960
ScaleHeight= 3345
ScaleWidth= 8625
TabIndex= 0
TabStop= 0 'False
Top
= 240
Width
= 8655End
Begin VB.TextBox Text5
Alignment= 1 '右揃え
Height= 270
Left= 6240
MaxLength= 6
TabIndex= 10
Top= 5760Width= 1455End
Begin VB.TextBox Text4
Alignment= 1 '右揃え
Height= 270
Left= 5760
MaxLength= 6
TabIndex= 9Top= 4800Width= 1455End- 68 -

Begin VB.TextBox Text3
Alignment= 1 '右揃え
Height= 270
Left= 3960
MaxLength= 6
TabIndex= 8
Top= 4200Width= 1455End
Begin VB.TextBox Text2
Alignment= 1 '右揃え
Height= 270
Left= 2160
MaxLength= 6
TabIndex= 7
Top= 4800Width= 1455End
Begin VB.TextBox Text1
Alignment= 1 '右揃え
Height= 270
Left= 1680
MaxLength= 6
TabIndex= 6
Top= 5760Width= 1455End
Begin VB.Line Line7
BorderStyle= 3 '点線
X1= 1680X2= 1320
Y1= 5640
Y2= 5640End
Begin VB.Line Line6
BorderStyle= 3 '点線
X1= 1320
X2= 3960
Y1= 4560
Y2= 4560End
Begin VB.Label MesureCenter
Alignment= 1 '右揃え
Caption= "0V"Height
= 255
Left
= 75
TabIndex= 5
Top= 1800
Width
= 855
End
Begin VB.Label MesureDown
Alignment= 1 '右揃え
Caption= "‑10V"
Height
= 255
Left
= 75
TabIndex= 4
Top= 3480
Width
= 855
End
Begin VB.Label MesureUp
Alignment= 1 '右揃え
Caption= "10V"
Height
= 255
Left
= 75
TabIndex
= 3
Top
= 240
Width
= 855
End
Begin VB.Label SampleMax
Alignment= 1 '右揃え
Caption= "1024"
Height= 255
Left= 8640- 69 -TabIndex= 2
Top= 3720Width= 1095End
Begin VB.Label Label1
Caption= "1"
Height
= 255
Left
= 960
TabIndex= 1
Top= 3720
Width
= 135
End
Begin VB.Line Line5
BorderWidth= 2
X1= 6240X2= 7680
Y1= 5640
Y2= 5640End
Begin VB.Line Line4
BorderWidth= 2
X1= 5280X2= 6240
Y1= 4560
Y2= 5640End
Begin VB.Line Line3
BorderWidth= 2
X1= 4080X2= 5280
Y1= 4560
Y2= 4560End
Begin VB.Line Line2
BorderWidth= 2
X1= 4080X2= 3120
Y1= 4560
Y2= 5640End
Begin VB.Line Line1
BorderWidth= 2
X1= 1680X2= 3120
Y1= 5640
Y2= 5640End
End
Attribute VB̲Name = "frmMakeDaData"
Attribute VB̲GlobalNameSpace = False
Attribute VB̲Creatable = False
Attribute VB̲PredeclaredId = True
Attribute VB̲Exposed = False
Private Sub Close̲Click()
SaveSetting appName, "DaData", "1", Text1.Text
SaveSetting appName, "DaData", "2", Text2.Text
SaveSetting appName, "DaData", "3", Text3.Text
SaveSetting appName, "DaData", "4", Text4.Text
SaveSetting appName, "DaData", "5", Text5.Text
SaveSetting appName, "DaData", "comboHigh", comboHigh.ListIndex
SaveSetting appName, "DaData", "comboLow", comboLow.ListIndex
Unload Me
End Sub
Private Sub Form̲Load()
SampleMax.Caption = LTrim(Str(adConfig.ulSmplNum))
Select Case daMode.ModeChReq(0).ulRange
Case DA̲RANGE̲UNIPOLAR- 70 -

MesureDown.Caption = "0V"
MesureUp.Caption = LTrim(Str(daMode.ModeChReq(0).fVolt)) & "V"
MesureCenter.Caption = LTrim(Str(daMode.ModeChReq(0).fVolt / 2)) & "V"
Case DA̲RANGE̲BIPOLAR
MesureCenter.Caption = "0V"
MesureUp.Caption = LTrim(Str(daMode.ModeChReq(0).fVolt)) & "V"
MesureDown.Caption = "‑" & LTrim(Str(daMode.ModeChReq(0).fVolt)) & "V"
End SelectMie2.Line (0, (Mie2.ScaleHeight ‑ 10) / 2)‑(Mie2.ScaleWidth, (Mie2.ScaleHeight ‑ 10) / 2), RGB(255, 255,
255)
Mie2.Line (Mie2.ScaleWidth / 4, 0)‑(Mie2.ScaleWidth / 4, (Mie2.ScaleHeight ‑ 10)), RGB(255, 255, 255)
Mie2.Line (Mie2.ScaleWidth / 4 * 3, 0)‑(Mie2.ScaleWidth / 4 * 3, (Mie2.ScaleHeight ‑ 10)), RGB(255, 255,
255)
Mie2.Line (Mie2.ScaleWidth / 2, 0)‑(Mie2.ScaleWidth / 2, (Mie2.ScaleHeight ‑ 10)), RGB(255, 255, 255)
Text1.Text = GetSetting(appName, "DaData", "1")
Text2.Text = GetSetting(appName, "DaData", "2")
Text3.Text = GetSetting(appName, "DaData", "3")
Text4.Text = GetSetting(appName, "DaData", "4")
Text5.Text = GetSetting(appName, "DaData", "5")comboHigh.ListIndex = GetSetting(appName, "DaData", "comboHigh", 1)
comboLow.ListIndex = GetSetting(appName, "DaData", "comboLow", 0)
End Sub
Private Sub Preview̲Click()Dim nRet As Integer
Dim dataA As Long
Dim dataB As Long
Dim dataC As Long
Dim dataD As Long
Dim dataE As Long
Dim i As Long
Dim num As Long
Dim temp As Single
Dim temp2 As Long
Dim temp3 As Long
Dim upStep As Single
Dim downStep As Single
Dim highPosi As Integer
Dim lowPosi As Integer
Dim volt0 As Single
Dim nowX As Single
Dim nowY As Single
Dim nextY As Single
Dim stepX As Single
Dim stepY As Single
Dim points(524288) As POINTAPI
WriteData.Enabled = False
Preview.Enabled = False'設定値(comboHigh,Low)のチェック
If daMode.ModeChReq(0).ulRange = DA̲RANGE̲UNIPOLAR Then
If comboHigh.ListIndex = 2 Or comboLow.ListIndex = 2 Then
BeepnRet = MsgBox("設定値に誤りがあります", vbExclamation + vbOKOnly)
WriteData.Enabled = False
Preview.Enabled = True
Exit SubEnd IfEnd IfIf comboHigh.ListIndex = comboLow.ListIndex Then
BeepnRet = MsgBox("設定値に誤りがあります", vbExclamation + vbOKOnly)
WriteData.Enabled = False
Preview.Enabled = True
Exit SubEnd If- 71 -

If daMode.ModeChReq(0).ulRange = DA̲RANGE̲UNIPOLAR Then
Erase daDataTemp
Else
For i = 0 To 524288
daDataTemp(i) = 2048
Next iEnd If'各テキストボックスの値を変数へ
dataA = Val(Text1.Text)
dataB = Val(Text2.Text)
dataC = Val(Text3.Text)
dataD = Val(Text4.Text)
dataE = Val(Text5.Text)'データチェック
If dataB = 0 Or dataD = 0 Then
WriteData.Enabled = False
Preview.Enabled = True
Beep
Exit SubEnd If'データチェック
If dataA + dataB + dataC + dataD + dataE > 524288 Then
WriteData.Enabled = False
Preview.Enabled = True
Beep
Exit SubEnd If'highPosi,lowPosi 設定
Select Case comboHigh.ListIndex
Case 0If daMode.ModeChReq(0).ulRange = DA̲RANGE̲UNIPOLAR Then
highPosi = 0
ElsehighPosi = 2048
End If
Case 1highPosi = 4095
Case 2highPosi = 0
End SelectSelect Case comboLow.ListIndex
Case 0If daMode.ModeChReq(0).ulRange = DA̲RANGE̲UNIPOLAR Then
lowPosi = 0
Else
lowPosi = 2048
End If
Case 1
lowPosi = 4095
Case 2
lowPosi = 0
End SelectSelect Case daMode.ModeChReq(0).ulRange
Case DA̲RANGE̲UNIPOLAR
upStep = (highPosi ‑ lowPosi) / dataB
downStep = (highPosi ‑ lowPosi) / dataDnum = 0temp = lowPosi
For i = 1 To dataA
daDataTemp(num) = lowPosi- 72 -

num = num + 1
Next i
For i = 1 To dataB
daDataTemp(num) = temp + upStep
If daDataTemp(num) > 4095 ThendaDataTemp(num) = 4095
End IfIf daDataTemp(num) < 0 ThendaDataTemp(num) = 0
End Iftemp = temp + upStep
num = num + 1
Next i
For i = 1 To dataC
daDataTemp(num) = highPosi
num = num + 1
Next itemp = highPosi
For i = 1 To dataD
daDataTemp(num) = temp ‑ downStep
If daDataTemp(num) < 0 ThendaDataTemp(num) = 0
End IfIf daDataTemp(num) > 4095 ThendaDataTemp(num) = 4095
End Iftemp = temp ‑ downStep
num = num + 1
Next i
For i = 1 To dataE
daDataTemp(num) = lowPosi
num = num + 1
Next iCase DA̲RANGE̲BIPOLAR
upStep = (highPosi ‑ lowPosi) / dataB
downStep = (highPosi ‑ lowPosi) / dataDnum = 0For i = 1 To dataA
daDataTemp(num) = lowPosi
num = num + 1
Next itemp = lowPosi
For i = 1 To dataB
daDataTemp(num) = temp + upStep
If upStep > 0 Then
If daDataTemp(num) > highPosi ThendaDataTemp(num) = highPosi
End IfElse
If daDataTemp(num) < highPosi ThendaDataTemp(num) = highPosi
End IfEnd Iftemp = temp + upStep
num = num + 1
Next i
For i = 1 To dataC
daDataTemp(num) = highPosi
num = num + 1
Next itemp = highPosi- 73 -

For i = 1 To dataD
daDataTemp(num) = temp ‑ downStep
If downStep > 0 Then
If daDataTemp(num) < lowPosi ThendaDataTemp(num) = lowPosi
End IfElse
If daDataTemp(num) > lowPosi ThendaDataTemp(num) = lowPosi
End IfEnd Iftemp = temp ‑ downStep
num = num + 1
Next i
For i = 1 To dataE
daDataTemp(num) = lowPosi
num = num + 1
Next iEnd Select'プレビュ描画
Mie2.Cls
Mie2.Line (0, (Mie2.ScaleHeight ‑ 10) / 2)‑(Mie2.ScaleWidth, (Mie2.ScaleHeight ‑ 10) / 2), RGB(255, 255,
255)
Mie2.Line (Mie2.ScaleWidth / 4, 0)‑(Mie2.ScaleWidth / 4, (Mie2.ScaleHeight ‑ 10)), RGB(255, 255, 255)
Mie2.Line (Mie2.ScaleWidth / 4 * 3, 0)‑(Mie2.ScaleWidth / 4 * 3, (Mie2.ScaleHeight ‑ 10)), RGB(255, 255,
255)
Mie2.Line (Mie2.ScaleWidth / 2, 0)‑(Mie2.ScaleWidth / 2, (Mie2.ScaleHeight ‑ 10)), RGB(255, 255, 255)
volt0 = Mie2.ScaleHeight ‑ 10
nowX = 0
nowY = volt0
stepX = Mie2.ScaleWidth / (adConfig.ulSmplNum ‑ 1)
stepY = volt0 / 4095
For i = 0 To adConfig.ulSmplNum ‑ 1
points(i).Y = volt0 ‑ (daDataTemp(i) * stepY)
points(i).X = nowX
nowX = nowX + stepX
Next iIf adConfig.ulSmplNum < 16384 Then
SetFormToTwips (Mie2.hDC)
j% = Polyline(Mie2.hDC, points(0), adConfig.ulSmplNum)
ResetFormScale (Mie2.hDC)
Else
temp3 = adConfig.ulSmplNum Mod 16383
temp2 = (adConfig.ulSmplNum ‑ temp3) / 16383
For i = 1 To temp2
SetFormToTwips (Mie2.hDC)
j% = Polyline(Mie2.hDC, points((i ‑ 1) * 16383), 16383)
ResetFormScale (Mie2.hDC)
Next iSetFormToTwips (Mie2.hDC)
j% = Polyline(Mie2.hDC, points(16383 * temp2 ‑ 1), temp3 + 1)
ResetFormScale (Mie2.hDC)
End IfWriteData.Enabled = True
Preview.Enabled = True
End Sub
Private Sub Text1̲GotFocus()
Text1.SelStart = 0
Text1.SelLength = Len(Text1.Text)
End Sub- 74 -

Private Sub Text1̲KeyPress(KeyAscii As Integer)
If KeyAscii < Asc(" ") Then
Exit SubEnd IfIf KeyAscii < Asc("0") Or KeyAscii > Asc("9") Then
KeyAscii = 0
End IfEnd Sub
Private Sub Text2̲GotFocus()
Text2.SelStart = 0
Text2.SelLength = Len(Text2.Text)
End Sub
Private Sub Text2̲KeyPress(KeyAscii As Integer)
If KeyAscii < Asc(" ") Then
Exit SubEnd IfIf KeyAscii < Asc("0") Or KeyAscii > Asc("9") Then
KeyAscii = 0
End IfEnd Sub
Private Sub Text3̲GotFocus()
Text3.SelStart = 0
Text3.SelLength = Len(Text3.Text)
End Sub
Private Sub Text3̲KeyPress(KeyAscii As Integer)
If KeyAscii < Asc(" ") Then
Exit SubEnd IfIf KeyAscii < Asc("0") Or KeyAscii > Asc("9") Then
KeyAscii = 0
End IfEnd Sub
Private Sub Text4̲GotFocus()
Text4.SelStart = 0
Text4.SelLength = Len(Text4.Text)
End Sub
Private Sub Text4̲KeyPress(KeyAscii As Integer)
If KeyAscii < Asc(" ") Then
Exit SubEnd IfIf KeyAscii < Asc("0") Or KeyAscii > Asc("9") Then
KeyAscii = 0
End IfEnd Sub
Private Sub Text5̲GotFocus()
Text5.SelStart = 0
Text5.SelLength = Len(Text5.Text)
End Sub
Private Sub Text5̲KeyPress(KeyAscii As Integer)
If KeyAscii < Asc(" ") Then
Exit SubEnd IfIf KeyAscii < Asc("0") Or KeyAscii > Asc("9") Then
KeyAscii = 0
End IfEnd Sub
Private Sub WriteData̲Click()Dim nRet As Long
Dim i As Long
WriteData.Enabled = False
For i = 0 To 524288
daData(i) = daDataTemp(i)Next inRet = DaSetSamplingData(daDeviceHandle, daData(0), adConfig.ulSmplNum)- 75 -

If nRet <> DA̲ERROR̲SUCCESS Then
Erase daData
Call DaDispErrMessage(nRet)
WriteData.Enabled = True
Exit SubEnd IfWriteData.Enabled = True
frmMain.InfoBox.SelStart = Len(frmMain.InfoBox.Text) + 1
frmMain.InfoBox.SelText = vbCrLf & "D/A ‑ サンプリングデータセットＯＫ"
daMakeDataFlag = 1
End Sub‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑
・MakeDaData.frx
ADDRESS 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F 0123456789ABCDEF‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑
00000000 08 00 00 00 6C 74 00 00 00 00 00 00 03 00 03 00 ....lt..........
00000010 01 00 30 01 00 30 01 00 30 03 00 09 00 08 00 30 ..0..0..0......000000020 20 28 5A 65 72 6F 29 08 00 2B 20 28 50 6C 75 73 (Zero)..+ (Plus
00000030 29 09 00 2D 20 28 4D 69 6E 75 73 29 03 00 03 00 )..‑ (Minus)....
00000040 01 00 30 01 00 30 01 00 30 03 00 09 00 08 00 30 ..0..0..0......000000050 20 28 5A 65 72 6F 29 08 00 2B 20 28 50 6C 75 73 (Zero)..+ (Plus
00000060 29 09 00 2D 20 28 4D 69 6E 75 73 29)..‑ (Minus)‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑
・Main.frm
VERSION 5.00
Object = "{F9043C88‑F6F2‑101A‑A3C9‑08002B2F49FB}#1.2#0"; "COMDLG32.OCX"
Begin VB.Form frmMain
Caption= "A/D D/A 高速計測システム"
ClientHeight= 6600ClientLeft= 165
ClientTop= 735
ClientWidth= 10275
Icon= "Main.frx":0000
LinkTopic= "Form1"
ScaleHeight= 6600ScaleWidth= 10275
StartUpPosition = 3 'Windows の既定値
Begin VB.CommandButton OneTimeButton
Caption= "1 回だけ"
BeginProperty Font
Name
= "ＭＳ Ｐゴシック"
Size= 8.25
Charset= 128
Weight= 400
Underline= 0 'False
Italic= 0 'False
Strikethrough = 0 'False
EndProperty
Height= 375
Left= 6360TabIndex= 31
Top= 4680
Width
= 735
End
Begin VB.Timer timerInterval
Enabled= 0 'False
Interval= 1000
Left
= 120
Top
= 3360End
Begin VB.Frame DAView
Caption= "D/A View"
Height= 495
Left= 4440TabIndex= 27
Top= 4560Width= 1815- 76 -

Begin VB.OptionButton opReal
Caption= "Real"Height
= 180
Left
= 960
TabIndex
= 29
Top
= 240
Width
= 735
End
Begin VB.OptionButton opImg
Caption= "Image"
Height
= 180
Left
= 120
TabIndex
= 28
Top
= 240
Value
= ‑1 'True
Width
= 855
End
End
Begin MSComDlg.CommonDialog CommonDialog1
Left
= 120
Top
= 2760̲ExtentX= 847
̲ExtentY= 847
̲Version= 393216
CancelError= ‑1 'True
DefaultExt= ".csv"
Filter= "csv ファイル(*.csv)￨*.csv￨すべてのファイル(*.*)￨*.*"
FilterIndex
= 1
Flags
= 34830End
Begin VB.CommandButton SaveButton
Caption= "セーブ"
Height= 375
Left= 9000TabIndex= 24
Top= 4680Width= 1215End
Begin VB.Frame DrawOption
Caption= "描画モード"
Height= 495
Left= 1920TabIndex= 22
Top= 4560Width= 2415
Begin VB.TextBox DrawOptionLineWidth
Height
= 270
Left
= 760
MaxLength= 1
TabIndex
= 30
Text
= "1"
Top
= 160
Width
= 375
End
Begin VB.CheckBox DrawModeDot
Caption= "Dot"Height= 255
Left= 1320TabIndex
= 26
Top
= 200
Value
= 1 'ﾁｪｯｸ
Width
= 615
End
Begin VB.CheckBox DrawModeLine
Caption= "Line"Height
= 255
Left
= 120
TabIndex
= 25
Top
= 200
Value
= 1 'ﾁｪｯｸ
Width
= 615
End
Begin VB.TextBox DrawOptionDotWidth- 77 -

Height= 270
Left= 1920
MaxLength= 1
TabIndex
= 23
Text
= "5"
Top
= 160
Width
= 375
End
End
Begin VB.PictureBox ViewBoxVV
AutoRedraw= ‑1 'True
BackColor= &H00000000&
Height= 4215Left= 3000ScaleHeight= 4155
ScaleWidth= 4155
TabIndex
= 13
Top
= 0
Visible= 0 'False
Width= 4215End
Begin VB.CommandButton GraphSwitch
Caption= "グラフ切替"
Height
= 375
Left
= 120
TabIndex= 12
Top= 4680Width= 1095End
Begin VB.CommandButton Review
Appearance= 0 'ﾌﾗｯﾄ
Caption= "再描画"BeginProperty Font
Name
= "ＭＳ Ｐゴシック"
Size= 8.25
Charset= 128
Weight= 400
Underline= 0 'False
Italic= 0 'False
Strikethrough = 0 'False
EndProperty
Height= 375
Left= 1200TabIndex= 11
TabStop= 0 'FalseTop= 4680
Width
= 675
End
Begin VB.CommandButton InfoBoxClear
Appearance= 0 'ﾌﾗｯﾄ
Caption= "クリア"BeginProperty Font
Name
= "ＭＳ Ｐゴシック"
Size= 5.25
Charset= 128
Weight= 400
Underline= 0 'False
Italic= 0 'False
Strikethrough = 0 'False
EndProperty
Height
= 130
Left
= 120
TabIndex= 10
TabStop= 0 'False
Top= 6490
Width
= 615
End
Begin VB.CommandButton StopButton
Caption= "ストップ"
BeginProperty Font
Name
= "ＭＳ Ｐゴシック"
Size= 5.25
Charset= 128- 78 -

Weight= 400
Underline= 0 'False
Italic= 0 'False
Strikethrough = 0 'False
EndProperty
Height= 375
Left= 8400TabIndex= 9
Top= 4680
Width
= 495
End
Begin VB.CommandButton StartButton
Caption= "スタート"
Default= ‑1 'True
Height= 375
Left= 7080TabIndex= 2
Top= 4680Width= 1335End
Begin VB.TextBox InfoBox
BackColor= &H00FFFFFF&
CausesValidation= 0 'False
BeginProperty Font
Name
= "ＭＳ ゴシック"
Size= 9Charset= 128
Weight= 400
Underline= 0 'False
Italic= 0 'False
Strikethrough = 0 'False
EndProperty
ForeColor= &H00000000&
Height= 1335Left= 120
Locked= ‑1 'True
MultiLine= ‑1 'True
ScrollBars= 2 '垂直TabIndex= 0
TabStop= 0 'False
Text= "Main.frx":0442
Top= 5160Width= 10095
End
Begin VB.PictureBox ViewBox
AutoRedraw= ‑1 'True
BackColor= &H00000000&
FillColor= &H0000FF00&
ForeColor= &H00C0C000&
Height= 4215Left= 960
ScaleHeight= 4155
ScaleWidth= 9195
TabIndex
= 1
Top
= 0
Width
= 9255End
Begin VB.Label LabelAdMax
Alignment= 1 '右揃え
Caption= "‑‑‑"Height= 255
Left= 2160TabIndex
= 21
Top
= 0
Visible= 0 'False
Width
= 735
End
Begin VB.Label LabelAdMid
Alignment= 1 '右揃え
Caption= "‑‑‑"Height= 255
Left= 2160TabIndex= 20- 79 -

Top= 1920Visible= 0 'False
Width
= 735
End
Begin VB.Label LabelAdMin
Alignment= 1 '右揃え
Caption= "‑‑‑"Height= 255
Left= 2160TabIndex= 19
Top= 4080Visible= 0 'False
Width
= 735
End
Begin VB.Label LabelDaMin
Caption= "‑‑‑"Height= 255
Left= 3000TabIndex= 18
Top= 4200Visible= 0 'False
Width
= 735
End
Begin VB.Label LabelDaMid
Alignment= 2 '中央揃え
Caption= "‑‑‑"Height= 255
Left= 4920TabIndex= 17
Top= 4200Visible= 0 'False
Width
= 735
End
Begin VB.Label LabelDaMax
Alignment= 1 '右揃え
Caption= "‑‑‑"Height= 255
Left= 6480TabIndex= 16
Top= 4200Visible= 0 'False
Width
= 735
End
Begin VB.Label LabelAD
Caption= "A/D[V]"Height= 255
Left= 1560TabIndex
= 15
Top
= 0
Visible= 0 'False
Width
= 615
End
Begin VB.Label LabelDA
Caption= "D/A[V]"Height= 255
Left= 7680TabIndex= 14
Top= 4080Visible= 0 'False
Width
= 615
End
Begin VB.Label MesureMax
Alignment= 1 '右揃え
Caption= "‑‑‑V"
Height
= 255
Left
= 120
TabIndex
= 8
Top
= 0
Width
= 735
End
Begin VB.Label MesureCenter
Alignment= 1 '右揃え
Caption= "‑‑‑V"- 80 -

Height
= 255
Left
= 120
TabIndex= 7
Top= 2040
Width
= 735
End
Begin VB.Label MesureMin
Alignment= 1 '右揃え
Caption= "‑‑‑V"
Height
= 255
Left
= 120
TabIndex= 6
Top= 4080
Width
= 735
End
Begin VB.Label SampleCenter
Alignment= 2 '中央揃え
Caption= "‑‑‑"Height= 255
Left= 4920TabIndex= 5
Top= 4200Width= 1335End
Begin VB.Label SampleMax
Alignment= 1 '右揃え
Caption= "‑‑‑"Height= 255
Left= 8880TabIndex= 4
Top= 4200Width= 1335End
Begin VB.Label SampleMin
Caption= "‑‑‑"Height
= 375
Left
= 960
TabIndex= 3
Top= 4200Width= 1575End
Begin VB.Menu Device
Caption= "デバイス"
Begin VB.Menu Open
Caption= "オープン"
Shortcut= ^O
EndBegin VB.Menu Close
Caption= "クローズ"
Shortcut
= ^C
End
End
Begin VB.Menu Sampling
Caption= "サンプリング条件設定"
End
Begin VB.Menu Output
Caption= "出力波形設定"
End
Begin VB.Menu Option
Caption= "オプション"End
Begin VB.Menu BoardInfo
Caption= "ボード情報"End
Begin VB.Menu Version
Caption= "バージョン情報"
NegotiatePosition= 3 '右EndEndAttribute VB̲Name = "frmMain"
Attribute VB̲GlobalNameSpace = False
Attribute VB̲Creatable = False
Attribute VB̲PredeclaredId = True

- 81 -

Attribute VB̲Exposed = False
Private Sub BoardInfo̲Click()If adOpenFlag = 1 And daOpenFlag = 1 Then
frmInfomation.Show 1
Else
Beep
frmMain.InfoBox.SelStart = Len(frmMain.InfoBox.Text) + 1
frmMain.InfoBox.SelText = vbCrLf & "ボードがオープンされていません"
End IfEnd Sub
Private Sub Close̲Click()frmCloseDevice.Show 1
End Sub

Private Sub DrawModeDot̲Click()
If DrawModeDot.Value = 1 Then
DrawOptionDotWidth.Enabled = True
Else
If DrawModeLine.Value = 0 Then
DrawModeDot.Value = 1
DrawOptionDotWidth.Enabled = True
Else
DrawOptionDotWidth.Enabled = False
End IfEnd IfIf samplingConfFlag = 1 Then
Call DispWave(1)End IfEnd Sub
Private Sub DrawModeLine̲Click()
If DrawModeLine.Value = 1 Then
DrawOptionLineWidth.Enabled = True
Else
If DrawModeDot.Value = 0 Then
DrawModeLine.Value = 1
DrawOptionLineWidth.Enabled = True
Else
DrawOptionLineWidth.Enabled = False
End IfEnd IfIf samplingConfFlag = 1 Then
Call DispWave(1)End IfEnd Sub
Private Sub DrawOptionDotWidth̲Change()
If samplingConfFlag = 1 And Len(DrawOptionDotWidth.Text) <> 0 Then
Call DispWave(1)End IfEnd Sub
Private Sub DrawOptionDotWidth̲KeyPress(KeyAscii As Integer)
If KeyAscii < Asc(" ") Then
Exit SubEnd IfIf (KeyAscii < Asc("1") Or KeyAscii > Asc("9")) Then
KeyAscii = 0
End IfEnd Sub
Private Sub DrawOptionDotWidth̲LostFocus()
If Len(DrawOptionDotWidth.Text) = 0 Then
DrawOptionDotWidth.Text = "5"
End IfEnd Sub
Private Sub DrawOptionLineWidth̲Change()- 82 -

If samplingConfFlag = 1 And Len(DrawOptionLineWidth.Text) <> 0 Then
Call DispWave(1)End IfEnd Sub
Private Sub DrawOptionLineWidth̲KeyPress(KeyAscii As Integer)
If KeyAscii < Asc(" ") Then
Exit SubEnd IfIf (KeyAscii < Asc("1") Or KeyAscii > Asc("9")) Then
KeyAscii = 0
End IfEnd Sub
Private Sub DrawOptionLineWidth̲LostFocus()
If Len(DrawOptionLineWidth.Text) = 0 Then
DrawOptionLineWidth.Text = "1"
End IfEnd Sub
Private Sub GraphSwitch̲Click()
If ViewBox.Visible = True Then
ViewBox.Visible = False
MesureMax.Visible = False
MesureCenter.Visible = False
MesureMin.Visible = False
SampleMin.Visible = False
SampleCenter.Visible = False
SampleMax.Visible = False
ViewBoxVV.Visible = TrueLabelAD.Visible = TrueLabelDA.Visible = TrueLabelDaMin.Visible = TrueLabelDaMid.Visible = TrueLabelDaMax.Visible = TrueLabelAdMin.Visible = TrueLabelAdMid.Visible = TrueLabelAdMax.Visible = True
Else
ViewBox.Visible = True
MesureMax.Visible = True
MesureCenter.Visible = True
MesureMin.Visible = True
SampleMin.Visible = True
SampleCenter.Visible = True
SampleMax.Visible = True
ViewBoxVV.Visible = False
LabelAD.Visible = False
LabelDA.Visible = False
LabelDaMin.Visible = False
LabelDaMid.Visible = False
LabelDaMax.Visible = False
LabelAdMin.Visible = False
LabelAdMid.Visible = False
LabelAdMax.Visible = False
End IfIf samplingConfFlag = 1 Then
Call DispWave(1)End IfEnd Sub
Private Sub InfoBox̲Change()
If LenB(InfoBox.Text) > 10000 Then
InfoBox.Text = ""End IfEnd Sub
Private Sub OneTimeButton̲Click()- 83 -

Dim temp As Integer
temp = measureTimesmeasureTimes = 1
Call StartButton̲ClickmeasureTimes = temp
End Sub
Private Sub opImg̲Click()If samplingConfFlag = 1 Then
Call DispWave(1)End IfEnd Sub
Private Sub opReal̲Click()If samplingConfFlag = 1 Then
Call DispWave(1)End IfEnd Sub
Private Sub Option̲Click()
frmOption.Show 1
End Sub
Private Sub Review̲Click()If samplingConfFlag = 1 Then
Call DispWave(1)End IfEnd Sub
Private Sub SaveButton̲Click()Dim i As LongOn Error GoTo ErrHandler
CommonDialog1.FileName = GetSetting(appName, "Dialog", "Dir")
CommonDialog1.ShowSave
SaveSetting appName, "Dialog", "Dir", CommonDialog1.FileName
Open CommonDialog1.FileName For Output As #1
Print #1, "D/A Range Max," & daVmax
Print #1, "D/A Range Min," & daVmin
Print #1, "A/D Range Max," & adVmax
Print #1, "A/D Range Min," & adVmin
Print #1, "Sampling Points," & adConfig.ulSmplNum
Print #1, "D/A[V],A/D[V],D/A Raw,A/D Raw"
If frmMain.opImg = True Then
For i = 0 To adConfig.ulSmplNum ‑ 1
Print #1, ((daVmax ‑ daVmin) / 4096) * daData(i) + daVmin & "," & ((adVmax ‑ adVmin) / 4096) * adData(i* 2) + adVmin & ̲"," & daData(i) & "," & adData(i * 2)
Next iElse
For i = 0 To adConfig.ulSmplNum ‑ 1
Print #1, ((daVmax ‑ daVmin) / 4096) * adData(i * 2 + 1) + daVmin & "," & ((adVmax ‑ adVmin) / 4096)* adData(i * 2) + adVmin & ̲"," & adData(i * 2 + 1) & ","; adData(i * 2)
Next iEnd If
Close #1
ErrHandler:' キャンセルをクリック
Exit SubEnd Sub
Private Sub StopButton̲Click()nRet = AdStopSampling(adDeviceHandle)
If nRet <> AD̲ERROR̲SUCCESS Then
Call AdDispErrMessage(nRet)
End If- 84 -

DaStopSampling (daDeviceHandle)
If nRet <> DA̲ERROR̲SUCCESS Then
Call DaDispErrMessage(nRet)
End IfstopFlag = 1
End Sub
Private Sub Form̲Load()'２重起動防止
If App.PrevInstance ThenszCaption = Me.Caption
Me.Caption = "dummy"
App.Title = "dummy"
AppActivate szCaption
Unload MeEnd
End IffrmMain.Top = Val(GetSetting(appName, "Window", "Top"))frmMain.Left = Val(GetSetting(appName, "Window", "Left"))frmMain.Height = Val(GetSetting(appName, "Window", "Height"))
frmMain.Width = Val(GetSetting(appName, "Window", "Width"))frmMain.WindowState = Val(GetSetting(appName, "Window", "State"))DrawModeLine.Value = Val(GetSetting(appName, "Option", "Line", 1))
DrawModeDot.Value = Val(GetSetting(appName, "Option", "Dot", 1))
DrawOptionLineWidth.Text = GetSetting(appName, "Option", "LineValue", 5)DrawOptionDotWidth.Text = GetSetting(appName, "Option", "DotValue", 5)
If GetSetting(appName, "Option", "ViewMode", "True") = True Then
opImg.Value = True
Else
opReal.Value = True
End IfhoriScaleMode = Val(GetSetting(appName, "Option", "HoriScaleMode"))horiScaleAd = Val(GetSetting(appName, "Option", "HoriScaleAd"))
Call MoveControls
If Val(GetSetting(appName, "Open", "AdAuto", 0)) = 1 Then
Call AdOpenSub
End IfIf Val(GetSetting(appName, "Open", "DaAuto", 0)) = 1 Then
Call DaOpenSub
End IfmeasureTimes = GetSetting(appName, "Option", "MeasureTimes", 1)
measureInt = GetSetting(appName, "Option", "MeasureInt", 0)
End Sub
Private Sub Form̲QueryUnload(Cancel As Integer, UnloadMode As Integer)
Dim nRet As Integer
nRet = MsgBox("終了してよろしいですか？", vbOKCancel + vbDefaultButton2 + vbExclamation)
If nRet = 2 Then
Cancel = 1
Exit SubEnd IfIf adOpenFlag = 1 Then
AdClose (adDeviceHandle)
End IfIf daOpenFlag = 1 Then
DaClose (daDeviceHandle)
End IfEnd Sub
Private Sub Form̲Resize()If frmMain.WindowState <> 1 Then

- 85 -

If frmMain.Width < 10395 Then frmMain.Width = 10395
If frmMain.Height < 7290 Then frmMain.Height = 7290
Call MoveControls
If samplingConfFlag = 1 Then
Call DispWave(1)End IfEnd IfEnd Sub
Private Sub Form̲Unload(Cancel As Integer)
If adOpenFlag = 1 Then
AdClose (adDeviceHandle)
End IfIf daOpenFlag = 1 Then
DaClose (daDeviceHandle)
End IfIf frmMain.WindowState = 1 ThenfrmMain.WindowState = 0
End If
SaveSetting appName, "Window", "State", frmMain.WindowStateIf frmMain.WindowState = 2 ThenfrmMain.WindowState = 0
End If
SaveSetting appName, "Window", "Top", frmMain.Top
SaveSetting appName, "Window", "Left", frmMain.Left
SaveSetting appName, "Window", "Height", frmMain.Height
SaveSetting appName, "Window", "Width", frmMain.Width
SaveSetting appName, "Option", "Line", DrawModeLine.Value
SaveSetting appName, "Option", "Dot", DrawModeDot.Value
SaveSetting appName, "Option", "LineValue", DrawOptionLineWidth.Text
SaveSetting appName, "Option", "DotValue", DrawOptionDotWidth.Text
SaveSetting appName, "Option", "ViewMode", opImg.ValueEnd Sub
Private Sub InfoBoxClear̲Click()
InfoBox.Text = ""End Sub
Private Sub Open̲Click()
frmOpenDevice.Show 1
End Sub
Private Sub Output̲Click()If samplingConfFlag = 0 ThenBeep
frmMain.InfoBox.SelStart = Len(frmMain.InfoBox.Text) + 1
frmMain.InfoBox.SelText = vbCrLf & "サンプリング条件が未設定です"
Exit SubEnd IffrmMakeDaData.Show 1
End Sub
Private Sub Sampling̲Click()Dim nRet As Long
If adOpenFlag = 0 Or daOpenFlag = 0 ThenBeep
frmMain.InfoBox.SelStart = Len(frmMain.InfoBox.Text) + 1
frmMain.InfoBox.SelText = vbCrLf & "ボードがオープンされていません"
Exit SubEnd IfnRet = AdGetSamplingConfig(adDeviceHandle, adConfig)
If nRet <> AD̲ERROR̲SUCCESS Then
Call AdDispErrMessage(nRet)- 86 -

Exit SubElse
frmMain.InfoBox.SelStart = Len(frmMain.InfoBox.Text) + 1
frmMain.InfoBox.SelText = vbCrLf & "A/D ‑ 現在のサンプリング設定取得ＯＫ"
End IfnRet = DaGetSamplingConfig(daDeviceHandle, daConfig)
If nRet <> DA̲ERROR̲SUCCESS Then
Call DaDispErrMessage(nRet)
Exit SubElse
frmMain.InfoBox.SelStart = Len(frmMain.InfoBox.Text) + 1
frmMain.InfoBox.SelText = vbCrLf & "D/A ‑ 現在のサンプリング設定取得ＯＫ"
End IfnRet = DaGetMode(daDeviceHandle, daMode)If nRet <> DA̲ERROR̲SUCCESS Then
Call DaDispErrMessage(nRet)
Exit SubElse
frmMain.InfoBox.SelStart = Len(frmMain.InfoBox.Text) + 1
frmMain.InfoBox.SelText = vbCrLf & "D/A ‑ 現在の波形出力モード取得ＯＫ"
End IffrmSamplingConf.Show 1
End Sub
Private Sub StartButton̲Click()Dim i As Long
Dim j As Long
Dim k As Long
Dim temp As Long
Dim temp2 As Long
Dim adRealSampleNum As LongOn Error GoTo ErrHandler
stopFlag = 0
If daConfig.ulSmplRepeat = 0 Then
temp2 = 1
Else
temp2 = measureTimes
End If
ReDim adDataTemp(temp2 ‑ 1, adConfig.ulSmplNum * 2)
IntervalTimer = measureInt
frmMain.InfoBox.SelStart = Len(frmMain.InfoBox.Text) + 1
frmMain.InfoBox.SelText = vbCrLf & " " & temp2 & " 回測定を行います"
frmMain.InfoBox.SelStart = Len(frmMain.InfoBox.Text) + 1
frmMain.InfoBox.SelText = vbCrLf & "測定インターバルは " & measureInt & " 秒です"
Do While i < temp2 And stopFlag = 0
hEvent(0) = CreateEvent(0, True, False, 0)nRet = AdSetBoardConfig(adDeviceHandle, hEvent(0), 0, 0)
If nRet <> AD̲ERROR̲SUCCESS Then
Call AdDispErrMessage(nRet)
ResetEvent (hEvent(0))
CloseHandle (hEvent(0))
Exit SubEnd IffrmMain.InfoBox.SelStart = Len(frmMain.InfoBox.Text) + 1- 87 -

frmMain.InfoBox.SelText = vbCrLf & "A/D ‑ ボード条件設定ＯＫ"
ulSmplBufferSize = adConfig.ulSmplNum
hEvent(1) = CreateEvent(0, True, False, 0)nRet = DaSetBoardConfig(daDeviceHandle, ulSmplBufferSize, hEvent(1), 0, 0)
If nRet <> DA̲ERROR̲SUCCESS Then
Call DaDispErrMessage(nRet)
ResetEvent (hEvent(0))
ResetEvent (hEvent(1))
CloseHandle (hEvent(0))
CloseHandle (hEvent(1))
Exit SubEnd IffrmMain.InfoBox.SelStart = Len(frmMain.InfoBox.Text) + 1
frmMain.InfoBox.SelText = vbCrLf & "D/A ‑ ボード条件設定ＯＫ"
StartButton.Enabled = False
OneTimeButton.Enabled = False
nRet = AdStartSampling(adDeviceHandle, AD̲FLAG̲ASYNC)
If nRet <> AD̲ERROR̲SUCCESS Then
Call AdDispErrMessage(nRet)
ResetEvent (hEvent(0))
ResetEvent (hEvent(1))
CloseHandle (hEvent(0))
CloseHandle (hEvent(1))
OneTimeButton.Enabled = True
StartButton.Enabled = True
StartButton.SetFocus
Exit SubEnd IfnRet = DaStartSampling(daDeviceHandle, DA̲FLAG̲ASYNC)
If nRet <> DA̲ERROR̲SUCCESS Then
Call DaDispErrMessage(nRet)
nRet = AdStopSampling(adDeviceHandle)
ResetEvent (hEvent(0))
ResetEvent (hEvent(1))
CloseHandle (hEvent(0))
CloseHandle (hEvent(1))
OneTimeButton.Enabled = True
StartButton.Enabled = True
StartButton.SetFocus
Exit SubEnd IfDo Until (WaitForSingleObject(hEvent(0), 0) = 0 And WaitForSingleObject(hEvent(1), 0) = 0)
DoEvents
Loop
ResetEvent (hEvent(0))
ResetEvent (hEvent(1))
CloseHandle (hEvent(0))
CloseHandle (hEvent(1))
adRealSampleNum = adConfig.ulSmplNum
nRet = AdGetSamplingData(adDeviceHandle, adData(0), adRealSampleNum)
If nRet <> AD̲ERROR̲SUCCESS Then
Call AdDispErrMessage(nRet)
OneTimeButton.Enabled = True
StartButton.Enabled = True
StartButton.SetFocus
Exit SubEnd IfIf adRealSampleNum = 0 ThenfrmMain.InfoBox.SelStart = Len(frmMain.InfoBox.Text) + 1
frmMain.InfoBox.SelText = vbCrLf & "A/D ‑ サンプリングデータ取得失敗"
GoTo ErrHandler2
Else
frmMain.InfoBox.SelStart = Len(frmMain.InfoBox.Text) + 1
frmMain.InfoBox.SelText = vbCrLf & "A/D ‑ サ ン プ リ ン グ デ ー タ 取 得 Ｏ Ｋ ( 取 得 デ ー タ 数 :" &adRealSampleNum & ")"End If
For j = 0 To adRealSampleNum * 2 ‑ 1- 88 -

adDataTemp(i, j) = adData(j)Next ji = i + 1
frmMain.InfoBox.SelStart = Len(frmMain.InfoBox.Text) + 1
frmMain.InfoBox.SelText = vbCrLf & " " & i & " 回目の測定終了"
If i <> temp2 And measureInt <> 0 ThenfrmMain.InfoBox.SelStart = Len(frmMain.InfoBox.Text) + 1
frmMain.InfoBox.SelText = vbCrLf & "インターバル 時間待ち"
frmMain.InfoBox.SelStart = Len(frmMain.InfoBox.Text) + 1
frmMain.InfoBox.SelText = vbCrLf & "あと " & IntervalTimer & " 秒"timerInterval.Enabled = TrueDo Until IntervalTimer = 0
DoEvents
Loop
timerInterval.Enabled = False
IntervalTimer = measureInt
End IfLoop
stopFlag = 0
frmMain.InfoBox.SelStart = Len(frmMain.InfoBox.Text) + 1
frmMain.InfoBox.SelText = vbCrLf & "データ処理中..."DoEvents
For k = 0 To adRealSampleNum * 2
temp = 0
For j = 0 To (i ‑ 1)
temp = temp + adDataTemp(j, k)
Next jadData(k) = temp / i
Next kReDim adDataTemp(0, 0)
j = 0
For k = 0 To adRealSampleNum ‑ 1
j = j + adData(k * 2)
Next kfrmMain.InfoBox.SelStart = Len(frmMain.InfoBox.Text) + 1
frmMain.InfoBox.SelText = "終了"
frmMain.InfoBox.SelStart = Len(frmMain.InfoBox.Text) + 1
frmMain.InfoBox.SelText = vbCrLf & "平均値= " & ((adVmax ‑ adVmin) / 4096) * (j / adRealSampleNum) + adVmin& " [V] , " & j / adRealSampleNum & "[Digital]"
Call DispWave(0)OneTimeButton.Enabled = True
StartButton.Enabled = True
StartButton.SetFocus
Exit Sub
ErrHandler:nRet = MsgBox("エラーが発生しました。メモリ不足かもしれません。" + vbCrLf + "サンプリング件数、測定回数を減らしてみてください。", vbExclamation + vbOKOnly)
ErrHandler2:
OneTimeButton.Enabled = True
StartButton.Enabled = True
StartButton.SetFocus
End Sub
Private Sub MoveControls()- 89 -

Dim realHeight As Long
ViewBox.Move 960, 0, frmMain.ScaleWidth ‑ 1020, frmMain.ScaleHeight ‑ 2385
InfoBox.Move 120, frmMain.ScaleHeight ‑ 1440, frmMain.ScaleWidth ‑ 300, 1335
MesureMin.Move 120, ViewBox.Height ‑ 135
MesureCenter.Move 120, MesureMin.Top / 2
SampleMin.Move 960, ViewBox.Height
SampleCenter.Move ViewBox.Width / 2 + 320, ViewBox.Height
SampleMax.Move ViewBox.Width ‑ 370, ViewBox.Height
StopButton.Move frmMain.ScaleWidth ‑ 1875, InfoBox.Top ‑ 480
StartButton.Move StopButton.Left ‑ 1320, InfoBox.Top ‑ 480
OneTimeButton.Move StartButton.Left ‑ 720, InfoBox.Top ‑ 480
SaveButton.Move StopButton.Left + 600, InfoBox.Top ‑ 480
InfoBoxClear.Move 120, InfoBox.Top + 1330
Review.Move 1200, InfoBox.Top ‑ 480
GraphSwitch.Move 120, InfoBox.Top ‑ 480
ViewBoxVV.Move (frmMain.ScaleWidth ‑ (frmMain.ScaleHeight ‑ 2385)) / 2, 0, frmMain.ScaleHeight ‑ 2385,
frmMain.ScaleHeight ‑ 2385
LabelAD.Move ViewBoxVV.Left ‑ 1440, 0LabelDA.Move ViewBoxVV.Left + ViewBoxVV.Width + 465, ViewBoxVV.Height ‑ 135
LabelDaMin.Move ViewBoxVV.Left, ViewBoxVV.Height + 45
LabelDaMid.Move ViewBoxVV.Left + (ViewBoxVV.Width / 2) ‑ 340, ViewBoxVV.Height + 45
LabelDaMax.Move ViewBoxVV.Left + ViewBoxVV.Width ‑ 735, ViewBoxVV.Height + 45
LabelAdMin.Move ViewBoxVV.Left ‑ 840, ViewBoxVV.Height ‑ 180
LabelAdMid.Move ViewBoxVV.Left ‑ 840, ViewBoxVV.Height / 2 ‑ 100
LabelAdMax.Move ViewBoxVV.Left ‑ 840, 0
DrawOption.Move 1920, InfoBox.Top ‑ 600
DAView.Move 4440, InfoBox.Top ‑ 600'V‑t グラフのライン
realHeight = ViewBox.ScaleHeight ‑ 10
ViewBox.Cls
frmMain.ViewBox.DrawWidth = 1
For i = 1 To 4
ViewBox.Line (0, realHeight / 10 * i)‑(ViewBox.ScaleWidth, realHeight / 10 * i), RGB(100, 100, 100)
Next i
For i = 6 To 9
ViewBox.Line (0, realHeight / 10 * i)‑(ViewBox.ScaleWidth, realHeight / 10 * i), RGB(100, 100, 100)
Next i
For i = 1 To 4
ViewBox.Line (ViewBox.ScaleWidth / 20 * i, 0)‑(ViewBox.ScaleWidth / 20 * i, realHeight), RGB(100, 100, 100)
Next i
For i = 6 To 9
ViewBox.Line (ViewBox.ScaleWidth / 20 * i, 0)‑(ViewBox.ScaleWidth / 20 * i, realHeight), RGB(100, 100, 100)
Next i
For i = 11 To 14
ViewBox.Line (ViewBox.ScaleWidth / 20 * i, 0)‑(ViewBox.ScaleWidth / 20 * i, realHeight), RGB(100, 100, 100)
Next i
For i = 16 To 19
ViewBox.Line (ViewBox.ScaleWidth / 20 * i, 0)‑(ViewBox.ScaleWidth / 20 * i, realHeight), RGB(100, 100, 100)
Next i
ViewBox.Line (0, realHeight / 2)‑(ViewBox.ScaleWidth, realHeight / 2), RGB(255, 255, 255)
ViewBox.Line (ViewBox.ScaleWidth / 4, 0)‑(ViewBox.ScaleWidth / 4, realHeight), RGB(255, 255, 255)
ViewBox.Line (ViewBox.ScaleWidth / 4 * 3, 0)‑(ViewBox.ScaleWidth / 4 * 3, realHeight), RGB(255, 255, 255)
ViewBox.Line (ViewBox.ScaleWidth / 2, 0)‑(ViewBox.ScaleWidth / 2, realHeight), RGB(255, 255, 255)
'V‑V グラフのライン
realHeight = ViewBoxVV.ScaleHeight ‑ 10
ViewBoxVV.Cls
frmMain.ViewBoxVV.DrawWidth = 1
For i = 1 To 4
ViewBoxVV.Line (0, realHeight / 10 * i)‑(ViewBoxVV.ScaleWidth, realHeight / 10 * i), RGB(100, 100, 100)
Next i
For i = 6 To 9
ViewBoxVV.Line (0, realHeight / 10 * i)‑(ViewBoxVV.ScaleWidth, realHeight / 10 * i), RGB(100, 100, 100)
Next i
For i = 1 To 4

- 90 -

ViewBoxVV.Line (ViewBoxVV.ScaleWidth / 10 * i, 0)‑(ViewBoxVV.ScaleWidth / 10 * i, realHeight), RGB(100,100, 100)
Next i
For i = 6 To 9
ViewBoxVV.Line (ViewBoxVV.ScaleWidth / 10 * i, 0)‑(ViewBoxVV.ScaleWidth / 10 * i, realHeight), RGB(100,100, 100)
Next i
ViewBoxVV.Line (0, realHeight / 2)‑(ViewBoxVV.ScaleWidth, realHeight / 2), RGB(255, 255, 255)
ViewBoxVV.Line (ViewBoxVV.ScaleWidth / 2, 0)‑(ViewBoxVV.ScaleWidth / 2, realHeight), RGB(255, 255, 255)
End Sub
Private Sub timerInterval̲Timer()
Dim temp As String
Dim i As Long
Dim j As Long
If stopFlag = 1 Then
IntervalTimer = 0
Exit SubEnd Ifi = Len(frmMain.InfoBox.Text)
j = i
Do Until temp = "あ"j = j ‑ 1
temp = Mid(frmMain.InfoBox.Text, j, 1)
Loop
frmMain.InfoBox.SelStart = j ‑ 1
frmMain.InfoBox.SelLength = i ‑ (j ‑ 1)
IntervalTimer = IntervalTimer ‑ 1
frmMain.InfoBox.SelText = "あと " & IntervalTimer & " 秒"
End Sub
Private Sub Version̲Click()
frmAbout.Show 1
End Sub‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑
・Main.frx
ADDRESS 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F 0123456789ABCDEF‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑
00000000 3E 04 00 00 6C 74 00 00 36 04 00 00 00 00 01 00 >...lt..6.......
00000010 02 00 20 20 10 00 00 00 00 00 E8 02 00 00 26 00 .. ......・..&.
00000020 00 00 10 10 10 00 00 00 00 00 28 01 00 00 0E 03 ..........(.....
00000030 00 00 28 00 00 00 20 00 00 00 40 00 00 00 01 00 ..(... ...@.....
00000040 04 00 00 00 00 00 80 02 00 00 00 00 00 00 00 00 ...............
00000050 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
00000060 80 00 00 80 00 00 00 80 80 00 80 00 00 00 80 00 ..........
00000070 80 00 80 80 00 00 80 80 80 00 C0 C0 C0 00 00 00 ....ﾀﾀﾀ...
00000080 FF 00 00 FF 00 00 00 FF FF 00 FF 00 00 00 FF 00 ..........
00000090 FF 00 FF FF 00 00 FF FF FF 00 00 00 00 00 00 00 ..........
000000A0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
000000B0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
000000C0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
000000D0 00 00 00 00 00 00 00 00 00 00 00 77 77 77 77 77 ...........wwwww
000000E0 77 77 77 77 77 77 77 77 70 00 0F 88 88 88 88 88 wwwwwwwwp..・・・
000000F0 88 88 88 88 88 88 88 88 87 00 0F 88 FF FF FF FF ・・・・..・
00000100 FF FF FF FF FF FF FF F8 87 00 0F 87 00 00 00 00 ..・...
00000110 00 00 00 00 00 00 00 0F 87 00 0F 87 00 20 02 00 ........・.・ ..
00000120 20 02 00 20 02 00 20 0F 87 00 0F 87 02 22 22 22 .. .. .・.・"""
00000130 22 22 22 22 22 22 22 0F 87 00 0F 87 00 20 02 00 """"""".・.・ ..
00000140 20 02 00 20 02 00 20 0F 87 00 0F 87 00 20 02 00 .. .. .・.・ ..
00000150 20 02 00 20 02 00 20 0F 87 00 0F 87 02 22 22 22 .. .. .・.・"""
00000160 22 22 22 22 22 22 22 0F 87 00 0F 87 0F FF 02 00 """"""".・.・..
00000170 20 02 0F FF 02 00 20 0F 87 00 0F 87 00 20 F2 00 .... .・.・ ・00000180 20 02 F0 20 F2 00 20 0F 87 00 0F 87 02 22 2F 22 .・・ .・.・"/"
00000190 22 2F 22 22 2F 22 22 0F 87 00 0F 87 00 20 0F 00 "/""/"".・.・ ..

- 91 -

000001A0
000001B0
000001C0000001D0000001E0
000001F0
00000200
00000210
00000220
00000230
00000240
00000250
00000260
0000027000000280
00000290
000002A0000002B0
000002C0000002D0000002E0000002F000000300
00000310
00000320
00000330
00000340
00000350
00000360
00000370
00000380
00000390
000003A0000003B0
000003C0000003D0000003E0000003F000000400
00000410
00000420
00000430
00000440
00000450
00000460
00000470
00000480
00000490
000004A0000004B0
000004C0000004D0000004E0000004F000000500

20 0F 00 20 0F 00 20 0F
20 F2 00 20 02 F0 20 0F
FF 22 22 22 22 2F FF 0F
20 02 00 20 02 00 20 0F
20 02 00 20 02 00 20 0F
22 22 22 22 22 22 22 0F
20 02 00 20 02 00 20 0F
20 02 00 20 02 00 20 0F
00 00 00 00 00 00 00 0F
77 77 77 77 77 77 77 78
88 88 88 88 88 88 88 88
FF FF FF FF FF FF FF FF
00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00
FF FF FF FF FF FF C0 00
00 01 00 00 00 01 00 00
00 01 00 00 00 01 00 00
00 01 00 00 00 01 00 00
00 01 00 00 00 01 00 00
00 01 00 00 00 01 00 00
00 01 00 00 00 01 80 00
FF FF FF FF FF FF FF FF
00 00 20 00 00 00 01 00
00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00
80 00 80 00 00 00 80 00
80 00 C0 C0 C0 00 00 00
FF 00 FF 00 00 00 FF 00
FF 00 00 00 00 00 00 00
00 00 00 88 88 88 88 88
00 80 0F 02 00 20 02 00
20 80 0F 0F 00 20 0F FF
F0 80 0F 02 F2 22 F2 22
20 80 0F 02 00 20 02 00
20 80 0F 00 00 00 00 00
FF 00 00 00 00 00 00 00
00 00 FF FF 00 00 80 01
00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00
00 00 CC 2D 2D 2D 2D 2D
2D 2D 2D 2D 2D 2D 2D 2D
2D 2D 2D 2D 2D 2D 2D 2D
2D 2D 2D 2D 2D 2D 2D 2D
41 2F 44 20 44 2F 41 20
83 56 83 58 83 65 83 80
20 20 20 20 20 20 20 20
74 20 28 43 29 20 31 39
20 4F 48 41 53 48 49 20
55 54 0D 0A 2D 2D 2D 2D
2D 2D 2D 2D 2D 2D 2D 2D
2D 2D 2D 2D 2D 2D 2D 2D
2D 2D 2D 2D 2D 2D 2D 2D

87 00 0F 87 00 20 02 F0
87 00 0F 87 02 22 22 2F
87 00 0F 87 00 20 02 00
87 00 0F 87 00 20 02 00
87 00 0F 87 02 22 22 22
87 00 0F 87 00 20 02 00
87 00 0F 87 00 20 02 00
87 00 0F 87 00 00 00 00
87 00 0F 88 77 77 77 77
87 00 0F 88 88 88 88 88
87 00 00 FF FF FF FF FF
F0 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00
00 00 FF FF FF FF FF FF
00 07 80 00 00 03 00 00
00 01 00 00 00 01 00 00
00 01 00 00 00 01 00 00
00 01 00 00 00 01 00 00
00 01 00 00 00 01 00 00
00 01 00 00 00 01 00 00
00 03 C0 00 00 07 FF FF
FF FF 28 00 00 00 10 00
04 00 00 00 00 00 C0 00
00 00 00 00 00 00 00 00
80 00 00 80 00 00 00 80
80 00 80 80 00 00 80 80
FF 00 00 FF 00 00 00 FF
FF 00 FF FF 00 00 FF FF
00 00 00 00 00 00 00 00
88 00 0F 00 00 00 00 00
20 80 0F 02 22 22 22 22
20 80 0F 02 F0 20 F2 00
20 80 0F 02 0F FF 02 00
20 80 0F 02 22 22 22 2200 80 0F FF FF FF FF FF
00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00
00 00 80 01 00 00 FF FF
2D 2D 2D 2D 2D 2D 2D 2D
2D 2D 2D 2D 2D 2D 2D 2D
2D 2D 2D 2D 2D 2D 2D 2D
2D 2D 2D 2D 0D 0A 20 20
8D 82 91 AC 8C 76 91 AA
0D 0A 20 20 20 20 20 20
43 6F 70 79 72 69 67 68
39 39 2D 32 30 30 30 2C
4B 65 6E 6A 69 2C 20 4B
2D 2D 2D 2D 2D 2D 2D 2D
2D 2D 2D 2D 2D 2D 2D 2D
2D 2D 2D 2D 2D 2D 2D 2D
2D 2D 2D 2D 2D 0D 0A.. .. .・.・ .・
・ .・.・.・""/
""""/.・.・ ..
.. .. .・.・ ..
.. .. .・.・"""""""""".・.・ ..
.. .. .・.・ ..
.. .. .・.・...
........・.・www
wwwwwwwx・.・・・・・・・..
・......
................
................
................
..........
ﾀ........
................
................
................
................
................
.........ﾀ...(.....
.. ...........ﾀ.
................
.............
........
.ﾀﾀﾀ........
........
...............
...・・・.......
.... .. ..""""
... . ..・・
..・・ .....
... .. ..""""
........
...............
.............
................
................
.............
..ﾌ‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑..
A/D D/A 高速計測システム..
Copyright (C) 1999‑2000,
OHASHI Kenji, K
UT..‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑..

‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑
・Infomation.frm
VERSION 5.00
Begin VB.Form frmInfomation
BorderStyle= 3 '固定ﾀﾞｲｱﾛｸﾞ
Caption= "ボード情報"
ClientHeight= 8160ClientLeft= 45
ClientTop= 330
ClientWidth= 9960Icon= "Infomation.frx":0000
LinkTopic= "Form1"
MaxButton= 0 'False
MinButton= 0 'False
ScaleHeight= 8160ScaleWidth= 9960- 92 -

ShowInTaskbar = 0 'False
StartUpPosition = 1 'ｵｰﾅｰ ﾌｫｰﾑの中央
Begin VB.Frame Frame2
Caption= "FBIDA1"
Height= 3735
Left= 240
TabIndex= 21
Top= 4200Width= 9495
Begin VB.TextBox Text2
Height
= 855
Index
= 0
Left
= 360
Locked= ‑1 'True
MultiLine= ‑1 'True
TabIndex= 23
TabStop= 0 'False
Top= 1320Width= 1695End
Begin VB.TextBox Text2
Height= 2295
Index
= 1
Left
= 3600
Locked= ‑1 'True
MultiLine= ‑1 'True
TabIndex= 22
TabStop= 0 'False
Top= 1080Width= 5055End
Begin VB.Label Label3
Height
= 255
Index
= 7
Left
= 7080TabIndex
= 24
Top
= 360
Width
= 1215End
Begin VB.Label Label1
Caption= "絶縁 :"Height
= 255
Index
= 13
Left
= 6480TabIndex
= 33
Top
= 360
Width
= 1215End
Begin VB.Label Label3
Height
= 255
Index
= 0
Left
= 1320TabIndex
= 30
Top
= 360
Width
= 1215End
Begin VB.Label Label3
Height
= 255
Index
= 1
Left
= 1320TabIndex
= 29
Top
= 720
Width
= 1215End
Begin VB.Label Label3
Height
= 255
Index
= 2
Left
= 2040TabIndex= 28
Top= 2400Width= 1215End
Begin VB.Label Label3- 93 -

Height
=
Index
=
Left
=
TabIndex
=
Top
=
Width
=
End
Begin VB.Label Label3
Height
=
Index
=
Left
=
TabIndex
=
Top
=
Width
=
End
Begin VB.Label Label3
Height
=
Index
=
Left
=
TabIndex
=
Top
=
Width
=
End
Begin VB.Label Label1
Caption=Height
=
Index
=
Left
=
TabIndex
=
Top
=
Width
=
End
Begin VB.Label Label1
Caption=Height
=
Index
=
Left
=
TabIndex
=
Top
=
Width
=
End
Begin VB.Label Label1
Caption=Height
=
Index
=
Left
=
TabIndex
=
Top
=
Width
=
End
Begin VB.Label Label1
Caption=Height
=
Index
=
Left
=
TabIndex
=
Top
=
Width
=
End
Begin VB.Label Label1
Caption=Height
=
Index
=
Left
=
TabIndex
=
Top
=
Width
=
End
Begin VB.Label Label1
Caption=Height
=
Index
=
Left
=

255
4
1680
27
3000
1215
255
5
1680
26
3240
1215
255
6
4440
25
360
1215
"ボード型式 :"
255
19
240
39
360
1215
"識別番号 :"
255
18
240
38
720
1215
"対応サンプリングモード :"
255
17
240
37
1080
1935
"ｻﾝﾌﾟﾘﾝｸﾞﾁｬﾝﾈﾙ数 :"
255
16
240
36
2400
1695
"分解能 :"
255
15
3600
35
360
1215
"対応レンジ :"
255
14
3600

- 94 -TabIndex
= 34
Top
= 840
Width
= 1215End
Begin VB.Label Label1
Caption= "デジタル入力 :"Height
= 255
Index
= 12
Left
= 240
TabIndex= 32
Top= 3000Width= 1215End
Begin VB.Label Label1
Caption= "デジタル出力 :"Height
= 255
Index
= 11
Left
= 240
TabIndex= 31
Top= 3240Width= 1215End
End
Begin VB.Frame Frame1
Caption= "FBIAD1"Height= 3735
Left= 240
TabIndex
= 0
Top
= 120
Width
= 9495
Begin VB.TextBox Text1
Height= 2295
Index
= 1
Left
= 3600
Locked= ‑1 'True
MultiLine= ‑1 'True
TabIndex= 20
TabStop= 0 'False
Top= 1080Width= 5055End
Begin VB.TextBox Text1
Height
= 855
Index
= 0
Left
= 360
Locked= ‑1 'True
MultiLine= ‑1 'True
TabIndex= 11
TabStop= 0 'False
Top= 1320Width= 1695End
Begin VB.Label Label2
Height
= 255
Index
= 7
Left
= 7080TabIndex
= 19
Top
= 360
Width
= 1215End
Begin VB.Label Label2
Height
= 255
Index
= 6
Left
= 4440TabIndex
= 18
Top
= 360
Width
= 1215End
Begin VB.Label Label2
Height
= 255
Index
= 5
Left
= 1680TabIndex= 17- 95 -

Top
=
Width
=
End
Begin VB.Label Label2
Height
=
Index
=
Left
=
TabIndex
=
Top
=
Width
=
End
Begin VB.Label Label2
Height
=
Index
=
Left
=
TabIndex
=
Top
=
Width
=
End
Begin VB.Label Label2
Height
=
Index
=
Left
=
TabIndex
=
Top
=
Width
=
End
Begin VB.Label Label2
Height
=
Index
=
Left
=
TabIndex
=
Top
=
Width
=
End
Begin VB.Label Label2
Height
=
Index
=
Left
=
TabIndex
=
Top
=
Width
=
End
Begin VB.Label Label1
Caption=Height
=
Index
=
Left
=
TabIndex
=
Top
=
Width
=
End
Begin VB.Label Label1
Caption=Height
=
Index
=
Left
=
TabIndex
=
Top
=
Width
=
End
Begin VB.Label Label1
Caption=Height
=
Index
=
Left
=
TabIndex
=
Top
=
Width
=
End
Begin VB.Label Label1
Caption=Height
=

3240
1215
255
4
1680
16
3000
1215
255
3
2040
15
2640
1215
255
2
2040
14
2400
1215
255
1
1320
13
720
1215
255
0
1320
12
360
1215
"差動入力ﾁｬﾝﾈﾙ数 :"
255
9
240
10
2640
1695
"デジタル出力 :"
255
8
240
9
3240
1215
"デジタル入力 :"
255
7
240
8
3000
1215
"絶縁 :"
255- 96 -

Index= 6
Left= 6480TabIndex
= 7
Top
= 360
Width
= 1215End
Begin VB.Label Label1
Caption= "対応レンジ :"Height
= 255
Index
= 5
Left
= 3600TabIndex
= 6
Top
= 840
Width
= 1215End
Begin VB.Label Label1
Caption= "分解能 :"Height
= 255
Index
= 4
Left
= 3600TabIndex
= 5
Top
= 360
Width
= 1215End
Begin VB.Label Label1
Caption= "ｼﾝｸﾞﾙｴﾝﾄﾞﾁｬﾝﾈﾙ数 :"Height
= 255
Index
= 3
Left
= 240
TabIndex= 4
Top= 2400Width= 1695End
Begin VB.Label Label1
Caption= "対応サンプリングモード :"Height
= 255
Index
= 2
Left
= 240
TabIndex= 3
Top= 1080Width= 1935End
Begin VB.Label Label1
Caption= "識別番号 :"Height
= 255
Index
= 1
Left
= 240
TabIndex
= 2
Top
= 720
Width
= 1215End
Begin VB.Label Label1
Caption= "ボード型式 :"Height
= 255
Index
= 0
Left
= 240
TabIndex
= 1
Top
= 360
Width
= 1215End
End
End
Attribute VB̲Name = "frmInfomation"
Attribute VB̲GlobalNameSpace = False
Attribute VB̲Creatable = False
Attribute VB̲PredeclaredId = True
Attribute VB̲Exposed = False
Private Sub Form̲Load()'A/D ボードについて'ボード型番Label2(0).Caption = "PCI‑" & Str(adInfo.ulBoardType)- 97 -

'ボード識別番号
Label2(1).Caption = Str(adInfo.ulBoardID)'サンプリングモード
If adInfo.dwSamplingMode And &H1 Then
Text1(0).Text = Text1(0).Text & "I/O 方式" & vbCrLf
End IfIf adInfo.dwSamplingMode And &H2 Then
Text1(0).Text = Text1(0).Text & "FIFO 方式" & vbCrLf
End IfIf adInfo.dwSamplingMode And &H4 Then
Text1(0).Text = Text1(0).Text & "メモリ方式"
End If'シングルエンドチャンネル数
Label2(2).Caption = Str(adInfo.ulChCountS)'作動入力チャンネル数
Label2(3).Caption = Str(adInfo.ulChCountD)'デジタル入力
Label2(4).Caption = Str(adInfo.ulDi)'デジタル出力
Label2(5).Caption = Str(adInfo.ulDo)'分解能Label2(6).Caption = Str(adInfo.ulResolution) & " bit"
'絶縁
If adInfo.ulIsolation = AD̲ISOLATION Then
Label2(7).Caption = "ON"Else
Label2(7).Caption = "OFF"End If'レンジ
If adInfo.dwRange And &H1 Then
Text1(1).Text = Text1(1).Text & "電圧
End IfIf adInfo.dwRange And &H2 Then
Text1(1).Text = Text1(1).Text & "電圧
End IfIf adInfo.dwRange And &H4 Then
Text1(1).Text = Text1(1).Text & "電圧
End IfIf adInfo.dwRange And &H8 Then
Text1(1).Text = Text1(1).Text & "電圧
End IfIf adInfo.dwRange And &H10 Then
Text1(1).Text = Text1(1).Text & "電圧
End IfIf adInfo.dwRange And &H1000 Then
Text1(1).Text = Text1(1).Text & "電流End IfIf adInfo.dwRange And &H2000 Then
Text1(1).Text = Text1(1).Text & "電流End IfIf adInfo.dwRange And &H10000 Then
Text1(1).Text = Text1(1).Text & "電圧
End IfIf adInfo.dwRange And &H20000 Then
Text1(1).Text = Text1(1).Text & "電圧
End IfIf adInfo.dwRange And &H40000 Then
Text1(1).Text = Text1(1).Text & "電圧
End IfIf adInfo.dwRange And &H80000 Then
Text1(1).Text = Text1(1).Text & "電圧
End If

ユニポーラ 0〜1V" & vbCrLf
ユニポーラ 0〜2.5V" & vbCrLf
ユニポーラ 0〜5V" & vbCrLf
ユニポーラ 0〜10V" & vbCrLf
ユニポーラ 1〜5V" & vbCrLf
ユニポーラ 0〜20mA" & vbCrLf
ユニポーラ 4〜20mA" & vbCrLf
バイポーラ ±1V" & vbCrLf
バイポーラ ±2.5V" & vbCrLf
バイポーラ ±5V" & vbCrLf
バイポーラ ±10V" & vbCrLf'D/A ボードについて- 98 -

'ボード型番
Label3(0).Caption = "PCI‑" & Str(daInfo.ulBoardType)'ボード識別番号
Label3(1).Caption = Str(daInfo.ulBoardID)'サンプリングモード
If daInfo.ulSamplingMode And &H1 Then
Text2(0).Text = Text2(0).Text & "I/O 方式" & vbCrLf
End IfIf daInfo.ulSamplingMode And &H2 Then
Text2(0).Text = Text2(0).Text & "FIFO 方式" & vbCrLf
End IfIf daInfo.ulSamplingMode And &H4 Then
Text2(0).Text = Text2(0).Text & "メモリ方式"
End If'サンプリングチャンネル数
Label3(2).Caption = Str(daInfo.ulChCount)'デジタル入力
Label3(4).Caption = Str(daInfo.ulDi)'デジタル出力
Label3(5).Caption = Str(daInfo.ulDo)'分解能Label3(6).Caption = Str(daInfo.ulResolution) & " bit"
'絶縁
If daInfo.ulIsolation = DA̲ISOLATION Then
Label3(7).Caption = "ON"Else
Label3(7).Caption = "OFF"End If'レンジ
If daInfo.ulRange And &H1 Then
Text2(1).Text = Text2(1).Text & "電圧
End IfIf daInfo.ulRange And &H2 Then
Text2(1).Text = Text2(1).Text & "電圧
End IfIf daInfo.ulRange And &H4 Then
Text2(1).Text = Text2(1).Text & "電圧
End IfIf daInfo.ulRange And &H8 Then
Text2(1).Text = Text2(1).Text & "電圧
End IfIf daInfo.ulRange And &H10 Then
Text2(1).Text = Text2(1).Text & "電圧
End IfIf daInfo.ulRange And &H1000 Then
Text2(1).Text = Text2(1).Text & "電流End IfIf daInfo.ulRange And &H2000 Then
Text2(1).Text = Text2(1).Text & "電流End IfIf daInfo.ulRange And &H10000 Then
Text2(1).Text = Text2(1).Text & "電圧
End IfIf daInfo.ulRange And &H20000 Then
Text2(1).Text = Text2(1).Text & "電圧
End IfIf daInfo.ulRange And &H40000 Then
Text2(1).Text = Text2(1).Text & "電圧
End IfIf daInfo.ulRange And &H80000 Then
Text2(1).Text = Text2(1).Text & "電圧
End If

ユニポーラ 0〜1V" & vbCrLf
ユニポーラ 0〜2.5V" & vbCrLf
ユニポーラ 0〜5V" & vbCrLf
ユニポーラ 0〜10V" & vbCrLf
ユニポーラ 1〜5V" & vbCrLf
ユニポーラ 0〜20mA" & vbCrLf
ユニポーラ 4〜20mA" & vbCrLf
バイポーラ ±1V" & vbCrLf
バイポーラ ±2.5V" & vbCrLf
バイポーラ ±5V" & vbCrLf
バイポーラ ±10V" & vbCrLf

End Sub- 99 -

‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑
・Infomation.frx
ADDRESS 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F 0123456789ABCDEF‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑
00000000 08 00 00 00 6C 74 00 00 00 00 00 00....lt......
‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑
・frmSplash.frm
VERSION 5.00
Begin VB.Form frmSplash
BorderStyle= 3 '固定ﾀﾞｲｱﾛｸﾞ
ClientHeight= 4245
ClientLeft= 255
ClientTop= 1410ClientWidth= 7380
ClipControls= 0 'False
ControlBox= 0 'False
Icon= "frmSplash.frx":0000
KeyPreview= ‑1 'True
LinkTopic= "Form2"
MaxButton= 0 'False
MinButton= 0 'False
ScaleHeight= 4245
ScaleWidth= 7380ShowInTaskbar = 0 'False
StartUpPosition = 2 '画面の中央
Begin VB.Frame Frame1
Height= 4050
Left= 150
TabIndex
= 0
Top
= 60
Width
= 7080
Begin VB.Timer Timer1
Interval= 1500
Left
= 840
Top
= 3360End
Begin VB.Label Label1
Caption= "A/D D/A Fast Measuring System"
Height= 255
Left= 3120TabIndex= 6
Top= 2280Width= 3615End
Begin VB.Image imgLogo
Height= 1905Left= 360
Picture= "frmSplash.frx":000C
Stretch= ‑1 'TrueTop= 1080Width= 1815End
Begin VB.Label lblWarning
Alignment= 1 '右揃え
Caption= "Copyright (C) 1999‑2000, OHASHI Kenji"
Height
= 195
Left
= 150
TabIndex= 2
Top= 3660Width= 6615End
Begin VB.Label lblVersion
Alignment= 1 '右揃え
AutoSize= ‑1 'True
Caption= "ﾊﾞｰｼﾞｮﾝ"
BeginProperty Font
Name
= "ＭＳ Ｐゴシック"
Size
= 12
Charset= 128
Weight= 700- 100 -

Underline= 0 'False
Italic= 0 'False
Strikethrough = 0 'False
EndProperty
Height= 285
Left= 4440TabIndex= 3
Top= 2880Width= 1605End
Begin VB.Label lblProductName
AutoSize= ‑1 'True
Caption= "ADDAFMS"
BeginProperty Font
Name
= "ＭＳ Ｐゴシック"
Size= 32.25
Charset= 128
Weight= 700
Underline= 0 'False
Italic= 0 'False
Strikethrough = 0 'False
EndProperty
Height= 645
Left= 3120TabIndex= 5
Top= 1680Width= 3000End
Begin VB.Label lblLicenseTo
Alignment= 1 '右揃え
Caption= "高知工科大学 電子・光システム工学科 河津研究室"
Height
= 255
Left
= 120
TabIndex
= 1
Top
= 240
Width
= 6855End
Begin VB.Label lblCompanyProductAutoSize= ‑1 'True
Caption= "Kochi Univ. of Tech"
BeginProperty Font
Name
= "ＭＳ Ｐゴシック"
Size
= 18
Charset= 128
Weight= 700
Underline= 0 'False
Italic= 0 'False
Strikethrough = 0 'False
EndProperty
Height= 360
Left= 2520TabIndex= 4
Top= 1200Width= 3195End
End
End
Attribute VB̲Name = "frmSplash"
Attribute VB̲GlobalNameSpace = False
Attribute VB̲Creatable = False
Attribute VB̲PredeclaredId = True
Attribute VB̲Exposed = False
Option Explicit
Private Sub Form̲Load()lblVersion.Caption = "Ver. " & App.Major & "." & App.Minor & "." & App.Revision
End Sub
Private Sub Timer1̲Timer()
Timer1.Enabled = False
Timetimer = 1- 101 -

End Sub‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑
・frmSplash.frx
ADDRESS 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F 0123456789ABCDEF‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑
00000000 08 00 00 00 6C 74 00 00 00 00 00 00 3E 04 00 00 ....lt......>...
00000010 6C 74 00 00 36 04 00 00 00 00 01 00 02 00 20 20 lt..6.........
00000020 10 00 00 00 00 00 E8 02 00 00 26 00 00 00 10 10 ......・..&.....
00000030 10 00 00 00 00 00 28 01 00 00 0E 03 00 00 28 00 ......(.......(.
00000040 00 00 20 00 00 00 40 00 00 00 01 00 04 00 00 00 .. ...@.........
00000050 00 00 80 02 00 00 00 00 00 00 00 00 00 00 00 00 ...............
00000060 00 00 00 00 00 00 00 00 00 00 00 00 80 00 00 80 ..............
00000070 00 00 00 80 80 00 80 00 00 00 80 00 80 00 80 80 .........
00000080 00 00 80 80 80 00 C0 C0 C0 00 00 00 FF 00 00 FF ...ﾀﾀﾀ.....
00000090 00 00 00 FF FF 00 FF 00 00 00 FF 00 FF 00 FF FF .........
000000A0 00 00 FF FF FF 00 00 00 00 00 00 00 00 00 00 00 .............
000000B0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
000000C0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
000000D0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
000000E0 00 00 00 00 00 00 00 77 77 77 77 77 77 77 77 77 .......wwwwwwwww
000000F0 77 77 77 77 70 00 0F 88 88 88 88 88 88 88 88 88 wwwwp..・・・・・
00000100 88 88 88 88 87 00 0F 88 FF FF FF FF FF FF FF FF ・・..・
00000110 FF FF FF F8 87 00 0F 87 00 00 00 00 00 00 00 00 ..・.......
00000120 00 00 00 0F 87 00 0F 87 00 20 02 00 20 02 00 20 ....・.・ .. ..
00000130 02 00 20 0F 87 00 0F 87 02 22 22 22 22 22 22 22 .. .・.・"""""""
00000140 22 22 22 0F 87 00 0F 87 00 20 02 00 20 02 00 20 """.・.・ .. ..
00000150 02 00 20 0F 87 00 0F 87 00 20 02 00 20 02 00 20 .. .・.・ .. ..
00000160 02 00 20 0F 87 00 0F 87 02 22 22 22 22 22 22 22 .. .・.・"""""""
00000170 22 22 22 0F 87 00 0F 87 0F FF 02 00 20 02 0F FF """.・.・.. ..
00000180 02 00 20 0F 87 00 0F 87 00 20 F2 00 20 02 F0 20 .. .・.・ ・ .・
00000190 F2 00 20 0F 87 00 0F 87 02 22 2F 22 22 2F 22 22 ・ .・.・"/""/""
000001A0 2F 22 22 0F 87 00 0F 87 00 20 0F 00 20 0F 00 20 /"".・.・ .. ..
000001B0 0F 00 20 0F 87 00 0F 87 00 20 02 F0 20 F2 00 20 .. .・.・ .・・
000001C0 02 F0 20 0F 87 00 0F 87 02 22 22 2F FF 22 22 22 .・.・.・""/"""
000001D0 22 2F FF 0F 87 00 0F 87 00 20 02 00 20 02 00 20 "/.・.・ .. ..
000001E0 02 00 20 0F 87 00 0F 87 00 20 02 00 20 02 00 20 .. .・.・ .. ..
000001F0 02 00 20 0F 87 00 0F 87 02 22 22 22 22 22 22 22 .. .・.・"""""""
00000200 22 22 22 0F 87 00 0F 87 00 20 02 00 20 02 00 20 """.・.・ .. ..
00000210 02 00 20 0F 87 00 0F 87 00 20 02 00 20 02 00 20 .. .・.・ .. ..
00000220 02 00 20 0F 87 00 0F 87 00 00 00 00 00 00 00 00 .. .・.・.......
00000230 00 00 00 0F 87 00 0F 88 77 77 77 77 77 77 77 77 ....・.・wwwwwww
00000240 77 77 77 78 87 00 0F 88 88 88 88 88 88 88 88 88 wwwx・.・・・・・
00000250 88 88 88 88 87 00 00 FF FF FF FF FF FF FF FF FF ・・..
00000260 FF FF FF FF F0 00 00 00 00 00 00 00 00 00 00 00 ・..........
00000270 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
00000280 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
00000290 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
000002A0 00 00 00 00 00 00 FF FF FF FF FF FF FF FF FF FF ......
000002B0 FF FF C0 00 00 07 80 00 00 03 00 00 00 01 00 00 ﾀ............
000002C0 00 01 00 00 00 01 00 00 00 01 00 00 00 01 00 00 ................
000002D0 00 01 00 00 00 01 00 00 00 01 00 00 00 01 00 00 ................
000002E0 00 01 00 00 00 01 00 00 00 01 00 00 00 01 00 00 ................
000002F0 00 01 00 00 00 01 00 00 00 01 00 00 00 01 00 00 ................
00000300 00 01 00 00 00 01 00 00 00 01 00 00 00 01 00 00 ................
00000310 00 01 80 00 00 03 C0 00 00 07 FF FF FF FF FF FF .....ﾀ...
00000320 FF FF FF FF FF FF 28 00 00 00 10 00 00 00 20 00 (....... .
00000330 00 00 01 00 04 00 00 00 00 00 C0 00 00 00 00 00 ..........ﾀ.....
00000340 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
00000350 00 00 00 00 80 00 00 80 00 00 00 80 80 00 80 00 ...........
00000360 00 00 80 00 80 00 80 80 00 00 80 80 80 00 C0 C0 .......ﾀﾀ
00000370 C0 00 00 00 FF 00 00 FF 00 00 00 FF FF 00 FF 00 ﾀ..........
00000380 00 00 FF 00 FF 00 FF FF 00 00 FF FF FF 00 00 00 .........
00000390 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 88 ...............・
000003A0 88 88 88 88 88 00 0F 00 00 00 00 00 00 80 0F 02 ・・・.........
000003B0 00 20 02 00 20 80 0F 02 22 22 22 22 20 80 0F 0F . .. .."""" ..
000003C0 00 20 0F FF 20 80 0F 02 F0 20 F2 00 F0 80 0F 02 . . ..・・..
000003D0 F2 22 F2 22 20 80 0F 02 0F FF 02 00 20 80 0F 02 ・・ ..... ..
000003E0 00 20 02 00 20 80 0F 02 22 22 22 22 20 80 0F 00 . .. .."""" ..
000003F0 00 00 00 00 00 80 0F FF FF FF FF FF FF 00 00 00 .........
00000400 00 00 00 00 00 00 00 00 00 00 00 00 00 00 FF FF ..............
00000410 00 00 80 01 00 00 00 00 00 00 00 00 00 00 00 00 ...............

- 102 -

00000420 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
00000430 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
00000440 00 00 00 00 00 00 80 01 00 00 FF FF 00 00...........
‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑
・frmAbout.frm
VERSION 5.00
Begin VB.Form frmAbout
BorderStyle= 3 '固定ﾀﾞｲｱﾛｸﾞ
Caption= "ﾊﾞｰｼﾞｮﾝ情報"
ClientHeight= 2625
ClientLeft= 2340ClientTop= 1935
ClientWidth= 5880
ClipControls= 0 'False
Icon= "frmAbout.frx":0000
LinkTopic= "Form2"
MaxButton= 0 'False
MinButton= 0 'False
ScaleHeight= 1811.822
ScaleMode= 0 'ﾕｰｻﾞｰ
ScaleWidth= 5521.624
ShowInTaskbar = 0 'False
StartUpPosition = 1 'ｵｰﾅｰ ﾌｫｰﾑの中央
Begin VB.PictureBox picIcon
AutoSize= ‑1 'True
ClipControls= 0 'False
Height
= 540
Left
= 240
Picture= "frmAbout.frx":000C
ScaleHeight= 337.12
ScaleMode= 0 'ﾕｰｻﾞｰ
ScaleWidth= 337.12
TabIndex
= 1
Top
= 240
Width
= 540
End
Begin VB.CommandButton cmdOK
Cancel= ‑1 'True
Caption= "OK"
Default= ‑1 'True
Height= 705
Left= 4440TabIndex= 0Top= 1800Width= 1380End
Begin VB.Label Label4
Caption= "バグがちょこっと残っていますが気にせずに(^̲^;"
BeginProperty Font
Name
= "ＭＳ Ｐゴシック"
Size= 8.25
Charset= 128
Weight= 400
Underline= 0 'False
Italic= 0 'False
Strikethrough = 0 'False
EndProperty
Height
= 255
Left
= 600
TabIndex= 8
Top= 2400Width= 3495End
Begin VB.Label Label3
Caption= "Kochi Univ. of Tech"
BeginProperty Font
Name
= "ＭＳ Ｐゴシック"
Size
= 12
Charset= 128
Weight= 400
Underline= 0 'False- 103 -

Italic= 0 'False
Strikethrough = 0 'False
EndProperty
Height= 255
Left= 1320TabIndex
= 7
Top
= 120
Width
= 2775End
Begin VB.Label Label2
Alignment= 2 '中央揃え
Caption= "高知工科大学 電子・光システム工学科
Height
= 255
Left
= 165
TabIndex= 6
Top= 1800Width= 4095End
Begin VB.Label Label1
Caption= "A/D D/A Fast Measuring System"
Height= 255
Left= 1920TabIndex
= 5
Top
= 840
Width
= 3255End
Begin VB.Line Line1
BorderColor= &H00808080&
BorderStyle= 6 '実線 (ふちどり)
Index
= 1
X1
= 84.515
X2= 5408.938
Y1= 1024.974
Y2= 1024.974
End
Begin VB.Label lblTitle
Caption= "ADDAFMS"
BeginProperty Font
Name
= "ＭＳ Ｐゴシック"
Size
= 24
Charset= 128
Weight= 400
Underline= 0 'False
Italic= ‑1 'True
Strikethrough = 0 'False
EndProperty
ForeColor= &H00000000&
Height= 480
Left= 1920TabIndex
= 3
Top
= 360
Width
= 2325End
Begin VB.Line Line1
BorderColor= &H00FFFFFF&
BorderWidth
= 2
Index
= 0
X1
= 98.6
X2= 5408.938
Y1= 1035.327
Y2= 1035.327
End
Begin VB.Label lblVersion
Caption= "ﾊﾞｰｼﾞｮﾝ"
BeginProperty Font
Name
= "ＭＳ Ｐゴシック"
Size= 9.75
Charset= 128
Weight= 400
Underline= 0 'False
Italic= 0 'False
Strikethrough = 0 'False
EndProperty- 104 -

河津研究室"

Height= 225
Left= 3600TabIndex= 4
Top= 1080Width= 1965End
Begin VB.Label lblDisclaimer
Caption= "Copyright (C) 1999‑2000, OHASHI Kenji, KUT"
ForeColor= &H00000000&
Height
= 345
Left
= 480
TabIndex= 2
Top= 2040Width= 3735End
End
Attribute VB̲Name = "frmAbout"Attribute VB̲GlobalNameSpace = False
Attribute VB̲Creatable = False
Attribute VB̲PredeclaredId = True
Attribute VB̲Exposed = False
Option Explicit
Private Sub cmdOK̲Click()
Unload Me
End Sub
Private Sub Form̲Load()
Me.Caption = App.Title & "のバージョン情報"lblVersion.Caption = "Version " & App.Major & "." & App.Minor & "." & App.Revision
End Sub‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑
・frmAbout.frx
ADDRESS 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F 0123456789ABCDEF‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑
00000000 08 00 00 00 6C 74 00 00 00 00 00 00 3E 04 00 00 ....lt......>...
00000010 6C 74 00 00 36 04 00 00 00 00 01 00 02 00 20 20 lt..6.........
00000020 10 00 00 00 00 00 E8 02 00 00 26 00 00 00 10 10 ..........&.....
00000030 10 00 00 00 00 00 28 01 00 00 0E 03 00 00 28 00 ......(.......(.
00000040 00 00 20 00 00 00 40 00 00 00 01 00 04 00 00 00 .. ...@.........
00000050 00 00 80 02 00 00 00 00 00 00 00 00 00 00 00 00 ................
00000060 00 00 00 00 00 00 00 00 00 00 00 00 80 00 00 80 ................
00000070 00 00 00 80 80 00 80 00 00 00 80 00 80 00 80 80 ................
00000080 00 00 80 80 80 00 C0 C0 C0 00 00 00 FF 00 00 FF ................
00000090 00 00 00 FF FF 00 FF 00 00 00 FF 00 FF 00 FF FF ................
000000A0 00 00 FF FF FF 00 00 00 00 00 00 00 00 00 00 00 ................
000000B0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
000000C0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
000000D0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
000000E0 00 00 00 00 00 00 00 77 77 77 77 77 77 77 77 77 .......wwwwwwwww
000000F0 77 77 77 77 70 00 0F 88 88 88 88 88 88 88 88 88 wwwwp...........
00000100 88 88 88 88 87 00 0F 88 FF FF FF FF FF FF FF FF ...............
00000110 FF FF FF F8 87 00 0F 87 00 00 00 00 00 00 00 00 ................
00000120 00 00 00 0F 87 00 0F 87 00 20 02 00 20 02 00 20 ......... .. ..
00000130 02 00 20 0F 87 00 0F 87 02 22 22 22 22 22 22 22 .. ......"""""""
00000140 22 22 22 0F 87 00 0F 87 00 20 02 00 20 02 00 20 """...... .. ..
00000150 02 00 20 0F 87 00 0F 87 00 20 02 00 20 02 00 20 .. ...... .. ..
00000160 02 00 20 0F 87 00 0F 87 02 22 22 22 22 22 22 22 .. ......"""""""
00000170 22 22 22 0F 87 00 0F 87 0F FF 02 00 20 02 0F FF """......... ...
00000180 02 00 20 0F 87 00 0F 87 00 20 F2 00 20 02 F0 20 .. ...... .. ..
00000190 F2 00 20 0F 87 00 0F 87 02 22 2F 22 22 2F 22 22 .. ......"/""/""
000001A0 2F 22 22 0F 87 00 0F 87 00 20 0F 00 20 0F 00 20 /""...... .. ..
000001B0 0F 00 20 0F 87 00 0F 87 00 20 02 F0 20 F2 00 20 .. ...... .. ..
000001C0 02 F0 20 0F 87 00 0F 87 02 22 22 2F FF 22 22 22 .. ......""/."""
000001D0 22 2F FF 0F 87 00 0F 87 00 20 02 00 20 02 00 20 "/....... .. ..
000001E0 02 00 20 0F 87 00 0F 87 00 20 02 00 20 02 00 20 .. ...... .. ..
000001F0 02 00 20 0F 87 00 0F 87 02 22 22 22 22 22 22 22 .. ......"""""""
00000200 22 22 22 0F 87 00 0F 87 00 20 02 00 20 02 00 20 """...... .. ..
00000210 02 00 20 0F 87 00 0F 87 00 20 02 00 20 02 00 20 .. ...... .. ..
00000220 02 00 20 0F 87 00 0F 87 00 00 00 00 00 00 00 00 .. .............
00000230 00 00 00 0F 87 00 0F 88 77 77 77 77 77 77 77 77 ........wwwwwwww- 105 -

00000240
00000250
00000260
0000027000000280
00000290
000002A0000002B0
000002C0000002D0000002E0000002F000000300
00000310
00000320
00000330
00000340
00000350
00000360
00000370
00000380
00000390
000003A0000003B0
000003C0000003D0000003E0000003F000000400
00000410
00000420
00000430
00000440

77 77 77 78 87 00 0F 88
88 88 88 88 87 00 00 FF
FF FF FF FF F0 00 00 00
00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00
00 00 00 00 00 00 FF FF
FF FF C0 00 00 07 80 00
00 01 00 00 00 01 00 00
00 01 00 00 00 01 00 00
00 01 00 00 00 01 00 00
00 01 00 00 00 01 00 00
00 01 00 00 00 01 00 00
00 01 80 00 00 03 C0 00
FF FF FF FF FF FF 28 00
00 00 01 00 04 00 00 00
00 00 00 00 00 00 00 00
00 00 00 00 80 00 00 80
00 00 80 00 80 00 80 80
C0 00 00 00 FF 00 00 FF
00 00 FF 00 FF 00 FF FF
00 00 00 00 00 00 00 00
88 88 88 88 88 00 0F 00
00 20 02 00 20 80 0F 02
00 20 0F FF 20 80 0F 02
F2 22 F2 22 20 80 0F 02
00 20 02 00 20 80 0F 02
00 00 00 00 00 80 0F FF
00 00 00 00 00 00 00 00
00 00 80 01 00 00 00 00
00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00
00 00 00 00 00 00 80 01

88 88 88 88 88 88 88 88
FF FF FF FF FF FF FF FF
00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00
FF FF FF FF FF FF FF FF
00 03 00 00 00 01 00 00
00 01 00 00 00 01 00 00
00 01 00 00 00 01 00 00
00 01 00 00 00 01 00 00
00 01 00 00 00 01 00 00
00 01 00 00 00 01 00 00
00 07 FF FF FF FF FF FF
00 00 10 00 00 00 20 00
00 00 C0 00 00 00 00 00
00 00 00 00 00 00 00 00
00 00 00 80 80 00 80 00
00 00 80 80 80 00 C0 C000 00 00 FF FF 00 FF 00
00 00 FF FF FF 00 00 00
00 00 00 00 00 00 00 88
00 00 00 00 00 80 0F 02
22 22 22 22 20 80 0F 0F
F0 20 F2 00 F0 80 0F 02
0F FF 02 00 20 80 0F 02
22 22 22 22 20 80 0F 00
FF FF FF FF FF 00 00 00
00 00 00 00 00 00 FF FF
00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00
00 00 FF FF 00 00

wwwx............
...............
................
................
................
................
................
................
................
................
................
................
................
................
......(....... .
................
................
................
................
................
................
................
................
. .. ..."""" ...
. .. .... ......
."." ....... ...
. .. ..."""" ...
................
................
................
................
................
..............

‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑
・CloseDevice.frm
VERSION 5.00
Begin VB.Form frmCloseDevice
BorderStyle= 3 '固定ﾀﾞｲｱﾛｸﾞ
Caption= "デバイスクローズ"
ClientHeight= 3195
ClientLeft= 45
ClientTop= 330
ClientWidth= 4680Icon= "CloseDevice.frx":0000
LinkTopic= "Form1"
MaxButton= 0 'False
MinButton= 0 'False
ScaleHeight= 3195
ScaleWidth= 4680ShowInTaskbar = 0 'False
StartUpPosition = 1 'ｵｰﾅｰ ﾌｫｰﾑの中央
Begin VB.CommandButton Command1
Caption= "クローズ"
Height= 855
Left= 2640TabIndex
= 1
Top
= 360
Width
= 1695End
Begin VB.CommandButton Command2
Caption= "クローズ"
Height= 855
Left= 2640TabIndex= 0Top= 1800Width= 1695End
Begin VB.Label Label1
Caption= "FBIAD1"
BeginProperty Font
Name
= "ＭＳ Ｐゴシック"- 106 -

Size
= 26.25
Charset= 128
Weight= 400
Underline= 0 'False
Italic= 0 'False
Strikethrough = 0 'False
EndProperty
Height
= 495
Left
= 360
TabIndex
= 3
Top
= 480
Width
= 2175End
Begin VB.Label Label2
Caption= "FBIDA1"
BeginProperty Font
Name
= "ＭＳ Ｐゴシック"
Size= 26.25
Charset= 128
Weight= 400
Underline= 0 'False
Italic= 0 'False
Strikethrough = 0 'False
EndProperty
Height
= 495
Left
= 360
TabIndex= 2
Top= 2040Width= 2055End
End
Attribute VB̲Name = "frmCloseDevice"
Attribute VB̲GlobalNameSpace = False
Attribute VB̲Creatable = False
Attribute VB̲PredeclaredId = True
Attribute VB̲Exposed = False
Private Sub Command1̲Click()Dim nRet As Long
If adOpenFlag = 1 ThennRet = AdClose(adDeviceHandle)
If nRet <> AD̲ERROR̲SUCCESS Then
Call AdDispErrMessage(nRet)
Exit SubElse
adOpenFlag = 0
samplingConfFlag = 0
daMakeDataFlag = 0
frmMain.InfoBox.SelStart = Len(frmMain.InfoBox.Text) + 1
frmMain.InfoBox.SelText = vbCrLf & "A/D ‑ デバイスクローズＯＫ"
End IfElse
Beep
frmMain.InfoBox.SelStart = Len(frmMain.InfoBox.Text) + 1
frmMain.InfoBox.SelText = vbCrLf & "A/D ‑ デバイスがオープンされていません"
End IfEnd Sub
Private Sub Command2̲Click()Dim nRet As Long
If daOpenFlag = 1 ThennRet = DaClose(daDeviceHandle)
If nRet <> DA̲ERROR̲SUCCESS Then
Call DaDispErrMessage(nRet)
Exit SubElsedaOpenFlag = 0
samplingConfFlag = 0
daMakeDataFlag = 0
frmMain.InfoBox.SelStart = Len(frmMain.InfoBox.Text) + 1- 107 -

frmMain.InfoBox.SelText = vbCrLf & "D/A ‑ デバイスクローズＯＫ"
End IfElse
Beep
frmMain.InfoBox.SelStart = Len(frmMain.InfoBox.Text) + 1
frmMain.InfoBox.SelText = vbCrLf & "D/A ‑ デバイスがオープンされていません"
End IfEnd Sub‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑
・CloseDevice.frx
ADDRESS 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F 0123456789ABCDEF‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑
00000000 08 00 00 00 6C 74 00 00 00 00 00 00....lt......
‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑
・FbiDa.bas
Attribute VB̲Name = "FbiDa"
Public Const DA̲FLAG̲SYNC = 1
Public Const DA̲FLAG̲ASYNC = 2
Public Const DA̲FLAG̲BIN = 1
Public Const DA̲FLAG̲CSV = 2
Public Const DA̲STATUS̲STOP̲SAMPLING = 1
Public Const DA̲STATUS̲WAIT̲TRIGGER = 2
Public Const DA̲STATUS̲NOW̲SAMPLING = 3
Public Const DA̲EVENT̲STOP̲TRIGGER = 1
Public Const DA̲EVENT̲STOP̲FUNCTION = 2
Public Const DA̲EVENT̲STOP̲SAMPLING = 3
Public Const DA̲EVENT̲RESET̲IN = 4
Public Const DA̲EVENT̲CURRENT̲OFF = 5
Public Const DA̲ADJUST̲BIOFFSET = 1
Public Const DA̲ADJUST̲UNIOFFSET = 2
Public Const DA̲ADJUST̲BIGAIN = 3
Public Const DA̲ADJUST̲UNIGAIN = 4
Public Const DA̲ADJUST̲UP = 1
Public Const DA̲ADJUST̲DOWN = 2
Public Const DA̲ADJUST̲STORE = 3
Public Const DA̲ADJUST̲STANDBY = 4
Public Const DA̲ADJUST̲NOT̲STORE = 5
Public Const DA̲DATA̲PHYSICAL = 1
Public Const DA̲DATA̲BIN8 = 2
Public Const DA̲DATA̲BIN12 = 3
Public Const DA̲DATA̲BIN16 = 4
Public Const DA̲DATA̲BIN24 = 5
Public Const DA̲CONV̲SMOOTH = 1
Public Const DA̲CONV̲AVERAGE1 = &H100
Public Const DA̲CONV̲AVERAGE2 = &H200
Public Const DA̲IO̲SAMPLING = 1
Public Const DA̲FIFO̲SAMPLING = 2
Public Const DA̲MEM̲SAMPLING = 4
Public Const DA̲TRIG̲START = 1
Public Const DA̲TRIG̲STOP = 2
Public Const DA̲TRIG̲START̲STOP = 3
Public Const DA̲FREERUN = 1
Public Const DA̲EXTTRG = 2
Public Const DA̲EXTTRG̲DI = 3
Public Const DA̲DOWN̲EDGE = 1
Public Const DA̲UP̲EDGE = 2- 108 -

Public Const DA̲0̲1V = &H1
Public Const DA̲0̲2P5V = &H2
Public Const DA̲0̲5V = &H4
Public Const DA̲0̲10V = &H8
Public Const DA̲1̲5V = &H10
Public Const DA̲0̲20mA = &H1000
Public Const DA̲4̲20mA = &H2000
Public Const DA̲1V = &H10000
Public Const DA̲2P5V = &H20000
Public Const DA̲5V = &H40000
Public Const DA̲10V = &H80000
Public Const DA̲ISOLATION = 1
Public Const DA̲NOT̲ISOLATION = 2
Public Const DA̲RANGE̲UNIPOLAR = 1
Public Const DA̲RANGE̲BIPOLAR = 2
Public Const DA̲MODE̲CUT = 1
Public Const DA̲MODE̲SYNTHE = 2
Public Const DA̲REPEAT̲NONINTERVAL = 1
Public Const DA̲REPEAT̲INTERVAL = 2
Public Const DA̲COUNTER̲CLEAR = 1
Public Const DA̲COUNTER̲NONCLEAR = 2
Public Const DA̲LATCH̲CLEAR = 1
Public Const DA̲LATCH̲NONCLEAR = 2
Public Const DA̲CLOCK̲TIMER = 1
Public Const DA̲CLOCK̲FIXED = 2
Public Const DA̲EXTRG̲IN = 1
Public Const DA̲EXTRG̲OUT = 2
Public Const DA̲EXCLK̲IN = 1
Public Const DA̲EXCLK̲OUT = 2
Public Const DA̲FILTER̲OFF = 1
Public Const DA̲FILTER̲ON = 2
Type DASMPLCHREQ
ulChNo As Long
ulRange As LongEnd Type
Type DASMPLREQ
ulChCount As Long
SmplChReq(0 To 255) As DASMPLCHREQ
ulSamplingMode As LongfSmplFreq As Single
ulSmplRepeat As Long
ulTrigMode As Long
ulTrigPoint As Long
ulTrigDelay As Long
ulEClkEdge As Long
ulTrigEdge As Long
ulTrigDI As LongEnd Type
Type DABOARDSPEC
ulBoardType As Long
ulBoardID As Long
ulSamplingMode As Long
ulChCount As Long
ulResolution As Long
ulRange As Long
ulIsolation As Long
ulDi As Long
ulDo As LongEnd Type- 109 -

Type DAMODECHREQ
ulRange As Long
fVolt As Single
ulFilter As LongEnd Type
Type DAMODEREQ
ModeChReq(0 To 1) As DAMODECHREQ
ulPulseMode As Long
ulSyntheOut As Long
ulInterval As Long
fIntervalCycle As Single
ulCounterClear As Long
ulDaLatch As Long
ulSamplingClock As Long
ulExControl As Long
ulExClock As LongEnd Type
Public Const DA̲ERROR̲SUCCESS = 0
Public Const DA̲ERROR̲NOT̲DEVICE = &HC0000001
Public Const DA̲ERROR̲NOT̲OPEN = &HC0000002
Public Const DA̲ERROR̲INVALID̲HANDLE = &HC0000003
Public Const DA̲ERROR̲ALREADY̲OPEN = &HC0000004
Public Const DA̲ERROR̲NOT̲SUPPORTED = &HC0000009
Public Const DA̲ERROR̲NOW̲SAMPLING = &HC0001001
Public Const DA̲ERROR̲STOP̲SAMPLING = &HC0001002
Public Const DA̲ERROR̲START̲SAMPLING = &HC0001003
Public Const DA̲ERROR̲SAMPLING̲TIMEOUT = &HC0001004
Public Const DA̲ERROR̲INVALID̲PARAMETER = &HC0001021
Public Const DA̲ERROR̲ILLEGAL̲PARAMETER = &HC0001022
Public Const DA̲ERROR̲NULL̲POINTER = &HC0001023
Public Const DA̲ERROR̲SET̲DATA = &HC0001024
Public Const DA̲ERROR̲FILE̲OPEN = &HC0001041
Public Const DA̲ERROR̲FILE̲CLOSE = &HC0001042
Public Const DA̲ERROR̲FILE̲READ = &HC0001043
Public Const DA̲ERROR̲FILE̲WRITE = &HC0001044
Public Const DA̲ERROR̲INVALID̲DATA̲FORMAT = &HC0001061
Public Const DA̲ERROR̲INVALID̲AVERAGE̲OR̲SMOOTHING = &HC0001062
Public Const DA̲ERROR̲INVALID̲SOURCE̲DATA = &HC0001063
Public Const DA̲ERROR̲NOT̲ALLOCATE̲MEMORY = &HC0001081
Public Const DA̲ERROR̲NOT̲LOAD̲DLL = &HC0001082
Public Const DA̲ERROR̲CALL̲DLL = &HC0001083
Declare Function DaOpen Lib "FbiDa.DLL" (ByVal lpszName As String) As Long
Declare Function DaClose Lib "FbiDa.DLL" (ByVal hDeviceHandle As Long) As Long
Declare Function DaGetDeviceInfo Lib "FbiDa.DLL" (ByVal hDeviceHandle As Long, ByRef pDaBoardSpec As
DABOARDSPEC) As Long
Declare Function DaSetBoardConfig Lib "FbiDa.DLL" (ByVal hDeviceHandle As Long, ByVal ulSmplBufferSize As Long,
ByVal hEvent As Long, ByVal lpEventProc As Long, ByVal dwUser As Long) As Long
Declare Function DaGetBoardConfig Lib "FbiDa.DLL" (ByVal hDeviceHandle As Long, ByRef ulSmplBufferSize As Long,
ByRef ulDaSmplEventFactor As Long) As Long
Declare Function DaSetSamplingConfig Lib "FbiDa.DLL" (ByVal hDeviceHandle As Long, ByRef pDaSmplConfig As
DASMPLREQ) As Long
Declare Function DaGetSamplingConfig Lib "FbiDa.DLL" (ByVal hDeviceHandle As Long, ByRef pDaSmplConfig As
DASMPLREQ) As Long
Declare Function DaSetMode Lib "FbiDa.DLL" (ByVal hDeviceHandle As Long, ByRef pDaMode As DAMODEREQ) As Long
Declare Function DaGetMode Lib "FbiDa.DLL" (ByVal hDeviceHandle As Long, ByRef pDaMode As DAMODEREQ) As Long
Declare Function DaSetSamplingData Lib "FbiDa.DLL" (ByVal hDeviceHandle As Long, ByRef pSmplData As Any, ByVal
dwSmplDataNum As Long) As Long
Declare Function DaClearSamplingData Lib "FbiDa.DLL" (ByVal hDeviceHandle As Long) As Long
Declare Function DaStartSampling Lib "FbiDa.DLL" (ByVal hDeviceHandle As Long, ByVal fdwSyncFlag As Long) As
Long
Declare Function DaStartFileSampling Lib "FbiDa.DLL" (ByVal hDeviceHandle As Long, ByVal pszPathName As String,
ByVal ulFileFlag As Long, ByVal ulSmplNum As Long) As Long
Declare Function DaStopSampling Lib "FbiDa.DLL" (ByVal hDeviceHandle As Long) As Long
Declare Function DaGetStatus Lib "FbiDa.DLL" (ByVal hDeviceHandle As Long, ByRef ulDaSmplStatus As Long, ByRef
ulDaSmplCount As Long, ByRef ulDaAvailCount As Long, ByRef ulDaAvailRepeat As Long) As Long
Declare Function DaOutputDA Lib "FbiDa.DLL" (ByVal hDeviceHandle As Long, ByVal nCh As Long, ByRef lpDaSmplChReq
As DASMPLCHREQ, ByRef pData As Any) As Long
Declare Function DaInputDI Lib "FbiDa.DLL" (ByVal hDeviceHandle As Long, ByRef pdwData As Long) As Long
Declare Function DaOutputDO Lib "FbiDa.DLL" (ByVal hDeviceHandle As Long, ByVal dwData As Long) As Long

- 110 -

Declare Function DaAdjustVR Lib "FbiDa.DLL" (ByVal hDeviceHandle As Long, ByVal ulAdjustCh As Long, ByVal
ulSelVolume As Long, ByVal ulControl As Long, ByVal v As Long) As Long
Declare Function DaDataConv Lib "FbiDaDc.DLL" (ByVal uSrcFormCode As Long, ByRef pSrcData As Any, ByVal
uSrcSmplDataNum As Long, ByRef pSrcSmplReq As DASMPLREQ, ByVal uDestFormCode As Long, ByRef pDestData As Any,
ByVal puDestSmplDataNum As Long, ByRef pDestSmplReq As DASMPLREQ, ByVal uEffect As Long, ByVal uCount As Long,
ByVal lpfnConv As Long) As Long
Declare Function DaWriteFile Lib "FbiDaDc.DLL" (ByVal pszPathName As String, ByRef pSmplData As Any, ByVal
ulFormCode As Long, ByVal ulSmplNum As Long, ByVal ulChCount As Long) As Long‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑
・FbiAd.bas
Attribute VB̲Name = "FbiAd"
Public Const AD̲FLAG̲SYNC = 1
Public Const AD̲FLAG̲ASYNC = 2
Public Const AD̲FLAG̲BIN = 1
Public Const AD̲FLAG̲CSV = 2
Public Const AD̲STATUS̲STOP̲SAMPLING = 1
Public Const AD̲STATUS̲WAIT̲TRIGGER = 2
Public Const AD̲STATUS̲NOW̲SAMPLING = 3
Public Const AD̲EVENT̲SMPLNUM = 1
Public Const AD̲EVENT̲STOP̲TRIGGER = 2
Public Const AD̲EVENT̲STOP̲FUNCTION = 3
Public Const AD̲EVENT̲STOP̲TIMEOUT = 4
Public Const AD̲EVENT̲STOP̲SAMPLING = 5
Public Const AD̲INPUT̲SINGLE = 1
Public Const AD̲INPUT̲DIFF = 2
Public Const AD̲ADJUST̲BIOFFSET = 1
Public Const AD̲ADJUST̲UNIOFFSET = 2
Public Const AD̲ADJUST̲BIGAIN = 3
Public Const AD̲ADJUST̲UNIGAIN = 4
Public Const AD̲ADJUST̲UP = 1
Public Const AD̲ADJUST̲DOWN = 2
Public Const AD̲ADJUST̲STORE = 3
Public Const AD̲ADJUST̲STANDBY = 4
Public Const AD̲ADJUST̲NOT̲STORE = 5
Public Const AD̲DATA̲PHYSICAL = 1
Public Const AD̲DATA̲BIN8 = 2
Public Const AD̲DATA̲BIN12 = 3
Public Const AD̲DATA̲BIN16 = 4
Public Const AD̲DATA̲BIN24 = 5
Public Const AD̲CONV̲SMOOTH = 1
Public Const AD̲CONV̲AVERAGE1 = &H100
Public Const AD̲CONV̲AVERAGE2 = &H200
Public Const AD̲IO̲SAMPLING = 1
Public Const AD̲FIFO̲SAMPLING = 2
Public Const AD̲MEM̲SAMPLING = 4
Public Const AD̲TRIG̲START = 1
Public Const AD̲TRIG̲STOP = 2
Public Const AD̲TRIG̲START̲STOP = 3
Public Const AD̲FREERUN = 1
Public Const AD̲EXTTRG = 2
Public Const AD̲EXTTRG̲DI = 3
Public Const AD̲LEVEL̲P = 4
Public Const AD̲LEVEL̲M = 5
Public Const AD̲LEVEL̲D = 6
Public Const AD̲INRANGE = 7
Public Const AD̲OUTRANGE = 8
Public Const AD̲ETERNITY = 9
Public Const AD̲START̲P1 = &H10
Public Const AD̲START̲M1 = &H20
Public Const AD̲START̲D1 = &H40

- 111 -

Public Const AD̲START̲P2 = &H80
Public Const AD̲START̲M2 = &H100
Public Const AD̲START̲D2 = &H200
Public Const AD̲STOP̲P1 = &H400
Public Const AD̲STOP̲M1 = &H800
Public Const AD̲STOP̲D1 = &H1000
Public Const AD̲STOP̲P2 = &H2000
Public Const AD̲STOP̲M2 = &H4000
Public Const AD̲STOP̲D2 = &H8000
Public Const AD̲ANALOG̲FILTER = &H10000
Public Const AD̲DOWN̲EDGE = 1
Public Const AD̲UP̲EDGE = 2
Public Const AD̲LOW̲PULSE = 1
Public Const AD̲HIGH̲PULSE = 2
Public Const AD̲NORMAL̲MODE = 1
Public Const AD̲FAST̲MODE = 2
Public Const AD̲0̲1V = &H1
Public Const AD̲0̲2P5V = &H2
Public Const AD̲0̲5V = &H4
Public Const AD̲0̲10V = &H8
Public Const AD̲1̲5V = &H10
Public Const AD̲0̲20mA = &H1000
Public Const AD̲4̲20mA = &H2000
Public Const AD̲1V = &H10000
Public Const AD̲2P5V = &H20000
Public Const AD̲5V = &H40000
Public Const AD̲10V = &H80000
Public Const AD̲ISOLATION = 1
Public Const AD̲NOT̲ISOLATION = 2
Type ADSMPLCHREQ
ulChNo As Long
ulRange As LongEnd Type
Type ADSMPLREQ
ulChCount As Long
SmplChReq(0 To 255) As ADSMPLCHREQ
ulSamplingMode As Long
ulSingleDiff As Long
ulSmplNum As Long
ulSmplEventNum As LongfSmplFreq As Single
ulTrigPoint As Long
ulTrigMode As Long
lTrigDelay As Long
ulTrigCh As Long
fTrigLevel1 As Single
fTrigLevel2 As Single
ulEClkEdge As Long
ulATrgPulse As Long
ulTrigEdge As Long
ulTrigDI As Long
ulFastMode As LongEnd Type
Type ADBOARDSPEC
ulBoardType As Long
ulBoardID As LongdwSamplingMode As Long
ulChCountS As Long
ulChCountD As Long
ulResolution As Long
dwRange As Long
ulIsolation As Long
ulDi As Long
ulDo As LongEnd Type- 112 -

Public Const AD̲ERROR̲SUCCESS = 0
Public Const AD̲ERROR̲NOT̲DEVICE = &HC0000001
Public Const AD̲ERROR̲NOT̲OPEN = &HC0000002
Public Const AD̲ERROR̲INVALID̲HANDLE = &HC0000003
Public Const AD̲ERROR̲ALREADY̲OPEN = &HC0000004
Public Const AD̲ERROR̲NOT̲SUPPORTED = &HC0000009
Public Const AD̲ERROR̲NOW̲SAMPLING = &HC0001001
Public Const AD̲ERROR̲STOP̲SAMPLING = &HC0001002
Public Const AD̲ERROR̲START̲SAMPLING = &HC0001003
Public Const AD̲ERROR̲SAMPLING̲TIMEOUT = &HC0001004
Public Const AD̲ERROR̲INVALID̲PARAMETER = &HC0001021
Public Const AD̲ERROR̲ILLEGAL̲PARAMETER = &HC0001022
Public Const AD̲ERROR̲NULL̲POINTER = &HC0001023
Public Const AD̲ERROR̲GET̲DATA = &HC0001024
Public Const AD̲ERROR̲FILE̲OPEN = &HC0001041
Public Const AD̲ERROR̲FILE̲CLOSE = &HC0001042
Public Const AD̲ERROR̲FILE̲READ = &HC0001043
Public Const AD̲ERROR̲FILE̲WRITE = &HC0001044
Public Const AD̲ERROR̲INVALID̲DATA̲FORMAT = &HC0001061
Public Const AD̲ERROR̲INVALID̲AVERAGE̲OR̲SMOOTHING = &HC0001062
Public Const AD̲ERROR̲INVALID̲SOURCE̲DATA = &HC0001063
Public Const AD̲ERROR̲NOT̲ALLOCATE̲MEMORY = &HC0001081
Public Const AD̲ERROR̲NOT̲LOAD̲DLL = &HC0001082
Public Const AD̲ERROR̲CALL̲DLL = &HC0001083
Declare Function AdOpen Lib "FbiAd.DLL" (ByVal lpszName As String) As Long
Declare Function AdClose Lib "FbiAd.DLL" (ByVal hDeviceHandle As Long) As Long
Declare Function AdGetDeviceInfo Lib "FbiAd.DLL" (ByVal hDeviceHandle As Long, ByRef BoardSpec As ADBOARDSPEC)As Long
Declare Function AdSetBoardConfig Lib "FbiAd.DLL" (ByVal hDeviceHandle As Long, ByVal hEvent As Long, ByVal
lpEventProc As Long, ByVal dwUser As Long) As Long
Declare Function AdGetBoardConfig Lib "FbiAd.DLL" (ByVal hDeviceHandle As Long, ByRef ulAdSmplEventFactor AsLong) As Long
Declare Function AdSetSamplingConfig Lib "FbiAd.DLL" (ByVal hDeviceHandle As Long, ByRef pAdSmplConfig As
ADSMPLREQ) As Long
Declare Function AdGetSamplingConfig Lib "FbiAd.DLL" (ByVal hDeviceHandle As Long, ByRef pAdSmplConfig As
ADSMPLREQ) As Long
Declare Function AdGetSamplingData Lib "FbiAd.DLL" (ByVal hDeviceHandle As Long, ByRef pSmplData As Any, ByRef
ulSmplNum As Long) As Long
Declare Function AdClearSamplingData Lib "FbiAd.DLL" (ByVal hDeviceHandle As Long) As Long
Declare Function AdStartSampling Lib "FbiAd.DLL" (ByVal hDeviceHandle As Long, ByVal ulSyncFlag As Long) As
Long
Declare Function AdStartFileSampling Lib "FbiAd.DLL" (ByVal hDeviceHandle As Long, ByVal pszPathName As String,
ByVal ulFileFlag As Long) As Long
Declare Function AdTriggerSampling Lib "FbiAd.DLL" (ByVal hDeviceHandle As Long, ByVal ulChNo As Long, ByVal
ulRange As Long, ByVal ulSingleDiff As Long, ByVal ulTriggerMode As Long, ByVal ulTrigEdge As Long, ByVal
ulSmplNum As Long) As Long
Declare Function AdMemTriggerSampling Lib "FbiAd.DLL" (ByVal hDeviceHandle As Long, ByVal ulChCount As Long,
ByRef lpSmplChReq As ADSMPLCHREQ, ByVal ulSmplNum As Long, ByVal ulRepeatCount As Long, ByVal ulTrigEdge As
Long, ByVal fSmplFreq As Single, ByVal ulEClkEdge As Long, ByVal ulFastMode As Long) As Long
Declare Function AdStopSampling Lib "FbiAd.DLL" (ByVal hDeviceHandle As Long) As Long
Declare Function AdGetStatus Lib "FbiAd.DLL" (ByVal hDeviceHandle As Long, ByRef ulAdSmplStatus As Long, ByRef
ulAdSmplCount As Long, ByRef ulAdAvailCount As Long) As Long
Declare Function AdInputAD Lib "FbiAd.DLL" (ByVal hDeviceHandle As Long, ByVal ulCh As Long, ByVal ulSingleDiff
As Long, ByRef lpAdSmplChReq As ADSMPLCHREQ, ByRef lpData As Any) As Long
Declare Function AdInputDI Lib "FbiAd.DLL" (ByVal hDeviceHandle As Long, ByRef dwData As Long) As Long
Declare Function AdOutputDO Lib "FbiAd.DLL" (ByVal hDeviceHandle As Long, ByVal dwData As Long) As Long
Declare Function AdAdjustVR Lib "FbiAd.DLL" (ByVal hDeviceHandle As Long, ByVal ulAdjustCh As Long, ByVal
ulSingleDiff As Long, ByVal ulSelVolume As Long, ByVal ulControl As Long, ByVal ulTap As Long) As Long
Declare Function AdDataConv Lib "FbiAdDC.DLL" (ByVal uSrcFormCode As Long, ByRef pSrcData As Any, ByVal
uSrcSmplDataNum As Long, ByRef pSrcSmplReq As ADSMPLREQ, ByVal uDestFormCode As Long, ByRef pDestData As Any,
ByRef puDestSmplDataNum As Long, ByRef pDestSmplReq As ADSMPLREQ, ByVal uEffect As Long, ByVal uCount As Long,
ByVal lpfnConv As Long) As Long
Declare Function AdReadFile Lib "FbiAdDC.DLL" (ByVal pszPathName As String, ByRef pSmplData As Any, ByVal
uFormCode As Long) As Long‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑
・DaModule.bas
Attribute VB̲Name = "DaModule"- 113 -

Public daDeviceHandle As Long
Public daChannel As Long
Public daOpenFlag As Long
Public daConfig As DASMPLREQ
Public daInfo As DABOARDSPEC
Public daMode As DAMODEREQ
Public daData(524288) As Integer
Public daDataTemp(524288) As Integer
Public szTemp As String
Public Sub DaDispErrMessage(ByVal uErrCode As Long)
Beep
Select Case uErrCode
Case DA̲ERROR̲SUCCESS
frmMain.InfoBox.SelStart = Len(frmMain.InfoBox.Text) + 1
frmMain.InfoBox.SelText = vbCrLf & "D/A ‑ 正常終了"
Case DA̲ERROR̲NOT̲DEVICE
frmMain.InfoBox.SelStart = Len(frmMain.InfoBox.Text) + 1
frmMain.InfoBox.SelText = vbCrLf & "D/A ‑ ドライバ（デバイス）が呼び出せません"
Case DA̲ERROR̲NOT̲OPEN
frmMain.InfoBox.SelStart = Len(frmMain.InfoBox.Text) + 1
frmMain.InfoBox.SelText = vbCrLf & "D/A ‑ ドライバ（デバイス）がオープンできません"
Case DA̲ERROR̲INVALID̲HANDLE
frmMain.InfoBox.SelStart = Len(frmMain.InfoBox.Text) + 1
frmMain.InfoBox.SelText = vbCrLf & "D/A ‑ 無効なデバイスハンドルです"
Case DA̲ERROR̲ALREADY̲OPEN
frmMain.InfoBox.SelStart = Len(frmMain.InfoBox.Text) + 1
frmMain.InfoBox.SelText = vbCrLf & "D/A ‑ すでにオープンされているデバイスです"
Case DA̲ERROR̲NOT̲SUPPORTED
frmMain.InfoBox.SelStart = Len(frmMain.InfoBox.Text) + 1
frmMain.InfoBox.SelText = vbCrLf & "D/A ‑ サポートされていません"
Case DA̲ERROR̲NOW̲SAMPLING
frmMain.InfoBox.SelStart = Len(frmMain.InfoBox.Text) + 1
frmMain.InfoBox.SelText = vbCrLf & "D/A ‑ アナログ出力実行中です"
Case DA̲ERROR̲STOP̲SAMPLING
frmMain.InfoBox.SelStart = Len(frmMain.InfoBox.Text) + 1
frmMain.InfoBox.SelText = vbCrLf & "D/A ‑ アナログ出力停止中です"
Case DA̲ERROR̲START̲SAMPLING
frmMain.InfoBox.SelStart = Len(frmMain.InfoBox.Text) + 1
frmMain.InfoBox.SelText = vbCrLf & "D/A ‑ サンプリングを実行できませんでした"
Case DA̲ERROR̲SAMPLING̲TIMEOUT
frmMain.InfoBox.SelStart = Len(frmMain.InfoBox.Text) + 1
frmMain.InfoBox.SelText = vbCrLf & "D/A ‑ サンプリング出力においてタイムアウトが発生しました"
Case DA̲ERROR̲INVALID̲PARAMETER
frmMain.InfoBox.SelStart = Len(frmMain.InfoBox.Text) + 1
frmMain.InfoBox.SelText = vbCrLf & "D/A ‑ 無効なパラメータです"Case DA̲ERROR̲ILLEGAL̲PARAMETER
frmMain.InfoBox.SelStart = Len(frmMain.InfoBox.Text) + 1
frmMain.InfoBox.SelText = vbCrLf & "D/A ‑ サンプリング設定が正しくありません"
Case DA̲ERROR̲NULL̲POINTER
frmMain.InfoBox.SelStart = Len(frmMain.InfoBox.Text) + 1
frmMain.InfoBox.SelText = vbCrLf & "D/A ‑ NULL ポインタを指定しました"
Case DA̲ERROR̲SET̲DATA
frmMain.InfoBox.SelStart = Len(frmMain.InfoBox.Text) + 1
frmMain.InfoBox.SelText = vbCrLf & "D/A ‑ サンプリングデータのセットができませんでした"
Case DA̲ERROR̲FILE̲OPEN
frmMain.InfoBox.SelStart = Len(frmMain.InfoBox.Text) + 1- 114 -

frmMain.InfoBox.SelText = vbCrLf & "D/A ‑ ファイルのオープンに失敗しました"
Case DA̲ERROR̲FILE̲CLOSE
frmMain.InfoBox.SelStart = Len(frmMain.InfoBox.Text) + 1
frmMain.InfoBox.SelText = vbCrLf & "D/A ‑ ファイルのクローズに失敗しました"
Case DA̲ERROR̲FILE̲READ
frmMain.InfoBox.SelStart = Len(frmMain.InfoBox.Text) + 1
frmMain.InfoBox.SelText = vbCrLf & "D/A ‑ ファイルの読み込みに失敗しました"
Case DA̲ERROR̲FILE̲WRITE
frmMain.InfoBox.SelStart = Len(frmMain.InfoBox.Text) + 1
frmMain.InfoBox.SelText = vbCrLf & "D/A ‑ ファイルの書き込みに失敗しました"
Case DA̲ERROR̲INVALID̲DATA̲FORMAT
frmMain.InfoBox.SelStart = Len(frmMain.InfoBox.Text) + 1
frmMain.InfoBox.SelText = vbCrLf & "D/A ‑ データのフォーマットが無効です"
Case DA̲ERROR̲INVALID̲AVERAGE̲OR̲SMOOTHING
frmMain.InfoBox.SelStart = Len(frmMain.InfoBox.Text) + 1
frmMain.InfoBox.SelText = vbCrLf & "D/A ‑ 平均またはスムージングの指定が正しくありません"
Case DA̲ERROR̲INVALID̲SOURCE̲DATA
frmMain.InfoBox.SelStart = Len(frmMain.InfoBox.Text) + 1
frmMain.InfoBox.SelText = vbCrLf & "D/A ‑ データ変換元として指定されたデータが正しくありません"
Case DA̲ERROR̲NOT̲ALLOCATE̲MEMORY
frmMain.InfoBox.SelStart = Len(frmMain.InfoBox.Text) + 1
frmMain.InfoBox.SelText = vbCrLf & "D/A ‑ メモリが確保できません"
Case DA̲ERROR̲NOT̲LOAD̲DLL
frmMain.InfoBox.SelStart = Len(frmMain.InfoBox.Text) + 1
frmMain.InfoBox.SelText = vbCrLf & "D/A ‑ DLL ファイルの読み込みに失敗しました"
Case DA̲ERROR̲CALL̲DLL
frmMain.InfoBox.SelStart = Len(frmMain.InfoBox.Text) + 1
frmMain.InfoBox.SelText = vbCrLf & "D/A ‑ DLL の呼び出しに失敗しました"
Case Else
frmMain.InfoBox.SelStart = Len(frmMain.InfoBox.Text) + 1
frmMain.InfoBox.SelText = vbCrLf & "D/A ‑ 予期しないエラーが発生しました"
End SelectEnd Sub‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑
・AdModule.bas
Attribute VB̲Name = "AdModule"
Public adDeviceHandle As Long
Public adChannel As Long
Public adOpenFlag As Long
Public adConfig As ADSMPLREQ
Public adInfo As ADBOARDSPEC
Public adData() As Integer
Public adDataTemp() As Integer
Public Sub AdDispErrMessage(ByVal uErrCode As Long)
Beep
Select Case uErrCode
Case AD̲ERROR̲SUCCESS
frmMain.InfoBox.SelStart = Len(frmMain.InfoBox.Text) + 1
frmMain.InfoBox.SelText = vbCrLf & "A/D ‑ 正常終了"
Case AD̲ERROR̲NOT̲DEVICE
frmMain.InfoBox.SelStart = Len(frmMain.InfoBox.Text) + 1
frmMain.InfoBox.SelText = vbCrLf & "A/D ‑ ドライバ（デバイス）が呼び出せません"
Case AD̲ERROR̲NOT̲OPEN
frmMain.InfoBox.SelStart = Len(frmMain.InfoBox.Text) + 1
frmMain.InfoBox.SelText = vbCrLf & "A/D ‑ ドライバ（デバイス）がオープンできません"- 115 -

Case AD̲ERROR̲INVALID̲HANDLE
frmMain.InfoBox.SelStart = Len(frmMain.InfoBox.Text) + 1
frmMain.InfoBox.SelText = vbCrLf & "A/D ‑ 無効なデバイスハンドルです"
Case AD̲ERROR̲ALREADY̲OPEN
frmMain.InfoBox.SelStart = Len(frmMain.InfoBox.Text) + 1
frmMain.InfoBox.SelText = vbCrLf & "A/D ‑ すでにオープンしているデバイスです"
Case AD̲ERROR̲NOT̲SUPPORTED
frmMain.InfoBox.SelStart = Len(frmMain.InfoBox.Text) + 1
frmMain.InfoBox.SelText = vbCrLf & "A/D ‑ サポートされていません"
Case AD̲ERROR̲NOW̲SAMPLING
frmMain.InfoBox.SelStart = Len(frmMain.InfoBox.Text) + 1
frmMain.InfoBox.SelText = vbCrLf & "A/D ‑ サンプリング実行中です"
Case AD̲ERROR̲STOP̲SAMPLING
frmMain.InfoBox.SelStart = Len(frmMain.InfoBox.Text) + 1
frmMain.InfoBox.SelText = vbCrLf & "A/D ‑ サンプリング停止中です"
Case AD̲ERROR̲START̲SAMPLING
frmMain.InfoBox.SelStart = Len(frmMain.InfoBox.Text) + 1
frmMain.InfoBox.SelText = vbCrLf & "A/D ‑ サンプリングを実行できませんでした"
Case AD̲ERROR̲SAMPLING̲TIMEOUT
frmMain.InfoBox.SelStart = Len(frmMain.InfoBox.Text) + 1
frmMain.InfoBox.SelText = vbCrLf & "A/D ‑ サンプリング中にタイムアウトが発生しました"
Case AD̲ERROR̲INVALID̲PARAMETER
frmMain.InfoBox.SelStart = Len(frmMain.InfoBox.Text) + 1
frmMain.InfoBox.SelText = vbCrLf & "A/D ‑ パラメータが不正です"
Case AD̲ERROR̲ILLEGAL̲PARAMETER
frmMain.InfoBox.SelStart = Len(frmMain.InfoBox.Text) + 1
frmMain.InfoBox.SelText = vbCrLf & "A/D ‑ サンプリング設定が正しくありません"
Case AD̲ERROR̲NULL̲POINTER
frmMain.InfoBox.SelStart = Len(frmMain.InfoBox.Text) + 1
frmMain.InfoBox.SelText = vbCrLf & "A/D ‑ NULL ポインタを指定しました"
Case AD̲ERROR̲GET̲DATA
frmMain.InfoBox.SelStart = Len(frmMain.InfoBox.Text) + 1
frmMain.InfoBox.SelText = vbCrLf & "A/D ‑ サンプリングデータの取得ができませんでした"
Case AD̲ERROR̲FILE̲OPEN
frmMain.InfoBox.SelStart = Len(frmMain.InfoBox.Text) + 1
frmMain.InfoBox.SelText = vbCrLf & "A/D ‑ ファイルのオープンに失敗しました"
Case AD̲ERROR̲FILE̲CLOSE
frmMain.InfoBox.SelStart = Len(frmMain.InfoBox.Text) + 1
frmMain.InfoBox.SelText = vbCrLf & "A/D ‑ ファイルのクローズに失敗しました"
Case AD̲ERROR̲FILE̲READ
frmMain.InfoBox.SelStart = Len(frmMain.InfoBox.Text) + 1
frmMain.InfoBox.SelText = vbCrLf & "A/D ‑ ファイルの読み込みに失敗しました"
Case AD̲ERROR̲FILE̲WRITE
frmMain.InfoBox.SelStart = Len(frmMain.InfoBox.Text) + 1
frmMain.InfoBox.SelText = vbCrLf & "A/D ‑ ファイルの書き込みに失敗しました"
Case AD̲ERROR̲INVALID̲DATA̲FORMAT
frmMain.InfoBox.SelStart = Len(frmMain.InfoBox.Text) + 1
frmMain.InfoBox.SelText = vbCrLf & "A/D ‑ データ形式が無効です"
Case AD̲ERROR̲INVALID̲AVERAGE̲OR̲SMOOTHING
frmMain.InfoBox.SelStart = Len(frmMain.InfoBox.Text) + 1
frmMain.InfoBox.SelText = vbCrLf & "A/D ‑ 平均またはスムージングの設定が正しくありません"
Case AD̲ERROR̲INVALID̲SOURCE̲DATA
frmMain.InfoBox.SelStart = Len(frmMain.InfoBox.Text) + 1
frmMain.InfoBox.SelText = vbCrLf & "A/D ‑ データ変換元として指定されたデータが正しくありません"- 116 -

Case AD̲ERROR̲NOT̲ALLOCATE̲MEMORY
frmMain.InfoBox.SelStart = Len(frmMain.InfoBox.Text) + 1
frmMain.InfoBox.SelText = vbCrLf & "A/D ‑ メモリが確保できません"
Case AD̲ERROR̲NOT̲LOAD̲DLL
frmMain.InfoBox.SelStart = Len(frmMain.InfoBox.Text) + 1
frmMain.InfoBox.SelText = vbCrLf & "A/D ‑ DLL がロードできませんでした"
Case AD̲ERROR̲CALL̲DLL
frmMain.InfoBox.SelStart = Len(frmMain.InfoBox.Text) + 1
frmMain.InfoBox.SelText = vbCrLf & "A/D ‑ DLL の呼び出しに失敗しました"
Case Else
frmMain.InfoBox.SelStart = Len(frmMain.InfoBox.Text) + 1
frmMain.InfoBox.SelText = vbCrLf & "A/D ‑ 予期しないエラーが発生しました"
End SelectEnd Sub‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑
・CommonModule.bas
Attribute VB̲Name = "CommonModule"
Declare Function CreateEvent Lib "kernel32" Alias "CreateEventA" (ByVal lpEventAttributes As Long, ByVal
ManualReset As Long, ByVal bInitialState As Long, ByVal lpName As String) As Long
Declare Function WaitForSingleObject Lib "kernel32" (ByVal hHandle As Long, ByVal dwMilliseconds As Long) As
Long
Declare Function CloseHandle Lib "kernel32" (ByVal hObject As Long) As Long
Declare Function WaitForMultipleObjects Lib "kernel32" (ByVal nCount As Long, ByRef lpHandles As Long, ByVal
bWaitAll As Long, ByVal dwMilliseconds As Long) As Long
Declare Function ResetEvent Lib "kernel32" (ByVal hEvent As Long) As Long
Public Const appName = "ADDAFMS"
Public Const secName = "SAMPLCONF"
Public samplingConfFlag As Long
Public daMakeDataFlag As Long
Public endCheck As Long
Public adVmax As Single
Public adVmin As Single
Public daVmax As Single
Public daVmin As Single
Public vMaxNum As Single
Public vMinNum As Single
Public hEvent(1) As Long
Public horiScaleMode As Integer '横軸目盛モード 0=サンプル数 1=時間
Public horiScaleAd As Integer '1=A/D 時間 0=D/A 時間
Public measureTimes As Integer
Public measureInt As Integer
Public stopFlag As Integer
Public Timetimer As Long
Public IntervalTimer As Integer
Public Type POINTAPIX As LongY As LongEnd Type
Declare Function Polyline Lib "gdi32" (ByVal hDC As Long, lpPoints As POINTAPI, ByVal nCount As Long) As Long'‑‑‑‑Windows API コールで twip をつかうため
Private Const MM̲TEXT = 1
Private Const MM̲ANISOTROPIC = 8
Private Const LOGPIXELSX = 88
Private Const LOGPIXELSY = 90
Private Declare Function SetMapMode Lib "gdi32" (ByVal hDC As Long, ByVal nMapMode As Long) As Long
Private Declare Function SetViewportExtEx Lib "gdi32" (ByVal hDC As Long, ByVal nX As Long, ByVal nY As Long,
lpSize As Long) As Long

- 117 -

Private Declare Function SetWindowExtEx Lib "gdi32" (ByVal hDC As Long, ByVal nX As Long, ByVal nY As Long,
lpSize As Long) As Long
Private Declare Function GetDeviceCaps Lib "gdi32" (ByVal hDC As Long, ByVal nIndex As Long) As Long
Public Sub SetFormToTwips(hDC)
Dim i, extX, extY, li = SetMapMode(hDC, MM̲ANISOTROPIC)
extX = 14400 / GetDeviceCaps(hDC, LOGPIXELSX)
extY = 14400 / GetDeviceCaps(hDC, LOGPIXELSY)
l = SetViewportExtEx(hDC, 10, 10, 0)
l = SetWindowExtEx(hDC, extX, extY, 0)
End Sub
Public Sub ResetFormScale(hDC)
Dim ii = SetMapMode(hDC, MM̲TEXT)End Sub
Sub AdCallBackProc(ByVal dwUser As Long)
Call DispWave(0)End Sub
Public Sub DispHoriScale()
Dim temp As Single
Dim unit As String
If horiScaleMode = 0 ThenfrmMain.SampleMin.Caption = "1"
frmMain.SampleCenter.Caption = LTrim(Str((adConfig.ulSmplNum + 1) / 2))
frmMain.SampleMax.Caption = LTrim(Str(adConfig.ulSmplNum))Else
If horiScaleAd = 1 Then
If adConfig.ulFastMode = AD̲NORMAL̲MODE Then
temp = 1 / adConfig.fSmplFreq * adConfig.ulSmplNum
Elsetemp = 1 / (adConfig.fSmplFreq * 2) * adConfig.ulSmplNum
End IfIf Int(temp) > 0 Thenunit = "[sec]"Else
If Int(temp * 1000) > 0 Thenunit = "[msec]"
temp = temp * 1000
Elseunit = "[μsec]"
temp = temp * 1000000
End IfEnd IffrmMain.SampleMin.Caption = "0" + unit + " " + LTrim(CStr(temp / 20)) + unit + "/DIV"
frmMain.SampleCenter.Caption = LTrim(CStr(temp / 2)) + unit
frmMain.SampleMax.Caption = LTrim(CStr(temp)) + unit
Else
If daMode.ulSamplingClock = DA̲CLOCK̲TIMER Then
temp = 1 / daConfig.fSmplFreq * adConfig.ulSmplNum
Elsetemp = 1 / 5000000 * adConfig.ulSmplNum
End IfIf Int(temp) > 0 Thenunit = "[sec]"Else
If Int(temp * 1000) > 0 Thenunit = "[msec]"
temp = temp * 1000
Elseunit = "[μsec]"
temp = temp * 1000000
End IfEnd IffrmMain.SampleMin.Caption = "0" + unit + " " + LTrim(CStr(temp / 20)) + unit + "/DIV"
frmMain.SampleCenter.Caption = LTrim(CStr(temp / 2)) + unit
frmMain.SampleMax.Caption = LTrim(CStr(temp)) + unit
End If- 118 -

End If
End Sub
Public Sub AdOpenSub()On Error GoTo ErrorHandler
Dim nRet As Long
Dim tmp As String
If adOpenFlag = 1 ThenBeep
frmMain.InfoBox.SelStart = Len(frmMain.InfoBox.Text) + 1
frmMain.InfoBox.SelText = vbCrLf & "A/D ‑ すでにオープンされています"
Exit SubEnd Iftmp = "FBIAD" + GetSetting(appName, "Open", "AdDevice", 1)nRet = AdOpen(tmp)
If nRet = ‑1 Then
Call AdDispErrMessage(nRet)
Else
frmMain.InfoBox.SelStart = Len(frmMain.InfoBox.Text) + 1
frmMain.InfoBox.SelText = vbCrLf & "A/D ‑ デバイスオープンＯＫ(DeviceHandle = " & Str(nRet) & ")"adOpenFlag = 1
adDeviceHandle = nRet
'ボード情報取得
nRet = AdGetDeviceInfo(adDeviceHandle, adInfo)
If nRet <> AD̲ERROR̲SUCCESS Then
Call AdDispErrMessage(nRet)
Else
frmMain.InfoBox.SelStart = Len(frmMain.InfoBox.Text) + 1
frmMain.InfoBox.SelText = vbCrLf & "A/D ‑ ボード情報取得ＯＫ"
End IfEnd IfExit Sub
ErrorHandler:
Beep
frmMain.InfoBox.SelStart = Len(frmMain.InfoBox.Text) + 1
frmMain.InfoBox.SelText = vbCrLf & "A/D ‑ 実行時エラーです"
End Sub
Public Sub DaOpenSub()On Error GoTo ErrorHandler
Dim nRet As Long
Dim tmp As String
If daOpenFlag = 1 ThenBeep
frmMain.InfoBox.SelStart = Len(frmMain.InfoBox.Text) + 1
frmMain.InfoBox.SelText = vbCrLf & "D/A ‑ すでにオープンされています"
Exit SubEnd Iftmp = "FBIDA" + GetSetting(appName, "Open", "DaDevice", 1)nRet = DaOpen(tmp)
If nRet = ‑1 Then
Call DaDispErrMessage(nRet)
Else
frmMain.InfoBox.SelStart = Len(frmMain.InfoBox.Text) + 1
frmMain.InfoBox.SelText = vbCrLf & "D/A ‑ デバイスオープンＯＫ(DeviceHandle = " & Str(nRet) & ")"daOpenFlag = 1
daDeviceHandle = nRet
'ボード情報取得
nRet = DaGetDeviceInfo(daDeviceHandle, daInfo)- 119 -

If nRet <> DA̲ERROR̲SUCCESS Then
Call DaDispErrMessage(nRet)
Else
frmMain.InfoBox.SelStart = Len(frmMain.InfoBox.Text) + 1
frmMain.InfoBox.SelText = vbCrLf & "D/A ‑ ボード情報取得ＯＫ"
End IfEnd IfExit Sub
ErrorHandler:
Beep
frmMain.InfoBox.SelStart = Len(frmMain.InfoBox.Text) + 1
frmMain.InfoBox.SelText = vbCrLf & "D/A ‑ 実行時エラーです"
End Sub
Public Sub DispWave(Review)
Dim adRealSampleNum As Long
Dim nRet As Long
Dim i As Long
Dim num As Long
Dim temp2 As Long
Dim temp3 As Long
Dim adVolt0 As Double
Dim daVolt0 As Double
Dim nowX As Double
Dim nowY As Double
Dim nextY As Double
Dim stepX As Double
Dim stepY As Double
Dim points(524288) As POINTAPI
Dim points2(10) As POINTAPI
Dim realHeight As Long
realHeight = frmMain.ViewBox.ScaleHeight ‑ 10
'波形描画
If frmMain.ViewBox.Visible = True ThenfrmMain.ViewBox.Cls
frmMain.ViewBox.DrawWidth = 1
For i = 1 To 9
frmMain.ViewBox.Line (0, realHeight / 10 * i)‑(frmMain.ViewBox.ScaleWidth, realHeight / 10 * i), RGB(100,100, 100)
Next i
For i = 1 To 19
frmMain.ViewBox.Line (frmMain.ViewBox.ScaleWidth / 20 * i, 0)‑(frmMain.ViewBox.ScaleWidth / 20 * i,realHeight), RGB(100, 100, 100)
Next ifrmMain.ViewBox.Line (0, realHeight / 2)‑(frmMain.ViewBox.ScaleWidth, realHeight / 2), RGB(255, 255,
255)
frmMain.ViewBox.Line (frmMain.ViewBox.ScaleWidth / 4, 0)‑(frmMain.ViewBox.ScaleWidth / 4, realHeight),
RGB(255, 255, 255)
frmMain.ViewBox.Line (frmMain.ViewBox.ScaleWidth / 4 * 3, 0)‑(frmMain.ViewBox.ScaleWidth / 4 * 3,
realHeight), RGB(255, 255, 255)
frmMain.ViewBox.Line (frmMain.ViewBox.ScaleWidth / 2, 0)‑(frmMain.ViewBox.ScaleWidth / 2, realHeight),
RGB(255, 255, 255)
Else
realHeight = frmMain.ViewBoxVV.ScaleHeight ‑ 10
frmMain.ViewBoxVV.Cls
frmMain.ViewBoxVV.ForeColor = &H323232
frmMain.ViewBoxVV.DrawWidth = Screen.TwipsPerPixelX
SetFormToTwips (frmMain.ViewBoxVV.hDC)
For i = 1 To 49
points2(0).X = 0
points2(0).Y = realHeight / 50 * i
points2(1).X = frmMain.ViewBoxVV.ScaleWidth- 120 -

points2(1).Y = realHeight / 50 * i
j% = Polyline(frmMain.ViewBoxVV.hDC, points2(0), 2)
points2(0).X = frmMain.ViewBoxVV.ScaleWidth / 50 * i
points2(0).Y = 0
points2(1).X = frmMain.ViewBoxVV.ScaleWidth / 50 * i
points2(1).Y = realHeight
j% = Polyline(frmMain.ViewBoxVV.hDC, points2(0), 2)
Next iResetFormScale (frmMain.ViewBoxVV.hDC)
frmMain.ViewBoxVV.DrawWidth = 1
For i = 1 To 4
frmMain.ViewBoxVV.Line (0, realHeight / 10 * i)‑(frmMain.ViewBoxVV.ScaleWidth, realHeight / 10 * i),
RGB(100, 100, 100)
Next i
For i = 6 To 9
frmMain.ViewBoxVV.Line (0, realHeight / 10 * i)‑(frmMain.ViewBoxVV.ScaleWidth, realHeight / 10 * i),
RGB(100, 100, 100)
Next i
For i = 1 To 4
frmMain.ViewBoxVV.Line (frmMain.ViewBoxVV.ScaleWidth / 10 * i, 0)‑(frmMain.ViewBoxVV.ScaleWidth / 10
* i, realHeight), RGB(100, 100, 100)
Next i
For i = 6 To 9
frmMain.ViewBoxVV.Line (frmMain.ViewBoxVV.ScaleWidth / 10 * i, 0)‑(frmMain.ViewBoxVV.ScaleWidth / 10
* i, realHeight), RGB(100, 100, 100)
Next ifrmMain.ViewBoxVV.Line (0, realHeight / 2)‑(frmMain.ViewBoxVV.ScaleWidth, realHeight / 2), RGB(255,
255, 255)
frmMain.ViewBoxVV.Line (frmMain.ViewBoxVV.ScaleWidth / 2, 0)‑(frmMain.ViewBoxVV.ScaleWidth / 2,
realHeight), RGB(255, 255, 255)
End IfIf frmMain.ViewBox.Visible = True Then
realHeight = frmMain.ViewBox.ScaleHeight ‑ 10
'D/A 描画処理
Select Case daMode.ModeChReq(0).ulRange
Case DA̲RANGE̲BIPOLAR
daVolt0 = (realHeight / 2) * ((daVmin / vMinNum) + 1)
stepY = (realHeight ‑ ((realHeight ‑ daVolt0) * 2)) / 4096
Case DA̲RANGE̲UNIPOLAR
If vMinNum = 0 ThendaVolt0 = realHeightstepY = ((daVmax / vMaxNum) * daVolt0) / 4096
Else
daVolt0 = realHeight / 2
stepY = ((daVmax / vMaxNum) * daVolt0) / 4096
End IfEnd SelectnowX = 0
stepX = frmMain.ViewBox.ScaleWidth / (adConfig.ulSmplNum ‑ 1)
frmMain.ViewBox.ForeColor = &HC0C000
frmMain.ViewBox.DrawWidth = Screen.TwipsPerPixelX * Val(frmMain.DrawOptionLineWidth.Text)
If frmMain.opImg.Value = True Then
For i = 0 To adConfig.ulSmplNum ‑ 1
points(i).Y = daVolt0 ‑ (daData(i) * stepY)
points(i).X = nowX
nowX = nowX + stepX
Next iElse
For i = 0 To adConfig.ulSmplNum ‑ 1
points(i).Y = daVolt0 ‑ (adData(i * 2 + 1) * stepY)
points(i).X = nowX
nowX = nowX + stepX
Next iEnd IfIf adConfig.ulSmplNum < 16384 Then

- 121 -

SetFormToTwips (frmMain.ViewBox.hDC)
j% = Polyline(frmMain.ViewBox.hDC, points(0), adConfig.ulSmplNum)
ResetFormScale (frmMain.ViewBox.hDC)
Else
temp3 = adConfig.ulSmplNum Mod 16383
temp2 = (adConfig.ulSmplNum ‑ temp3) / 16383
For i = 1 To temp2
SetFormToTwips (frmMain.ViewBox.hDC)
j% = Polyline(frmMain.ViewBox.hDC, points((i ‑ 1) * 16383), 16383)
ResetFormScale (frmMain.ViewBox.hDC)
Next iSetFormToTwips (frmMain.ViewBox.hDC)
j% = Polyline(frmMain.ViewBox.hDC, points(16383 * temp2 ‑ 1), temp3 + 1)
ResetFormScale (frmMain.ViewBox.hDC)
End If'A/D 描画処理
If adConfig.SmplChReq(0).ulRange And &HF0000 ThenadVolt0 = (realHeight / 2) * ((adVmin / vMinNum) + 1)
stepY = (realHeight ‑ ((realHeight ‑ adVolt0) * 2)) / 4096
Else
If vMinNum = 0 ThenadVolt0 = realHeightstepY = ((adVmax / vMaxNum) * adVolt0) / 4096
Else
adVolt0 = realHeight / 2
stepY = ((adVmax / vMaxNum) * adVolt0) / 4096
End IfEnd IfnowX = 0
stepX = frmMain.ViewBox.ScaleWidth / (adConfig.ulSmplNum ‑ 1)
frmMain.ViewBox.ForeColor = &HFF00&
frmMain.ViewBox.DrawWidth = Screen.TwipsPerPixelX * Val(frmMain.DrawOptionLineWidth.Text)
For i = 0 To adConfig.ulSmplNum ‑ 1
points(i).Y = adVolt0 ‑ (adData(i * 2) * stepY)
points(i).X = nowX
nowX = nowX + stepX
Next iIf adConfig.ulSmplNum < 16384 Then
SetFormToTwips (frmMain.ViewBox.hDC)
j% = Polyline(frmMain.ViewBox.hDC, points(0), adConfig.ulSmplNum)
ResetFormScale (frmMain.ViewBox.hDC)
Else
temp3 = adConfig.ulSmplNum Mod 16383
temp2 = (adConfig.ulSmplNum ‑ temp3) / 16383
For i = 1 To temp2
SetFormToTwips (frmMain.ViewBox.hDC)
j% = Polyline(frmMain.ViewBox.hDC, points((i ‑ 1) * 16383), 16383)
ResetFormScale (frmMain.ViewBox.hDC)
Next iSetFormToTwips (frmMain.ViewBox.hDC)
j% = Polyline(frmMain.ViewBox.hDC, points(16383 * temp2 ‑ 1), temp3 + 1)
ResetFormScale (frmMain.ViewBox.hDC)
End IfElse
realHeight = frmMain.ViewBoxVV.ScaleHeight ‑ 10
stepX = frmMain.ViewBoxVV.ScaleWidth / 4096
stepY = realHeight / 4096
frmMain.ViewBoxVV.ForeColor = &HFF00&
frmMain.ViewBoxVV.DrawWidth = Screen.TwipsPerPixelX * Val(frmMain.DrawOptionLineWidth.Text)
If frmMain.DrawModeLine.Value = 1 ThenIf frmMain.opImg.Value = True Then
For i = 0 To adConfig.ulSmplNum ‑ 1
points(i).X = daData(i) * stepX
points(i).Y = realHeight ‑ (adData(i * 2) * stepY)- 122 -

Next iElse
For i = 0 To adConfig.ulSmplNum ‑ 1
points(i).X = adData(i * 2 + 1) * stepX
points(i).Y = realHeight ‑ (adData(i * 2) * stepY)
Next iEnd IfIf adConfig.ulSmplNum < 16384 Then
SetFormToTwips (frmMain.ViewBoxVV.hDC)
j% = Polyline(frmMain.ViewBoxVV.hDC, points(0), adConfig.ulSmplNum)
ResetFormScale (frmMain.ViewBoxVV.hDC)
Else
temp3 = adConfig.ulSmplNum Mod 16383
temp2 = (adConfig.ulSmplNum ‑ temp3) / 16383
For i = 1 To temp2
SetFormToTwips (frmMain.ViewBoxVV.hDC)
j% = Polyline(frmMain.ViewBoxVV.hDC, points((i ‑ 1) * 16383), 16383)
ResetFormScale (frmMain.ViewBoxVV.hDC)
Next iSetFormToTwips (frmMain.ViewBoxVV.hDC)
j% = Polyline(frmMain.ViewBoxVV.hDC, points(16383 * temp2 ‑ 1), temp3 + 1)
ResetFormScale (frmMain.ViewBoxVV.hDC)
End IfEnd IfIf frmMain.DrawModeDot.Value = 1 ThenfrmMain.ViewBoxVV.DrawWidth = Val(frmMain.DrawOptionDotWidth.Text)
If frmMain.opImg.Value = True Then
For i = 0 To adConfig.ulSmplNum ‑ 1
frmMain.ViewBoxVV.PSet (daData(i) * stepX, realHeight ‑ (adData(i * 2) * stepY))
Next iElse
For i = 0 To adConfig.ulSmplNum ‑ 1
frmMain.ViewBoxVV.PSet (adData(i * 2 + 1) * stepX, realHeight ‑ (adData(i * 2) * stepY))
Next iEnd IffrmMain.ViewBoxVV.DrawWidth = 1
End IfEnd IfEnd Sub
Sub DaCallBackProc(ByVal dwUser As Long)
Call DispWave(0)End Sub'最初に実行されるプロシージャ
Private Sub Main()'2 重起動防止
If App.PrevInstance Then
Exit SubEnd If' 見出し画面を表示。
frmSplash.Show
frmSplash.Refresh
frmSplash.Timer1.Enabled = True
Do While Timetimer = 0
DoEvents
Loop' メイン フォームを表示し、見出し画面をアンロード。
frmMain.Show
Unload frmSplash
End Sub- 123 -