Navigation:  Reference > Functions >

DLLFunctionCall()

Print this Topic Previous pageReturn to chapter overviewNext page

 

DLLFC(1,2,3,...)

 

PURPOSE

This function allows you to make a function call directly into a previously loaded DLL.

 

PARTS

 

1 f/c/eRequired - The program number returned in the LOAD_DLL() function.

 

2 f/c/eRequired - The name of the function within the DLL.

 

3 f/c/eRequired - The type of the value returned by the function in the DLL.  It can be of type 'B','I','R','N','L', or a single character ('C').

 

4-9 f/c/eIf you want to pass values to the function they would be placed here.  You are limited to 6 values that can be passed.

 

       NOTE:  When these values are passed they are placed in a byte array.  This array is automatically set to the length required to contain all values.  The values are passed in their "internal" format.  This means if you are passing numeric ('N') type values, they are put in the array as 8 bytes, not as the ascii string values.  Also, the first two bytes of the array contains the total length of the array.

 

RETURN TYPE - 'B', 'I', 'R', 'N', 'L', or 'C' (a single character)

The return value is dependent on the value in option 3.  If the DLL is not found, or the function is not found then the return type will be L (logical) and the value will be False.

 

COMMENTS

Through the use of this function you should be able to write, or have written for you, routines that can accomplish anything that TAS doesn't do automatically.  An example of this would be to read serial ports for data that you want to use in a TAS program.  Or, if you need to write to a port to have something displayed, you could create a DLL that would accomplish that.  The possibilities are endless.  If you are now writing data to a file that is then read by a non-TAS program and written back to be used in the calling program you should consider replacing that with a DLL.  It's much safer and you don't have to worry about whether or not the data has been flushed to disk, etc.

 

NOTE:  The data passed to the DLL function is in a single byte array.  The calling style is set to CDECL.  However, since there is only one field being passed, it shouldn't matter.

 

NOTE: VERY IMPORTANT - Other than giving support in how to call a DLL we are not able to help you create them.  However, we should be able to give you a name of someone who can should you be interested in interfacing a DLL or a special piece of equipment, to a TAS program.

 

EXAMPLE

A set of sample programs have been included.  This includes the source code (written in Delphi) to the DLL itself.  The TAS programs are DLLTEST.DFM, DLLTEST.SRC and DLLTEST.RWN.  The Delphi code is DLLTEST.DPR, DLLTESTU.PAS and DLLTESTU.DCU.  The DLL itself is called DLLTEST.DLL.  The TAS programs expect it (the DLL) to be in the EXE subdirectory, which is where it's installed, however, this can be easily modified.  The rest of the programs are in a subdirectory off the main installation path called DLLTEST.

 

The Delphi code itself is very simple.  If you have any experience working with C or C++ you should be able to look at the DLLTESTU.PAS file and understand the basic workings of the call.  This example shows the use of multiple fields being passed and the modified data being passed back to the TAS program.

 

SEE ALSO

REMOVE_DLL()

 

NOTE : A good example of the use of this function would be with the TASXLS.DLL and the TASEXCEL.DLL these two DLL program are used to update or Write Excel Spreadsheet file. Very useful to add graphing capability's to  your TAS Professional programs.

for more information on these programs contact : Button

 

 


Page url: http://www.cassoftware.com/tas/manual/dllfunctioncall().htm