KYOWA PCD Series User manual

IM-A-731-C NOVEMBER 2008
SENSOR INTERFACE
PCD SERIES
CONTROLFUNCTION
INSTRUCTION MANUAL
Thank you for purchasing KYOWA’s product PCD SERIES SENSOR
INTERFACE.
Read this Instruction Manual carefully in order to make full use of the high
performance capabilities of the product.
Do not use the product in methods other than described in this Manual.
This Instruction Manual is related to method for controlling the PCD Series.
For details of Hardware and Software, customers are required to refer to the
respective Instruction Manuals.
Copyright © Kyowa Electronic Instruments Co., Ltd. All rights reserved.
Windows2000/XP/Vista are registered trademarks of the Microsoft Corporation US.
Generally, company names and trade names described in this Instruction Manual are trademarks or registered
trademarks of the companies.
This Instruction Manual may not be copied or reproduced, in whole or part, without consent of KYOWA.
The contents of the Instruction Manual are subjected to change without prior notice.

CONTENTS
1. INTRODUCTION .......................................................................................................................................................1
2. OPERATIONALENVIRONMENT..........................................................................................................................1
3. NECESSARY FILES...................................................................................................................................................1
4. CONTROLFUNCTION.............................................................................................................................................2
4-1 LIST OFFUNCTIONS..........................................................................................................................................................................2
4-1-1 Precautions on Functions..................................................................................................................................................................2
4-1-2 Basic Functions.................................................................................................................................................................................3
4-1-3 Individual Functions .........................................................................................................................................................................4
4-2 SPECIFICATIONS COMMON TO VARIOUS FUNCTIONS........................................................................................................5
4-2-1 Return Value of Function..................................................................................................................................................................5
4-2-2 PcdNo................................................................................................................................................................................................5
4-3 DETAILS OFBASIC FUNCTION......................................................................................................................................................6
4-3-1 PcdOpen............................................................................................................................................................................................6
4-3-2 PcdClose............................................................................................................................................................................................6
4-3-3 PcdSetOsc.........................................................................................................................................................................................6
4-3-4 PdSetSync .........................................................................................................................................................................................7
4-3-5 PdSetSamp........................................................................................................................................................................................7
4-3-6 PcdSetChParam.................................................................................................................................................................................8
4-3-7 PcdSetChParamEx............................................................................................................................................................................9
4-3-8 PcdMoniStart ..................................................................................................................................................................................11
4-3-9 PcdMoniStop...................................................................................................................................................................................11
4-3-10 PcdGetMoniData...........................................................................................................................................................................12
4-3-11 PcdStartAd ....................................................................................................................................................................................13
4-3-12 PcdStopAd ....................................................................................................................................................................................13
4-3-13 PcdGetMeasData...........................................................................................................................................................................14
4-3-14 PcdBalance....................................................................................................................................................................................16
4-3-15 PcdTest..........................................................................................................................................................................................17
4-3-16 PcdConnect...................................................................................................................................................................................18
4-3-17 PcdReadStatus...............................................................................................................................................................................18
4-3-18 PcdGetType...................................................................................................................................................................................19
4-3-19 Pcd_SetDataType..........................................................................................................................................................................20
4-3-20 Pcd_SetStorageMode....................................................................................................................................................................20
4-3-21 Pcd_GetStorageDataFloat.............................................................................................................................................................21
4-3-22 Pcd_CheckStorageData.................................................................................................................................................................21
4-3-23 Pcd_ClearStorageCount................................................................................................................................................................21
4-3-24 Pcd_GetMoniData.........................................................................................................................................................................22
4-4 DETAILS OFINDIVIDUALFUNCTIONS .....................................................................................................................................25
4-4-1 dPcdGetDevices..............................................................................................................................................................................25
4-4-2 dPcdStart.........................................................................................................................................................................................25
4-4-3 dPceStop..........................................................................................................................................................................................26
4-4-4 dPcdGetData...................................................................................................................................................................................27
4-4-5 dPcdGetStatus.................................................................................................................................................................................28
4-4-6 PcdSPD...........................................................................................................................................................................................28

