Welcome to the Temco Controls ftp directory. Here you will find software and documentation to work with our products. The site is broken down ito three main areas: Firmware: This directory contains the laetst firmware for the various temco products, as new functionality is added to our hardware, you can downlad from this directory to take advantage of the latest features. All Temco products can be updated in the field using only a PC and the RS485 connection. Software: This directory contains utilities and PC front end software for our various products. Also, and very unique to Temco Controls, we include the source code for our software so that integrators may quickly get up to speed and see working examples. Catalogs: Here are the catalogs in pdf format. Also the rather extensive documentation for our Modbus thermostats and I/O modules. Again, also fairly unique to Temco Controls, we provide several of these documents in their native file format so that our partners can build their brands. The format of these documents is Adobe In-Design, this is an industry standard typesetting program. ***************************************************************************************************** Now follows a more detailed description of the Software Directory: This directory contains all software in regular executable as well as source code format for our various software products. They are open source and you are free to use commercially without restriction. 1. The file 1ModbusDll.zip contains the source code and compiled code for DLL1 which is used with 'VBA'applicatons such as Word, Powerpoint, Excel and VB applications. 2. The file 2ModbusDll.zip contains the source code and compiled code for DLL2 which is used with VC applications. VB can also use this DLL. 3. The file 3Book2.xls shows one example of the Excell DLL1 usage. 4. The file 4ModbusDllForVBsetup.zip contains VB7 application in compiled form and the setup.exe installation program 5. The file 5ModbusDllTestForVB.zip contains source code for the VB7 application. 6. The file 6ModbusDllForVCsetup.zip contains VC7 application in compiled form and the setup.exe installation program 7. The file 7ModbusDllForVC Example.zip contains source code for the VC7 application. 8. This file contains the source code for our Tstat Manager application, the environment is VC7 2003 9. This is the Tstat Manager software application, our (rudimentary) front end for working with our Modbus thermostats. We're continually working on this application, adding functionality & features so be sure to check in from time to time for the latest version. Eventually this will be a full fledged building management system. ************************************************************************************************ Now follows a description of the DLL's and how to use them: 1ModbusDll was made using vc7. It can be used in VB7 and VBA(microsoft office application). 2ModbusDll was made using vc7. It can be used in VC7 and VB7. There are 7 functions contained in this Dll. bool open_com(TS_UC m_com); void close_com(); int Write_One(TS_UC device_var,TS_US address,TS_US value); int Read_One(TS_UC device_var,TS_US address); int write_multi(TS_UC device_var,TS_UC *to_write,TS_US start_address,int length); int read_multi(TS_UC device_var,TS_US *put_data_into_here,TS_US start_address,int length); bool is_connect(); 1.open_com function Used to open one com port - only used to configure the com port. It does not signify connection with tstat. The m_com parameter is a unsigned char. If m_com = 1,such as open_com(1),you will open "com1" port; If m_com = 2,such as open_com(2),you will open "com2" port; If m_com = 5,such as open_com(3),you will open "com5" port; If m_com = 7,such as open_com(7),you will open "com7" port; If m_com = 8,such as open_com(8),you will open "com8" port; You can't open "com9" port. The return value is true(vc = 1;vb = -1), for success. The return value is false(vc = 0;vb = 0 too),for failure. 2.close_com function Used to close the connection. This fucntion has no parameters. It is necessary to use this function when ending the program. 3.Write_One function Used to write one register at a time. The device_var parameter is the ID of Tstat. The address parameter is the register that you want to write The value parameter is the value that you want to write to the register. Return value = -1 means that the com port is occupied. Return value = -2 means failure, you should try again. Return value = 1 means success. Before you use this function,you must open the com port using the open_com function. 4.Read_One function Used to read one register at a time. The device_var parameter is the ID of Tstat. The address parameter is register that you want to read Return value = -1 means that the com port is occupied. Return value = -2 means failure, you should try again. Otherwise the return value is the value of the register. Before you use this function,you must open the com port using the open_com function. 5.write_multi function Used to write many registers at a time. The device_var parameter is the ID of Tstat. The to_write parameter is a pointer to the first value (unsigned char )that you want to write. The start_address parameter is the address of the first register that you want to write. The length parameter is the number of registers that will be written.(length>=1,and length<=128) Return value = -1 means that the com port is occupied. Return value = -2 means failure, you should try again. Return value = 1 means success. Before you use this function, you must open the com port using the open_com function. 6.read_multi function Used to read many registers at a time. The device_var parameter is the ID of Tstat. The put_data_into_here parameter is a pointer to the first value (unsigned short) where the data will be stored. The start_address parameter is the first register that you want to read. The length parameter is the number of registers that will be read.(length>=1,and length<=112) Return value = -1 means that the com port is occupied. Return value = -2 means failure, you should try again. Return value = 1 means success. Before you use this function, you must open the com port using the open_com function. 7.is_connect function Used to inspect the connection. Return value is true(vc = 1;vb = -1), for success. Return value is false(vc = 0;vb = 0 too), for failure. ----------------------------------------------------------------------------------------------- In VBA appliction, the functions can be declared like this: Private Declare Function open_com Lib "ModbusDll" (ByVal m_com As Integer) As Boolean Private Declare Sub close_com Lib "ModbusDll" () Private Declare Function is_connect Lib "ModbusDll" () As Boolean Private Declare Function Write_One Lib "ModbusDll" (ByVal device As Byte, ByVal address As Integer, ByVal value As Integer) As Integer Private Declare Function Read_One Lib "ModbusDll" (ByVal device As Byte, ByVal address As Integer) As Integer Private Declare Function read_multi Lib "ModbusDll" (ByVal device As Byte, ByRef put_data_into_here As Integer, ByVal start_address As Integer, ByVal length As Byte) As Integer Private Declare Function write_multi Lib "ModbusDll" (ByVal device As Byte, ByRef to_write As Byte, ByVal start_address As Integer, ByVal length As Byte) As Integer In VB application, the functions can be declared like this: Private Declare Function open_com Lib "ModbusDll.dll" (ByVal m_com As Integer) As Boolean Private Declare Sub close_com Lib "ModbusDll.dll" () Private Declare Function is_connect Lib "ModbusDll.dll" () As Boolean Private Declare Function Write_One Lib "ModbusDll.dll" (ByVal device As Byte, ByVal address As Integer, ByVal value As Integer) As Integer Private Declare Function Read_One Lib "ModbusDll.dll" (ByVal device As Byte, ByVal address As Integer) As Integer Private Declare Function read_multi Lib "ModbusDll.dll" (ByVal device As Byte, ByRef put_data_into_here As Int16, ByVal start_address As Short, ByVal length As Integer) As Integer Private Declare Function write_multi Lib "ModbusDll.dll" (ByVal device As Byte, ByRef to_write As Byte, ByVal start_address As Short, ByVal length As Integer) As Integer In VC application, the functions can be declared like this: #pragma comment(lib,"ModbusDllforVc.lib") extern "C" __declspec(dllimport) int Write_One(unsigned char device_var,unsigned short address,unsigned short value); extern "C" __declspec(dllimport) int Read_One(unsigned char device_var,unsigned short address); extern "C" __declspec(dllimport) int write_multi(unsigned char device_var,unsigned char *to_write,unsigned short start_address,int length); extern "C" __declspec(dllimport) int read_multi(unsigned char device_var,unsigned short *put_data_into_here,unsigned short start_address,int length); extern "C" __declspec(dllimport) bool open_com(unsigned char m_com); extern "C" __declspec(dllimport) void close_com(); extern "C" __declspec(dllimport) bool is_connect();