11-23-2009 03:06 PM
Hello!I wish to write the program allowing to read and write abf files. For this purpose on a site http://www.moleculardevices.com/home.html has downloaded library dll - Axabffio32.dll. The problem following - how with Call Library Function Node to describe function ABF_ReadOpen:
#include "abffiles.h"BOOL ABF_ReadOpen( char *szFileName, int *phFile, UINT uFlags,ABFFileHeader *pFH, UINT *puMaxSamples,DWORD *pdwMaxEpi, int *pnError );Opens an existing ABF data file for reading. Reads the acquisition parameters from the file header into the passed ABFFileHeader structure.Parameter szFileName Name of data file to open. phFile Pointer to ABF file handle of this file. uFlags Flag to indicate whether file is parameter file or not. pFH Pointer to acquisition parameters read from data file. puMaxSamples Pointer to requested size of data blocks to be returned. pdwMaxEpi Pointer to number of sweeps that exist in the data file. pnError Address of error return code. May be NULL.
The ABF_ReadOpen function opens the data file szFileName, allocates an ABF file handle for it and assigns this number to *phFile. Data is read from the file header into *pFH. If ABF_PARAMFILE is set in uFlags then no further processing is performed, otherwise internal buffers are allocated in preparation for file reading.For ABF_GAPFREEFILE and ABF_VARLENEVENTS files, *puMaxSamples is passed in as a requested maximum size of the blocks of data returned by the ABF_ReadMultiplex and ABF_ReadChannel routines. For all modes, the actual value that will be used is returned in this location.For Event Detected modes, on calling ABF_ReadOpen, the parameter pdwMaxEpi points to a the maximum number of sweeps to read from the file. If it is zero the maximum will be 8192 sweeps, depending on RAM availability. The total number of data blocks of the size returned in *puMaxSamples is returned in *pdwMaxEpi.
I try do it as
int8_t ABF_ReadOpen(CStr *szFileName, int16_t *phFile, uint16_t uFlags, int32_t *pFH, uint16_t *puMaxSamples, int32_t *pdwMaxEpi, int16_t *pnError );
But it's not working.
Thanks.
11-23-2009 06:28 PM
What's not working? Is it crashing? Are you getting an error? The description indicates that you're supposed to pass in an ABFFileHeader structure. You don't seem to be doing this. You seem to simply be passing a pointer to an int. That's not the same thing. You need to create the cluster to match the struct and pass it in as "Adapt to Type".
11-23-2009 10:36 PM
hello _pavel_,
Instead using that dll,in labview there is a direct provision to read the *.abf files.Please go through this link.
"http://zone.ni.com/devzone/cda/epd/p/id/5979" .
Thanks and regards,
srikrishna.J
11-24-2009 03:46 AM
11-24-2009 09:08 AM
Did you take a look at the link provided by srikrishna?
Without looking at some code, I can't tell you what the problem is.
11-26-2009 12:15 PM
11-26-2009 02:49 PM
I find http://forums.ni.com/ni/board/message?board.id=170&message.id=374599&query.id=275356#M374599 , but I can't solve this problem.
I have found in the description that the file shares on blocks on 512 byte and in my file the data save since 16 blocks. In resulted vi the text with the data is used already. This data is arranged on 100 units of 628 times and are almost identical between cycles. On 200 byte of 628 times
11-26-2009 10:59 PM
11-27-2009 10:13 AM
Any supporting information should be posted to this thread so that others can provide help as well.
Tip: It is not wise to post your email address on a public forum. That makes it available to be culled by SPAMmers.
To OP: I have no idea what those VIs that you uploaded are supposed to do. They have nothing to do with reading/writing files. Why did you abandon the DLL approach? The file format seems quite complex, and you can try to write code from scratch, but given your level of expertise with LabVIEW, I don't think it will be straightforward for you. I think we need to look at your DLL code and the documentation for the library you were trying to use in the first place to see how difficult it would be to use from LabVIEW. It's quite possible that writing a simple wrapper DLL may be all that's required to get the library working with LabVIEW.
11-27-2009 11:01 AM
Thanks!
I can't download abf-file and help-file on this forum. You can download abf-file description and example abf-file here http://narod.ru/disk/15427779000/ABF.zip.html . Help-file is in help-folder. I try to write and read data without dll-library, because i know were write data-byte and where write information about length this data. If I will be use dll-library I will be need write a lot cluster with complex parameters. In this time I think, that it's hardly than my way.
Dear smercurio_fc, if you can help me solve this problem or you have some idea about solve it - write. Please not write some about me and my experience with LabView.