2
4-4-7 PcdOMS..........................................................................................................................................................................................29
4-4-8 PcdCMS..........................................................................................................................................................................................30
4-4-9 PcdRNG..........................................................................................................................................................................................30
4-4-10 PcdFLT..........................................................................................................................................................................................31
4-4-11 PcdCUP.........................................................................................................................................................................................31
4-4-12 PcdTES .........................................................................................................................................................................................32
4-4-13 PcdTER.........................................................................................................................................................................................32
4-4-14 PcdBAL.........................................................................................................................................................................................33
4-4-15 PcdBAR........................................................................................................................................................................................33
4-4-16 PcdSTA .........................................................................................................................................................................................34
4-4-17 PcdSTP..........................................................................................................................................................................................34
4-4-18 PcdPRR.........................................................................................................................................................................................35
4-4-19 PcdERR.........................................................................................................................................................................................36
4-4-20 PcdECL.........................................................................................................................................................................................36
4-4-21 PcdCHK........................................................................................................................................................................................37
4-4-22 PcdCHR........................................................................................................................................................................................37
4-4-23 PcdDMS........................................................................................................................................................................................38
4-4-24 Pcd_MOD.....................................................................................................................................................................................39
4-4-25 Pcd_TED.......................................................................................................................................................................................39
4-4-26 Pcd_TEJ........................................................................................................................................................................................39
4-4-27 PcdPRR_Float...............................................................................................................................................................................40

1
1. INTRODUCTION
This Instruction Manual is related to necessary control functions for controlling the PCD-300A/320A(hereinafter
referred as the PCD-300A Series) and PCD-300B/PCD-300B-F/PCD-330B-F(hereinafter as the PCD-300B
Series) Sensor Interface (hereinafter referred to as the PCD) when users are creating their own control software.
Since the PCD is used by communicating with the PC via USB interface, it is essential that the control software
should be created with a program operated by Windows 2000/XP/Vista system. For creating the Windows
program, refer to the textbook of programming languages in use. All the control functions are included in PCD
specified Dynamic Link Library (hereinafter referred to as the DLL). Since no descriptions on methods for using
and calling the DLL are written in this Instruction Manual, refer to textbooks of the required programming
languages.
2. OPERATIONALENVIRONMENT
●OS Windows 2000 (Professional Edition only)
Windows XP(Home Edition and Professional Edition)
Windows Vista
●Memory 512 Mbyte or more (1 Gbyte or more is recommended)
3. NECESSARY FILES
1) PCD300B.SYS USB driver file for the PCD
When the PCD is connected to the PC for the first time, it is required to install the USB
driver to the Windows system.
For installing the USB driver, refer to the PCD Series Instruction Manual for USB Driver
Installation.
Note that this driver would not correctly operate if it is used from multiple application
programs at the same time. Always operate the PCD controlling application solely by
itself.
2) PCD300B.DLL Afile sending and receiving control commands to the PCD.
3) PCD.DLL Afile including PCD control functions.
All the functions called from the application program are included in this file.
Note that the PCD300B.DLL and PCD.DLL should be installed in the same directory
together with the application program. If these files are short, the application program
would not correctly operate.

2
4. CONTROLFUNCTION
The control function is roughly classified into 2 groups; basic function and individual function.
Features of the respective functions are described in the following.
Basic function • Capable of controlling the PCD to some extent with few control commands.
• Even if multiple PCD units are connected, there is scarcely no change in the control
method.
When multiple PCD units are connected, it is not available to separately control
each of the individual PCD units.
• The number of monitor data loaded at one time is limited to 6000 data/CH.
Individual function • Since control commands can be separately sent to and received from each of the
PCD units, detailed controls appropriate for the use are available.
• When multiple PCD units are connected, it is required to create a program by
considering the order of sending and receiving the control command.
• There is no limit when receiving the monitor data as the basic function.
4-1 LIST OFFUNCTIONS
4-1-1 Precautions on Functions
With the release of newly developed PCD-300B Series, simple precautions are described in the following.
●The newly developed functions are basically described with under lines to be differentiated from the existing
functions.
●Among newly developed functions, those especially related to the PCD-300B Series are as follows.
Basic Functions
• Pcd_SetDataType SetA/D data format
• Pcd_GetMoniData Obtain monitor data (Considering data assignment of short and long
types)
Individual Functions
• Pcd_MOD Set Meas mode.
• Pcd_TED Start loading TEDS information
• Pcd_TEJ Obtain TEDS information loaded results.
• PcdePRR_Float Load parameters (Return value: float type)
●Existing control functions added with specific functions of PCD-300B Series are as follows.
Basic Functions
• PcdSetChParam Set CH condition
• PceSetChParamEx Set CH condition
• PcdSetSamp Set sampling frequency
• PcdGetMoniData Obtain physical value monitor data
• PcdeGetMeasData Obtain monitor data
• PcdGetType Load PCD type
Individual Functions
• dPcdGetData Obtaining monitor data
• PcdRNG Set range
• PcdSPD Set sampling frequency
• PcdPRR Load parameters
• PcdDMS SetA/D data format

