background image

com_SetDigitalByte

This function sets or clears a byte on a digital output line by Serial Port.

Declaration

BOOL 

com_SetDigitalByte ( HANDLE hDevice,

   DWORD 

dwPort, 

   BYTE 

byPortState

 

 

 

);

Parameters

hDevice   

A valid device handle, previously obtained from com_OpenDevice

dwPort   

The index of the port on the card to manipulate. The first port has index 0. For  

 

 

more information, please see “Write Address Table” following below.

byPortState 

The new state of the port

Return value

TRUE if successful, FALSE otherwise.

If an error occurred, GetLastError() may return the following values:

ERROR_INVALID_PARAMETER - The handle passed was invalid, or the port number was out of 

range for the device selected.

Example

HANDLE hDevice = com_OpenDevice(0x01,0); 

if (hDevice != INVALID_HANDLE_VALUE)

{

com_SetDigitalByte( hDevice, 0, 0xFF); // set’s all bits on the first port 

com_CloseDevice(hDevice);

}

Remarks

Please see “Serial_Communication.pdf” to set hardware for serial communication, and USB_LAB

-

KIT, USB_STARTER, USB_8PR are not supported by serial communication.

Summary of Contents for UHRO-16

Page 1: ...d Version 16 photo couple input 16 relay output channels Product Code AUSB16P R USB 16 PHOTO ISO RELAY BOARD DECISION COMPUTER J rgen Merz e K Lengericher Str 21 49536 Lienen Telefon 49 0 5483 77002 T...

Page 2: ...oftware Driver Windows will use HID interface and sample for program ming Linux driver and sample for programming Package includes the following items USB 16PR Board USB cable Software and Manual CD T...

Page 3: ...ust be 5V external DC It is to pay attention to correct polarity Otherwise the product could be damaged If the board is by wrong power supply except function you can try new store the firmware The U E...

Page 4: ...below 4 8V for USB I O board it can t work normally and sometimes it will cause device manager keeping refreshing itself or can t recognize the device To reset the hanging USB Module Set different ID...

Page 5: ...1 IN0 Opto isolator Ch 00 Input 2 IN0 Opto isolator Ch 00 Input 3 IN1 Opto isolator Ch 01 Input 4 IN1 Opto isolator Ch 01 Input 5 IN2 Opto isolator Ch 02 Input 6 IN2 Opto isolator Ch 02 Input 7 IN3 Op...

Page 6: ...1 Relay Ch 01 Output 5 NO 2 Relay Ch 02 Output 6 COM 2 Relay Ch 02 Output 7 NO 3 Relay Ch 03 Output 8 COM 3 Relay Ch 03 Output 9 NO 4 Relay Ch 04 Output 10 COM 4 Relay Ch 04 Output 11 NO 5 Relay Ch 05...

Page 7: ...er installation is required The functions for access and control of HID hid dll you can find in the Windows System32 folder 1 Power supply 5V connect 2 USB connect 3 USB input device device driver sof...

Page 8: ...unction is only implemented in USBLABKIT Linux Support dcihid 0 5 1 Basic function library and demo program 2009 05 01 This package includes a c library and a demo program which is develo ped by Decis...

Page 9: ...te the hex file and then press the Download button to update firmware 6 Set Board Id between 0 14 and press Reset button and connect PC again The remote control of Decision USB products by LAN or wire...

Page 10: ......

Page 11: ......

Page 12: ......

Page 13: ......

Page 14: ...ts in materials and workmanship and be fully functional under normal usage In the event of the failure of a SmartLab product within the specified warranty period SmartLab will at its option replace or...

Page 15: ...oducts Users Manual Design Implementation by Decision Computer International Company No parts of this documentation may be reproduced or transmitted in any form by any means electronic photocopying re...

Page 16: ...tions to open and close Devices 7 6 Functions for digital input output 10 7 Functions for reset hardware device 16 8 Functions for analog input output 17 9 Functions for watch dog 18 10 Using USBDII w...

Page 17: ...created to provide a standard way to access the functionality provided by all USB data acquisition products Specifically the USBDII provides the following features Platform independent The library is...

Page 18: ...a types used may not be present in the programming language you want to use Please find the following data type conversion table for your convenience HANDLE An opaque 32 bit integer BYTE A 8 bit unsig...

Page 19: ...ee Device Type Table ID Table following below Return value A valid handle representing the device or INVALID_HANDLE_VALUE 1 if an error occurred For USB_STARTER there is no ID selection and device_id...

Page 20: ...ters device_type The type of the device to open device_id Device s id on the board For more information please see Device Type Table ID Table following below port_num Com Port Num to open Return value...

Page 21: ...eDevice hDevice Remarks Please see Serial_Communication pdf to set hardware for serial communication and USB_LAB KIT USB_STARTER USB_8PR are not supported by serial communication Device Type Table Pro...

Page 22: ...3 4 OFF 0 2 3 4 OFF 1 ON 1 1 3 4 OFF 2 ON 2 3 4 OFF 1 2 ON 3 1 2 4 OFF 3 ON 4 2 4 OFF 1 3 ON 5 1 4 OFF 2 3 ON 6 4 OFF 2 3 4 ON 7 1 2 3 OFF 4 ON 8 2 3 OFF 1 4 ON 9 1 3 OFF 2 4 ON 10 3 OFF 1 2 4 ON 11 1...

Page 23: ...nipulate The first port has index 0 For more information please see Write Address Table following below byPortState The new state of the port Return value TRUE if successful FALSE otherwise If an erro...

Page 24: ...elow byPortState The new state of the port Return value TRUE if successful FALSE otherwise If an error occurred GetLastError may return the following values ERROR_INVALID_PARAMETER The handle passed w...

Page 25: ...PR 0x01 OUT07 to OUT00 0x02 DIO7 to DIO0 0x03 DIO15 to DIO8 USB_4PR 0x02 OUT03 to OUT00 USB_8RO 0x02 OUT07 to OUT00 USB_16RO 0x02 OUT07 to OUT00 0x03 OUT15 to OUT08 USB_32RO 0x00 OUT07 to OUT00 0x01 O...

Page 26: ...more information please see Read Address Table following below lpbyPortState A pointer to a variable of type BYTE receiving the new state of the port Return value TRUE if successful FALSE otherwise I...

Page 27: ...pointer to a variable of type BYTE receiving the new state of the port Return value TRUE if successful FALSE otherwise If an error occurred GetLastError may return the following values ERROR_INVALID_P...

Page 28: ...08 USB_8PR 0x00 IN07 to IN00 0x02 DIO7 to DIO0 0x03 DIO15 to DIO8 0x10 JP9 JP10 Settings USB_4PR 0x00 IN03 to IN00 USB_8PI 0x00 IN07 to IN00 USB_16PI 0x00 IN07 to IN00 0x01 IN15 to IN08 USB_32PI 0x00...

Page 29: ...output It can be defined by Jumper 10 and Jumper 11 on the board And we can use hid_GetDigitalByte com_GetDigitalByte function to read Jumper State to determine witch port is either input or output hi...

Page 30: ...aration BOOL hid_ResetHW HANDLE hDevice Parameters hDevice A valid device handle Return value TRUE if successful FALSE otherwise Example hid_ResetHW hDevice com_ResetHW This function directly resets t...

Page 31: ...e A pointer to a variable of type DWORD receiving the new state of the port Return value TRUE if successful FALSE otherwise If an error occurred GetLastError may return the following values ERROR_INVA...

Page 32: ......

Page 33: ......

Page 34: ......

Page 35: ......

Page 36: ......

Page 37: ......

Page 38: ......

Page 39: ......

Page 40: ......

Reviews: