FieldPoint Family

cancel
Showing results for 
Search instead for 
Did you mean: 

Flash consistency problem on FP-2015

I am performing Real Time data acquisition on FP-2015. The acquired data is stored in the embedded file system by writing 512 bytes arrays. In the files, data ranging from offset 2000h to 4000h do not correspond to the written data.
When tested on the develoment PC, the program gives the expected result (the file stored on the PC hard drive do not hexibit this behavior). Furthermore, I have tested a simple VI running on the Fieldpoint Controller which creates and completes a file with dummy data, and in this case the stored file isn't corrupted.

Thanks in advance.

The complete program is attached.
0 Kudos
Message 1 of 9
(4,216 Views)
Hello Gail,

Thank you for contacting National Instruments.

What do you mean when you say "data ranging from offset 2000h to 4000h do not correspond to the written data?" What does the "h" mean? How does the data differ from the written data?


Additionally, I dowloaded your VI and tried to run but was missing the Consistency Check.vi.

Please respond with more info and I will be glad to help you out.

Sincerely,

Sean C.
Applications Engineer
National Instruments
0 Kudos
Message 2 of 9
(4,216 Views)
I believe the "h" stands for hex.

Ames
0 Kudos
Message 3 of 9
(4,216 Views)
The h actually stands for hex...

As for the differences, data ranging from 2000h to 4000h hold previously written data : for instance if I write a file filled with 55h bytes, and then erase it, runnig the program will give a resulting file with 55h bytes from 2000h to 4000h.

The problem seems to come from the order in which the preamble of the file is written and the first 512 bytes blocks is reserved. I am still investigating it.

I join the missing file (Consistency check.vi)

Thanks in advance.
0 Kudos
Message 4 of 9
(4,216 Views)
Hello Gael,

Have you try to develop a simple example which stores continuously 512 blocks of bytes in a binary file and then reads the contents to compare and see if data could be corrupted?
If not, it means that the issue you described is not due to the CompactFlash of the FieldPoint controller but a programming issue instead.
Could you give me the steps needed for me to reproduce this behavior?
Thanks in advance for your answer.

Matthieu Gourssies
National Instruments France
0 Kudos
Message 5 of 9
(4,216 Views)
I have attached two simple example programs that can be tested. They start by creating a dummy file filled with a constant value which they then delete. The second step creates a new file and writes a preamble before filling the file with 512 bytes blocks of a different value. A third step compares the read content to the written one and signals a difference.

The first vi shows the described problem and the second one apparently "fixes" it but I don't see any reason why. The only difference is that the first 4 bytes write is placed either before or after the "EOF" vi call used to reserve the first 512 bytes (to preserve flash sectors alignment).

Thanks.
Download All
0 Kudos
Message 6 of 9
(4,216 Views)
Hello Gael,
I have quickly tested your examples on a FP-2010 and I have noted something strange in your programming. In step 1 of the 2 VIs (with & without issue), I added probes at the "Offset" output of the Seek and EOF VIs. There is a difference in the offset values between the 2 VIs, consequently data written in the binary file are not stored identically. In the VI "with issue", you start with a call to the "Write to file.vi". Do you know that headers are added automatically in binary files? (see the KB linked below).
* How Can I Write and Read Binary Files Using LabVIEW?
http://digital.ni.com/public.nsf/websearch/A45A757C14D3421986256BEA006C547A?OpenDocument

Hope this help.
Matthieu Gourssies
National instru
ments France
0 Kudos
Message 7 of 9
(4,216 Views)
I have tested this on my FP-2015 and on my PC, and I don't have the behaviour you described. When probing offset values at the outputs of Seek and EOF VI's, I always read 512. Moreover, regarding the header, I don't use them, I store the raw binary data and read it accordingly.

If the problem came from this point why would I have a different behaviour when running the program on a PC and on the FP-2015 ?

Thanks in advance,
Gaël ROBIN.
0 Kudos
Message 8 of 9
(4,216 Views)
Gael Robin,

I tried running your programs and didn't have a problem on my cFP-2020. Writing it either way didn't result in a consistency problem. Have you tried reformating the flash? See the following KB for instructions:

http://digital.ni.com/public.nsf/websearch/6D0F9F74FD2DAD0186256EE5007198D4?OpenDocument

Do you have a different controller you could try your programs on?

Ames
0 Kudos
Message 9 of 9
(4,216 Views)