3
PCD control functions are listed in the following table.
4-1-2 Basic Functions
No.
Function Name Function Section
1 PcdOpen Initialize PCD.DLL. 4-3-1
2 PcdClose Close PCD.DLL. 4-3-2
3 PcdSetOsc Set oscillator. 4-3-3
4 PcdSetSync Set synchronous clock. 4-3-4
5 PcdSetSamp Set sampling frequency. 4-3-5
6 PcdSetChParam Set channel condition. (For physical value data) 4-3-6
7 PcdSetChParamEx Set channel condition. (For physical value data) 4-3-7
8 PcdMoniStart Start monitor. (For physical value data) 4-3-8
9 PcdMoniStop Stop monitor. (For physical value data) 4-3-9
10 PcdGetMoniData Obtain monitor data. (Physical value data) 4-3-10
11 PcdStartAd Start monitor. (For A/D data) 4-3-11
12 PcdStopAd Stop monitor. (ForA/D data) 4-3-12
13 PcdGetMeasData Obtain monitor data. (ForA/D data) 4-3-13
14 PcdBalance Conduct balance. 4-3-14
15 PcdTest Conduct self-test. 4-3-15
16 PcdConnect Load connected state. 4-3-16
17 PcdReadStatus Read status. 4-3-17
18 PcdGetType Read PCD type. 4-3-18
19 Pcd_SetStorageDataType SetA/D data format of the PCD. 4-3-19
20 Pcd_SetStorageMode Set storage mode. 4-3-20
21 Pcd_GetStorageDataFloat Obtain storage data. (Physical value converted value) 4-3-21
22 Pcd_CheckStorageData Check the number of storage data. 4-3-22
23 Pcd_ClearStorageCount Initialize the number of storage data. 4-3-23
24 Pcd_GetMoniData Obtain monitor data (For A/D data: PCD-300B
corresponding version) 4-3-24

4
4-1-3 Individual Functions
No.
Function Name Function Section
1 dPcdGetDevices Check connected state. 4-4-1
2 dPcdStart Start monitor. 4-4-2
3 dPcdStop Stop monitor. 4-4-3
4 dPcdGet Data Obtain monitor data. 4-4-4
5 dPcdGetStatus Obtain status. 4-4-5
6 PcdSPD Set sampling frequency. 4-4-6
7 PcdOMS Set oscillator. 4-4-7
8 PcdCMS Set synchronous clock. 4-4-8
9 PcdRNG Set range. 4-4-9
10 PcdFLT Set low pass filter. 4-4-10
11 PcdCUP Set high pass filter. 4-4-11
12 PcdTES Conduct self-test. 4-4-12
13 PcdTER Load self-test results. 4-4-13
14 PcdBAL Conduct balance. 4-4-14
15 PcdBAR Load balance results. 4-4-15
16 PcdSTA StartA/D conversion. 4-4-16
17 PcdSTP StopA/D conversion. 4-4-17
18 PcdPRR Load parameter. 4-4-18
19 PcdERR Load error. 4-4-19
20 PcdECL Clear error. 4-4-20
21 PcdCHK Conduct hardware check. 4-4-21
22 PcdCHR Load hardware check results 4-4-22
23 PcdDMS Set data format. 4-4-23
24 Pcd_MOD Set Mead mode. 4-4-24
25 Pcd_TED Start loading TEDS information. 4-4-25
26 Pcd_TEJ Obtain TEDS information loaded results. 4-4-26
27 PcdPRR_Float Load parameters 4-4-27

