LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Issues when reading a binary file in LabVIEW PDA module.

I am trying to write to file a potentially large amount of data from a USB 6009 device on my PDA. So to optimize the DAQ read and file write functions, I am writing the data to file in binary format. That part of the code works fine. However, I would like to convert that file to text and add to it some data log information. However when I try to read the binary file, I get nothing. I have confirmed that the binary file does indeed contain the data, but the code in the PDA environment doesn't see it. I have used the exact code in the regular LabVIEW environment and it works fine. What gives?

Attached is the code. Any help would be appreciated. Also, I have problems when I change the file name. If I change the file name from the default and press the Start DAQ button, then system doesn't work properly.

Thanks
Doug Ferguson
0 Kudos
Message 1 of 10
(15,303 Views)
What exactly do you mean that the code in the PDA environment "doesn't see it". It doesn't recognize the file as being present? It doesn't see the data in the file?

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 2 of 10
(15,285 Views)
Might also be helpful to have some more error handling going on so you can see if errors are occurring...

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 3 of 10
(15,284 Views)
If you follow in my code, after the DAQ loop is done executing, the next sequence frame trys to open the binary file. However, nothing is read in by the read from binary file VI. I have dropped a data array indicator on the front panel to see the data being read. But the indcator is never filled. So I guessing that there my be some caveaught to the read from binary file in the PDA environment.
Doug Ferguson
0 Kudos
Message 4 of 10
(15,259 Views)
Are you absolutely sure that data is getting written to the file? The error cluster tying together the DAQ VIs and file write doesn't terminate in an error handler, so if an error occured it could prevent data from getting written to the file, but it would never be reported.

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 5 of 10
(15,250 Views)
I took another look at your code and made a simple change. I removed the sequence structure (which is redundant) and connected up the error cluster such that if an error occurs anywhere in the process it will be reported.

The only other thing I can think to try is wiring up the endian inputs on the write and read icons. They should be defaulting to the same thing, but you never know...

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 6 of 10
(15,238 Views)
I know the binary file is getting written, because I can remove the SD card (where I am writing the file) and open it, with the exact same code, on My Computer and its all there.

I knew the sequence was redundant, but I put it in at some point to make sure that the file didn't try to open, until the DAQ loop had quit.
Doug Ferguson
0 Kudos
Message 7 of 10
(15,188 Views)
Hi Doug,

It may be worth writing a very simple VI that just is responsible for reading your binary file, ensuring that the path is correct, and running it, and then checking the output. Are you not getting any errors from your error handler?

Which version of the PDA module is this, and which OS is the PDA running?

Best regards,
-Sam F, DAQ Marketing Manager
0 Kudos
Message 8 of 10
(14,912 Views)
I get no errors. Its like the file doesn't have any data. However it does.

I am running PDA 8.2 on a Accer n300 running on Windows Mobile 5.0.
Doug Ferguson
0 Kudos
Message 9 of 10
(14,890 Views)
As was mentioned earlier, have you tried making a small VI that just reads the binary file on your PDA?
Nick R
NI
0 Kudos
Message 10 of 10
(14,028 Views)