<Advme2607><Advme2607>
<Advme2607><Advme2607>
<Advme2607>
9
(5) ioctl( fd, function, arg )
Arguments int fd Allocate the file descriptor specified by open().
int function Allocate either of the following codes for specifying the function.
1. A-D conversion start
2. A-D conversion data acquisition select
The symbols are defined in ai2607.h.
int arg Allocate a functional parameter or parameter structure address.
1. When “AI_START_CH” is executed
Allocate an address of the STR_AI_START_CH structure to “arg”.
struct STR_AI_START_CH {
int from_ch;
int number_of_ch;
int handle;
int status;
}arg;
from_ch : Assign a starting number (0 to 1279 *1) of the consecutive channels
to execute data acquisition.
number_of_ch : Assign the number of channels for data acquisition (1 to 1280 *1).
handle : The identifier to be assigned for data read is returned.
status : The detail code is returned upon ERROR return.
-1 : Invalid channel number
-2 : Board with the assigned channel in A-D conversion
-3 : Insufficient internal resource
(*1) It varies with the number of Advme2607 boards installed.
2. When “AI_READ_CH” is executed
Allocate an identifier which is gotten with 1. AI_START_CH to “arg”.
Return value int OK : Normal completion
ERROR : Error
Function code execution
1. AI_START_CH
To acquire A-D conversion values on consecutive channels started with a specified channel,
this is for issuing the A-D conversion start command to a board with the relevant channel.
Code execution is insusceptible to specified consecutive channels spanning boards physically.
<Note>
Identifier internal resources are allocated upon executing the above function code, and the
resources are to be freed after the execution of read(). If repeated actions without executing
read() occur despite A-D start, many internal resources are consumed that causes insufficient
resources. read() must be called up for the number of A-D starts in the application.
All internal resources will be freed upon executing close().