5
4-2 SPECIFICATIONS COMMON TO VARIOUS FUNCTIONS
4-2-1 Return Value of Function
1) Unless no descriptions are made, return values of various functions are set as follows.
0: Ends normally
-1: Command or parameter error
-2: No PCD is connected.
-3: No PCD300B.DLL exists.
-4: Windows system error.
-5: Communication error between the PCD
-6: Receive buffer over flow
-7: Setting not able because duringA/D
-8: PcdOpen is not conducted.
-9: Execution error becauseA/D is stopped
2) Return values of part of individual functions (starting with small letter ‘d’) are set as follows.
0x00000000 Ends normally
0xF0000001 Parameter error
0xF0000002 No PCD is connected
0xF0000003 Not responding from PCD
0xF0000004 Communication error between the PCD
0xF0000005 Receive buffer overflow
0xF0000006 Windows system error
0xF0000007 Windows system error
0xF0000008 Monitor data receive size error
4-2-2 PcdNo
Set PcdNo. of argument of various functions to a value subtracting 1 from the PCD No.
Ex.) PCD No. PcdNo.
1: 0
2: 1
3: 2
4: 3

6
4-3 DETAILS OFBASIC FUNCTION
4-3-1 PcdOpen
• Function Initializes the PCD.DLL.
Firstly, before using the PCD.DLL, it is required to call this function.
Or, no other functions are called.
• Definition __declspec(dllimport) long __stdcall PcdOpen(char *DllPath)
• Argument *DllPath Pathname of PCD.DLL
The size of pathname assignment should be 260 bytes or more.
If you are calling from the C language, please argument to NULL.
• Others Regarding the application program, when either basic or individual functions are used, it is
required to call this function PcdOpen for starting up and PcdClose, for closing.
4-3-2 PcdClose
• Function Closes the application program.
Call this function for closing the application program.
• Definition long_stdcall PcdClose(void)
• Argument None
• Others If the application program is closed without calling this PcdClose, Windows system hereafter
may become unstable.
4-3-3 PcdSetOsc
• Function Sets master/slave oscillator.
• Definition __declspec(dllimport) long __stdcall PcdSetOsc (long PcdNo, long Osc)
• Argument PcdNo Set PCD No. (0 to 3) for setting the oscillator.
Osc Oscillator
0: Slave
1: Master
• Others 1) Set the oscillator while stopping monitoring. No oscillator is set during monitoring.
When multiple PCD-300A units or PCD-300B Series are connected, always set one
PCD as a master unit and the rest of the PCD units as slave units. However, by setting
only the master PCD, settings of the PCD slaves can be omitted. In addition, it is
essential that the oscillator is correctly connected as well as synchronous cables are
properly wired.
2) When the PCD power is turned ON, although the PCD is set as a master unit, it is
required to set the oscillator once again before starting monitoring.
3) Setting of the oscillator is enabled only for the PCD-300Aand PCD-300B Series.
4) When only the PCD-300Aor PCD-300B Series is connected, setting of the synchronous
clock (PcdSetSync) can be omitted. At this time, the PCD that is set to the master of the
oscillator shall be a master of the synchronous clock.
5) When setting the synchronous clock, always set the oscillator before setting the
synchronous clock.
6) When the PCD-300B Series and PCD-300A Series are mixedly connected, always place
the PCD-300B Series ahead of the other PCD units and always set the PCD-300B Series
at the head as the master unit.
7) When PCD-300B Series and PCD-300A Series are mixedly connected, controlling the
PCD units are not available if connected by the following order.
×: PCD-300ASeries →PCD-300B Series
×: PCD-300B Series →PCD-300ASeries →PCD-300B Series
8) This function is set only as internal variable of the PCD.DLL and not sending the actual
command.

