Summary of Contents for Tews Technologies TPMC118-SW-95
Page 1
TPMC118-SW-95 QNX6-Neutrino Device Driver 6 Channel Motion Control User Manual Issue 1.0 Version 1.0.0 December 2002 TEWS TECHNOLOGIES GmbH TEWS TECHNOLOGIES LLC Am Bahnhof 7 25469 Halstenbek / Germany 1 E. Liberty Street, Sixth Floor Reno, Nevada 89504 / USA...
Page 2
However TEWS TECHNOLOGIES GmbH reserves the right to change the product described in this document at any time without notice. TEWS TECHNOLOGIES GmbH is not liable for any damage arising out of the application or use of the device described herein.
1 Introduction The TPMC118-SW-95 QNX6-Neutrino device driver allows the operation of a TPMC118 6 channel motion control PMC on QNX6-Neutrino operating systems. The driver only supports the standard variant TPMC118-10. The TPMC118 device driver is basically implemented as a user installable Resource Manager. The standard file (I/O) functions (open, close and devctl) provide the basic interface for opening and closing a file descriptor and for performing device I/O and control operations.
Build the example application 3. Change to the /usr/src/tpcm118/example directory 4. Execute the Makefile # make install After successful completion the example binary (tp118exam) will be installed in the /bin directory. TPMC118-SW-95 – QNX6 Neutrino Device Driver Page 5 of 30...
Start the TPMC118 Resource Manager with the –v option for debugging. Now the Resource Manager will print versatile information about TPMC118 configuration and command execution on the terminal window. tpmc118 –v & TPMC118-SW-95 – QNX6 Neutrino Device Driver Page 6 of 30...
–1 is returned. The global variable errno contains the detailed error code. ERRORS Returns only Neutrino specific error codes, see Neutrino Library Reference. SEE ALSO Library Reference - open() TPMC118-SW-95 – QNX6 Neutrino Device Driver Page 7 of 30...
The normal return value from close is 0. In the case of an error, a value of –1 is returned. The global variable errno contains the detailed error code. ERRORS Returns only Neutrino specific error code, see Neutrino Library Reference. SEE ALSO Library Reference - close() TPMC118-SW-95 – QNX6 Neutrino Device Driver Page 8 of 30...
Usually data_ptr points to a buffer that passes data between the user task and the driver and n_bytes defines the size of this buffer. The argument dev_info_ptr is unused for the TPMC118 driver and should be set to NULL. TPMC118-SW-95 – QNX6 Neutrino Device Driver Page 9 of 30...
Page 10
Returns only Neutrino specific error code, see Neutrino Library Reference. Other function dependent error codes will be described for each devoctl code separately. Note, the TPMC118 driver always returns standard QNX error codes. SEE ALSO Library Reference - devctl() TPMC118-SW-95 – QNX6 Neutrino Device Driver Page 10 of 30...
This argument specifies the encoder channel that shall be read. Valid values are 1 up to 6. value This parameter will return the actual value of the encoder. Before reading encoder values the channels shall be configured. TPMC118-SW-95 – QNX6 Neutrino Device Driver Page 11 of 30...
Page 12
Invalid argument. This error code is returned if either the size of the message buffer is too small, or the specified parameter is out of range. SEE ALSO Library Reference - devctl() TPMC118-SW-95 – QNX6 Neutrino Device Driver Page 12 of 30...
Bit 0 is advised to IN1, bit 1 is advised IN2 and so on. EXAMPLE result; TP118_READINP digBuf; ** read digital input value result = devctl( DCMD_TP118_READINP, &digBuf, sizeof(digBuf), NULL); if (result == EOK) /* successful read */ TPMC118-SW-95 – QNX6 Neutrino Device Driver Page 13 of 30...
Page 14
ERRORS EINVAL Invalid argument. This error code is returned if the size of the message buffer is too small. SEE ALSO Library Reference - devctl() TPMC118-SW-95 – QNX6 Neutrino Device Driver Page 14 of 30...
This argument specifies the analog output channel that shall be written. Valid values are 1 up to 6. value This parameter specifies the new analog output value. Valid values are between -32768 (-10V) and 32767 (~+10V). TPMC118-SW-95 – QNX6 Neutrino Device Driver Page 15 of 30...
Page 16
Invalid argument. This error code is returned if either the size of the message buffer is too small, or the specified parameter is out of range. SEE ALSO Library Reference - devctl() TPMC118-SW-95 – QNX6 Neutrino Device Driver Page 16 of 30...
This parameter specifies the new encoder resolution. Valid values are: Value Description TP118_ENCCNT_OFF The encoder channel is disabled TP118_ENCCNT_X1 The encoder counts in simple resolution TP118_ENCCNT_X2 The encoder counts in double resolution TP118_ENCCNT_X4 The encoder counts in quadruple resolution TPMC118-SW-95 – QNX6 Neutrino Device Driver Page 17 of 30...
Page 18
Invalid argument. This error code is returned if either the size of the message buffer is too small, or the specified parameter is out of range. SEE ALSO Library Reference - devctl() TPMC118-SW-95 – QNX6 Neutrino Device Driver Page 18 of 30...
This parameter specifies if the preload shall be executed immediately (only non referenced mode). Valid values are: Value Description TP118_FL_IMMPRLD The preload will be executed immediately if allowed. TP118_FL_NORMPRLD The value will be loaded into the preload register. TPMC118-SW-95 – QNX6 Neutrino Device Driver Page 19 of 30...
Page 20
Invalid argument. This error code is returned if either the size of the EINVAL message buffer is too small, or the specified parameter is out of range. SEE ALSO Library Reference - devctl() TPMC118-SW-95 – QNX6 Neutrino Device Driver Page 20 of 30...
The encoder will work in non reference mode TP118_ENC_REF The encoder will work in reference mode TP118_ENC_AUTOREF The encoder will work in auto reference mode TP118_ENC_INDEX The encoder will work in index mode TPMC118-SW-95 – QNX6 Neutrino Device Driver Page 21 of 30...
Page 22
Invalid argument. This error code is returned if either the size of the message buffer is too small, or the specified parameter is out of range. SEE ALSO Library Reference - devctl() TPMC118-SW-95 – QNX6 Neutrino Device Driver Page 22 of 30...
1 up to 6. EXAMPLE result; TP118_SYNC syncBuf; ** add channel 3 to synchronized mode syncBuf.channel = 3; result = devctl( DCMD_TP118_SYNCON, &syncBuf, sizeof(syncBuf), NULL); if (result == EOK) /* successful set */ TPMC118-SW-95 – QNX6 Neutrino Device Driver Page 23 of 30...
Page 24
Invalid argument. This error code is returned if either the size of the message buffer is too small, or the specified parameter is out of range. SEE ALSO Library Reference - devctl() TPMC118-SW-95 – QNX6 Neutrino Device Driver Page 24 of 30...
Valid values are 1 up to 6. EXAMPLE result; TP118_SYNC syncBuf; ** remove channel 3 from synchronized mode syncBuf.channel = 3; result = devctl( DCMD_TP118_SYNCOFF, &syncBuf, sizeof(syncBuf), NULL); if (result == EOK) /* successful removed */ TPMC118-SW-95 – QNX6 Neutrino Device Driver Page 25 of 30...
Page 26
Invalid argument. This error code is returned if either the size of the message buffer is too small, or the specified parameter is out of range. SEE ALSO Library Reference - devctl() TPMC118-SW-95 – QNX6 Neutrino Device Driver Page 26 of 30...
0 will be returned for this channel. The array index specifies the assigned channel. Index 0 specifies channel 1, index 1 specifies channel 2 and so on. TPMC118-SW-95 – QNX6 Neutrino Device Driver Page 27 of 30...
Page 28
%ld\n”, i + 1, syncRdBuf.value[i]; ERRORS EINVAL Invalid argument. This error code is returned if either the size of the message buffer is too small. SEE ALSO Library Reference - devctl() TPMC118-SW-95 – QNX6 Neutrino Device Driver Page 28 of 30...
The function will wait for a High to Low transition timeout This value specifies the time that shall be waited at maximum. The time is specified in seconds. If the specified time expires, the function will return with error. TPMC118-SW-95 – QNX6 Neutrino Device Driver Page 29 of 30...
Page 30
ETIMEDOUT The function has waited the specified time without the specified event occurring. SEE ALSO Library Reference - devctl() TPMC118-SW-95 – QNX6 Neutrino Device Driver Page 30 of 30...
Need help?
Do you have a question about the TPMC118-SW-95 and is the answer not in the manual?
Questions and answers