LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Read-Write ABF-Files

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. 


0 Kudos
Message 1 of 30
(6,067 Views)

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". 

0 Kudos
Message 2 of 30
(6,052 Views)

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

 

 

Regards,
Srikrishna


0 Kudos
Message 3 of 30
(6,042 Views)
I have Error 1097 with Call Library Function Node in ABF.vi . I try work with ABFFileHeader structure. 
0 Kudos
Message 4 of 30
(6,023 Views)

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. 

0 Kudos
Message 5 of 30
(6,014 Views)
Hello!I wish to make record abf-files, therefore variants of the program which has sent srikrishnaNF me do not arrange.I have decided not to work with dll, and have found as is written abf a file as bytes. As it is told in the description the data are written in a format "as multiplexed two-byte binary integers". What does it mean? I have written the program which reads out on two bytes from a file and translates them in type single, but I do not find numbers which are written in a file (read this value with OriginLab).
Download All
0 Kudos
Message 6 of 30
(5,988 Views)

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


0 Kudos
Message 7 of 30
(5,976 Views)

Hello _pavel_,

   Can you please send me the *.abf which you are trying to read.Because neither i could be able to find the file format details nor i could be able to find the files.My email is srikrishnajntu@gmail.com

 

 

Thanks and regards,

srikrishna J

 

Regards,
Srikrishna


0 Kudos
Message 8 of 30
(5,959 Views)

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. 

Message 9 of 30
(5,941 Views)

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 

0 Kudos
Message 10 of 30
(5,935 Views)