7
4-3-4 PdSetSync
• Function Sets synchronous clock.
• Definition __declspec(dllimport) long __stdcall PcdSetSync (long PcdNo. long Sync)
• Argument PcdNo Set PCD No. (0 to 3) for setting the synchronous clock.
Sync Synchronous clock
0: Slave
1: Master
• Others 1) Set the synchronous clock while stopping monitoring. No synchronous clock is set
during monitoring.
When multiple PCD units are connected, always set one PCD as a master unit and the
rest of the PCD units as slave units. However, by setting only the master PCD, settings
of the PCD slaves can be omitted. In addition, it is essential that the synchronous clock is
correctly connected as well as synchronous cables are properly wired.
2) When the PCD power is turned ON, although the PCD is set to a master unit, it is
required to set the synchronous clock once again before starting monitoring.
3) Set the oscillator before setting the synchronous clock.
4) When PCD-300B Series and PCD-300A Series are mixedly connected, always place the
PCD-300B Series ahead of the other PCD units and always set the PCD-300B Series at
the head as the master PCD unit.
5) This function is set only as internal variable of the PCD.DLL and not sending the actual
command.
4-3-5 PdSetSamp
• Function Sets sampling frequency.
• Definition __declspec(dllimport) long __stdcall PcdSet Samp(long Samp)
• Argument Samp Sampling frequency
1 1 Hz
2 2 Hz
5 5 Hz
10 10 Hz
20 20 Hz
50 50 Hz
100 100 Hz
200 200 Hz
500 500 Hz
1000 1 kHz
2000 2 kHz
5000 5 kHz
10000 10 kHz (Only for PCD-300BSeries)
• Others 1) Set sampling frequency while stopping monitoring. No sampling frequency is set during
monitoring.
2) When one PCD or multiple PCD-300B Series units are used and when controlling the
PCD units on Windows 2000, up to 5 kHz sampling frequency is available.
3) This function is only set as the internal variable of the PCD.DLL and not sending the
actual command.

8
4-3-6 PcdSetChParam
• Function Sets measuring conditions of channels of the PCD-300Aand PCD-300B, PCD-300B-T,
PCD-300B-H, PCD-300B-HT.
• Definition __declspec(dllimport) long __stdcall PcdSetChParam (long Ch ,long Range,
float Coeff, float, Offset)
• Argument Ch Channel No. (1 to 16)
Set PCD No. to PCD ID×4.
Ex.) When PCD ID is 1: Set channel Nos. from 1 to 4.
When PCD ID is 2: Set channel Nos. from 5 to 8.
Range Measuring range
0: OFF
1: 200 μm/m
2: 500 μm/m
3: 1000 μm/m
4: 2000 μm/m
5: 5000 μm/m
6: 10000 μm/m
7: 20000 μm/m (Only for PCD-300B,PCD-300B-T,
PCD-300B-H,PCD-300B-HT)
Coeff CAL coefficient
1.0e-8~1.0e8
When using PcdGetMeasData for obtaining monitor data with A/D data, set
‘1.0.’
Offset Offset
±1.0e-8 to 1.0e8
When using PcdGetMeasData for obtaining monitor data with A/D data, set
‘0.0.’
• Others 1) Set channel condition while stopping monitoring. No channel condition is set during
monitoring.
2) Not error if channel conditions of not connected PCD-300A and PCD-300B are set.
3) If this function is used for the PCD-320A, values of low pass filter and high pass filter are
set to OFF and 0.2 Hz, respectively.
4) This function P is set only as the internal variable of the PCD.DLL and not sending the
actual command.

9
4-3-7 PcdSetChParamEx
• Function Sets measuring conditions of channels.
• Definition __declspec(dllimport) long __stdcall PcdSetChParam (long Ch ,long Range, long Filter, long
Coupling, float Coef, float Offset)
• Argument Ch Channel No. (1 to 16)
Set PCD Nos. to PCD ID×4.
Ex.) When PCD ID is 1: Set channel No. from 1 to 4.
When PCD ID is 2: Set channel No. from 5 to 8.
Range Measuring range
PCD-300A PCD-320A
PCD-300B
PCD-330B Sries(Strain) PCD-330B Series(Voltage)
0: OFF OFF
1: 200 μm/m 1 V
2: 500 μm/m 2 V
3: 1000 μm/m 5 V
4: 2000 μm/m 10 V
5: 5000 μm/m 20 V
6: 10000 μm/m 50 V
7: 20000 μm/m (PCD-300B Series)
Filter Low pass filter (For PCD-320A/PCD-300B-F/PCD-330B Series)
For PCD-300Aand PCD-300B, set ‘0.’
PCD-320A PCD-300B-F
PCD-330B Series(Voltage) PCD-330B Series(Strain)
0: FLAT FLAT
1: 10 Hz 10 Hz
2: 30 Hz 30 Hz
3: 100 Hz 100 Hz
4: 300 Hz
Coupling High pass filter (For PCD-320A,PCD-330B Series)
For PCD-300Aand PCD-300B, set ‘0.’
0: OFF
1: 0.2 Hz
Coeff CAL coefficient
1.0e-8 to 1.0e8
When using PcdGetMeasData for obtaining monitor data with A/D data, set
‘1.0.’
Offset Offset
±1.0e-8~1.0e8
When using PcdGetMeasData for obtaining A/D value of monitor data, set
‘1.0.’
• Others 1) Set channel condition while stopping monitoring. No channel condition is set during
monitoring.
2) Not error if channel conditions of not connected PCD-300A and PCD-300B are set.

10
3) This function is set only as the internal variable of the PCD.DLL and not sending the
actual command.

11
4-3-8 PcdMoniStart
• Function Starts monitoring. (To obtain physical value data)
• Definition __declspec(dllimport) long __stdcall PcdMoniStart (void)
• Argument None
• Others 1) This function is used together with the following functions for obtaining physical value
monitor data.
2) This function is calling various functions such as dPcdStart, PcdOMS, PcdCMS,
PcdRNG, PcdFLT, PcdCUP, and PcdSTAinside this function.
4-3-9 PcdMoniStop
• Function Stops monitoring. (To obtain physical value data)
• Definition __declspec(dllimport) long __stdcall PcdMoniStop (void)
• Argument None
• Others 1) This function is used together with the following functions for obtaining physical value
monitor data.
PcdMoniStart and PcdGetMoniData
2) This function is calling functions dPcdStop and PcdSTPinside this function.

12
4-3-10 PcdGetMoniData
• Function Obtains physical value monitor data.
For application program, call this function within approximately 0.3 sec to obtain the
monitor data.
• Definition __declspec(dllimport) long __stdcall PcdGetMoniData (float *MeasData)
• Argument *MeasData Monitor data converted into physical value data from the preset range, CAL
coefficient, and offset.
Channel assignment is described in the following.
Ex.1) When only one PCD is connected.
CH01, CH2, CH3, CH4, CH1, CH2, CH3, CH4…..
Ex.2) When two PCD units are connected
CH1, CH2, CH3, CH4, CH5, CH6, CH7, CH8, CH1, CH2, CH3…..
The number of channel data obtained at one time is maximum 6000 data.
The size of float type MeasData alignment to be set on the application side is
required to have the ‘number of connected PCD units × 4CH × 6000.’
Ex.) When only one PCD is connected.
1 × 4 × 6000 = 24000
Therefore, it is required to define the data assignment to the
following.
float MeasData [24000]
If the size of data assignment is less than the above, the program
would not correctly operate and error occurs.
• Return Value Return value of this function slightly differs from those of the other functions.
0 or less: Return value of error. Contents are same as other functions.
-9: Returns ‘-9’when ring buffer becomes full.
0: Returns ‘0’when no monitor data exists.
1 or more: The number of data obtained per channel.
• Others 1) This function is used together with the following functions for obtaining physical value
monitor data.
PcdMoniStart and PcdfMoniStop
2) This function PcdGetMoniData can be used only during monitoring that is started by
PcdMoniStart.
3) When multiple PCD units are connected, this function is obtaining monitor data of all the
connected PCD units. Therefore, if there is any PCD not to be measured, turn OFF the
power or disconnect the USB cable.
4) No external input information and status of data are obtained from monitor data that is
obtained by this function. If it is required to obtain the above items, use functions
PcdStartAd, PcdGetMeasData, and PcdStopAd and obtain the monitor data.
5) This function is calling dPcdGetData inside this function.

