LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I use the a command from a .dll with labview?

I want to use for example the M8784Open() command to control an M8784 photon counter.  I know how to place a call library function node but don't know where to go there. The user manual for the photon counter has the following explanation of the M8784Open() command but I don't know how to use their advice in labview!

7-3-1 M8784Open( )
Declaration HANDLE M8784Open( BYTE Board );
Parameter
BYTE Board
Specify the board to be used: M8784_MASTER or M8784_SLAVE. Specify both when making 2-channel measurements simultaneously. It is not possible to specify M8784_SLAVE only.
Return value A handle for the M8784 is returned when the function has succeeded..
INVALID_HANDLE_VALUE is returned if the function has failed..
Explanation Calls a handle to allow the M8784API.dll to use the M8784.sys driver.
Hereafter, specify this API’s return value (handle) when using other APIs.
When quitting M8784 operation, call up M8784Close( ) to cancel the driver.
0 Kudos
Message 1 of 2
(2,179 Views)
You need to find out the equivalent number of the parameter. Somewhere in your documentation, or inside a file (for example, a header .h file in C/C++) you will find the definitions of each parameter.
 
For example, M8784_MASTER may have the value 1 and M8784_SLAVE the value of 2. You already know that it is a BYTE, so it will be a number of type U8 in LabVIEW. You need to find the exact values.
 
Probably, by value "A" it means the hex number "A", which is 10 in decimal. You need to find that in your documentation.
 
You also need to find the type HANDLE. It can be a BYTE, etc. Once you know that, find the value of INVALID_HANDLE_VALUE, so you can test for the error.
 
Most of this information can be found in the document Using External Code in LabVIEW. Check your help file, or check this link.
 
Regards;
Enrique

Message Edited by Enrique on 09-29-2005 10:36 AM

www.vartortech.com
0 Kudos
Message 2 of 2
(2,174 Views)