Super4_DLL_Readme

23-01-2008
(C) TCTEC Pty Ltd All rights reserved.
www.tctec.net

---------------------------------------------------


This file was included with the following dlls:

super4.dll	DLL for programming and control of Super4 USB Relay cards
FTD2XX.DLL:	FTDIChip dll required by super4.dll



super4.dll Usage:



The dll super4.dll contains the following functions:
----------------------------------------------------

int32_t ListRelays(char stringArray[][20]) 


	Search for attached TCTEC Super4 Relay boards.
	The stringArray will be filled with the names of the relay boards.
	stringArray must point to a 2 dimensional char array of dimensions [n][20]
	where n is the number of boards expected.
	
	Returns: 
         	The number of relay boards found or 0 if none found.





int32_t SetRelays(char* relayBoard, uint8_t mask, uint8_t set)



	Set or un-set the relays.
	The first 4 bits of the 'mask' determines which relays will be affected:
    	1 = relay will be affected
    	0 = leave alone (don't change)
    
	'set' determines whether the relay will be switched on or switched off.
	1 = relay on
	0 = relay off.

	example: To control relay 1 and 3 and leave relay 2 and 4 unchanged, mask = 5 (0101) 

	Returns:
		The state of the relays after the action.
		0 to 15:
		first 4 bits represent the relay states.
		1 = relay is on.
		0 = relay is off.
        
		A negative number indicates an error:
                   
		-1 invalid relay board string (board not found)
		-2 DLL function not loaded (FTD2XX.DLL not found)
		-3 Invalid bit mask (must be 0 to 15)
		-4 Undefined error 



int32_t dllversion()

	Returns the DLL version as an integer.
	Version 1.0 returns 10
	Version 2.3 returns 23
	etc



--------------------------------

Change Log
--------------------------------

23-01-2008	Version 1.0	
First release