13
4-3-11 PcdStartAd
• Function Starts monitoring. (To obtainA/D data)
• Definition __declspec(dllimport) long __stdcall PcdStartAd (long PcdNo.)
• Argument PcdNo. Set PCD ID No. for starting monitoring.
Unlike other functions, this function sets the PCD ID No.
0: Start monitoring of all the connected PCD units.
1 to 4: Start monitoring of only 1 preset PCD.
If multiple PCD units are connected, the number of channels
obtained with function PcdGetMeasData is 4 channels of one PCD.
• Others 1) This function is used together with the following functions for obtaining A/D value
monitor data.
PcdGetMeasData and PcdStopAd
2) This function is calling various functions such as dPcdStart, PcdSPD, PcdOMS, PcdCMS,
PcdRNG, and PcdSTAinside this function.
4-3-12 PcdStopAd
• Function Stops monitoring (For obtainingA/D data).
• Definition __declspec(dllimport) long __stdcall PcdStopAd (void)
• Argument None
• Others 1) This function is used together with the following functions for obtaining A/D value
monitor data.
PcdStartAd and PcdGetMeasData
2) This function is calling dPcdStop and PcdSTPinside this function.

14
4-3-13 PcdGetMeasData
• Function ObtainsA/D value monitor data.
For application program, call this function within an interval of approximately 0.3 sec to
obtain the desired monitor data.
• Definition __declspec(dllimport) long __stdcall PcdGetMeasData (short *MeasData)
• Argument *MeasData A/D data outputted from the PCD-300A/PCD-320A.
Channel assignment is described in the following.
Ex. 1) When only one PCD is connected
CH01, CH2, CH3, CH4, CH1, CH2, CH3, CH4·····
Ex. 2) When two PCD units are connected
CH1,CH2,CH3,CH4,CH5, CH6, CH7, CH8, CH1, CH2, CH3···
The number of channel data obtained at one time is maximum 6000 data.
The number of channel assignments of short type MeasData to be set on
application side is required to have the ‘number of connected PCD units
× 4CHs × 6000.’
Ex.) When only one PCD is connected
1 × 4 × 6000 = 24000
Therefore, it is required to define the number of channel assignments to
the following.
short MeasData [24000]
If the number of channel assignments is less than the above, the program
would not correctly operate and error occurs.
• Return Value Return value of this function differs from those of other functions.
0 or less: Return value when error occurred. Contents are same as other functions.
0: Returns ‘0’when no monitor data exists.
1 or more: The number of data obtained per channel.
• Others 1) This function is used together with the following functions for obtaining A/D monitor
data.
PcdStartAd and PcdStopAd
2) This function can be used only while monitoring that is started by PcdStartAd.
3) Monitor data obtained from the PCD is in the following 1-data/2-byte structure.
15 14 13 12 11 0
2’s complement
System reserve
System reserve
System reserve
External trigger bit
0: No external trigger
1: External trigger provided

15
4) How to convert data into physical value data
Full scaleA/D value of the PCD-300ASeries is ±2000 digits.
Therefore, physical value can be obtained by calculating range, CAL coefficient, and
offset in the following expression.
Physical value = Range/Full scaleA/D value (2000)×Meas data×CAL coefficient+Offset
Ex.) Suppose range: 200μm/m, Meas data: 1234, CAL coefficient: 2.0, and offset: 1.5
200/2000 × 1234 × 2.0 + 1.5 = 248.3
5) This function is calling dPcdGetData inside the function.
6) This function is corresponding to the PCD-300B later that the following data formats are
available. 12-bit A/D conversion data and Code extension 12-bit A/D conversion data,
and 16-bitA/D conversion data.

16
4-3-14 PcdBalance
• Function Conducts balance.
• Definition __declspec(dllimport) long __stdcall PcdBalance (long *BalCh,
longTotalBalCh, long *BalResult)
• Argument *BalCh Set balance channel assignment.
0: No balance is conducted.
Or no PCD-300Aor PCD-300BSeries is connected.
1: Conduct balance.
TotalBalCh Set the number of preset balance conducting channels.
*BalResult Balance results of the preset BalCh.
-1: No balance is conducted.
0: Balance OK
1: Resistance balance over
2: Range OFF
3: Capacity balance over
4: Connection failure
• Others 1) Conduct balance while stopping monitoring. No balance is conducted during monitoring.
2) PcdBalance would not return the processing to the application program unless balance is
completed or until error occurred.
Take care not to have the application program become time out.
3) Example of use 1) When only PCD ID = 1 is connected and balance is conducted for
only CHs 2 and 3.
long Balch[4]: ←Maximum PCD ID × 4 are required.
long TotalBalCh:
long BalResult [4]: ←Same size as BalCh
BalCh[0] = 0; BalCh[1] = 1; BalChj[2] = 1; BalCh[3] = 0;
TotalBalCh = 4; ←Set maximum PCD ID × 4
PcdBalance(&BalCH[0], TotalBalCh, &BalResult[0]);
4) Example of use 2) When PCD ID = 2 and 4 are connected and balance is conducted only
for CHs 5 and 16
long Balch[16]: ←Maximum PCD ID × 4 are required.
long TotalBalCh:
long BalResult [16]: ←Same size as BalCh
BalCh[0] = 0; BalCh[1] = 0; BalCh[2] = 0, BalCh[3] = 0;
BalCh[4] = 1; BalCh[5] = 0; BalCh[6] = 0, BalCh[7] = 0;
BalCh[8] = 0; BalCh[9] = 0; BalCh[10]= 0, BalCh[11] = 0;
BalCh[12] = 0; BalCh[13] = 0; BalCh[14] = 0, BalCh[15] = 1;
TotalBalCh = 16
PcdBalance(&BalCh[0], &TotalBalCh, &BalResult[0]);
5) Before conducting balance, set PcdSetOsc and PcdSetChParam.
6) This function is calling various functions such as PcdSetOMS, PcdRNG, PcdBAL, and
PcdBAR inside the function.

17
4-3-15 PcdTest
• Function Conducts self-test.
• Definition __declspec(dllimport) long __stdcall PcdTest (long *TesNo, long TotalTesNo,
long *TesResult)
• Argument *TesNo Set whether or not self-test is conducted for every PCD No.
0: No self-test is conducted
Or no PCD is connected.
1: Conduct self-test.
TotalTesNo Set the number of preset PCD units.
*TesResult Results of the self-test conducted for every channel.
-1: No self-test is conducted or no PCD is connected.
0: Normally completed.
1 or more Error occurred.
Since the self-test results are outputted for every channel, the number of the
self-test results assignments is required to be TotalTesNo × 4.
• Others 1) Conduct self-test while stopping monitoring. No self-test is conducted during monitoring.
2) The PcdTest would not return the processing to the application unless the self-test is
completed or error occurs.
Take care not to have the application program become timeout.
3) Example of use 1) When only PCD ID = 1 is connected.
long TestNo[1]: ←Maximum PCD ID
long TotalTestNo;
long TesResult[4]; ←TotalTesNo. × 4 are required
TestNo[0] = 1
TotalTestNo = 1 ←Set maximum PCD ID.
PcdTest (&TestNo.[0], TotalTesNo, &TesResult[0]);
4) Example of use 2) Although PCD ID = 2 and 4 are connected, self-test is conducted only
for PCD ID4.
long TesNo.[4]; ←Maximum PCD ID
long TotalTestNo;
long TesResult[16]; ←Total TestNo × 4 are required
TesNo[0] = 0; TesNo[1] = 0;TesNo[2] = 0,TesNo[3] = 1; TotalTesNo = 4;
PcdTest(&TesNo[0], TotalTesNo, &TesResult[0]);
5) Before conducting self-test, set PcdSetOsc.
6) This function is calling functions PcdOms, PcdTES, and PcdTER inside the function.
Table of contents
Other KYOWA Recording Equipment manuals