FieldPoint Family

cancel
Showing results for 
Search instead for 
Did you mean: 

fieldpoint write to compact flash

We are acquiring sensor transmitter (4-20mA) data into cFP AI-110.  The data is then computed to flow totalizer data.  We would like to write the 'odometer' readings to a compact flash card such that when the cFP 2120 is shut down and then restarted it will initialize the shift registers with the last odometer readings.  Can someone point me to some example code or an app note?
Thanks,
Jim
0 Kudos
Message 1 of 5
(4,398 Views)
Hi Jim,
   Writing/reading on cFP compact flash is quite simple, it's really the same than writing to a File in Windows, so you have to use common "file open", "file write"etc... functions.

   The only thing to know, is that CF card is on drive D:/ (I'lll use windows-like format), and with MAX's File transfer visual utility you can't access it, you have to use a command-line FTP utility.

   If you need further explanation, please tell me!

  Have a nice week-end!

graziano
0 Kudos
Message 2 of 5
(4,391 Views)
I forgave..... of course, you have some limitation on CF cards, such as disk space, and, most important, number of write functions to a single sector.  Usually you can re-write a single sector something like 10k times, or more.  Thisi is a great number if you are performing a write to a sector each day, each month.... if you erase and rewrite a single sector twice a minute, you'll get troubles, and you have to use some tricky way to change writing sector (by implementing, for example, a circular file buffer, in wich you write new files for each access, and with a garbage collector), but this will be a next issue.....

graziano
0 Kudos
Message 3 of 5
(4,391 Views)

Hi Graziano,

Thanks for your help.  I am only looking to not loose previous grand totals.  Hence, I was thinking about a FIFO.  For example, File Write Total 1, File Write Total 2, etc.  The next iteration would simply nopt append but overwrite.  My RT application would then initialize shift registers with the last written values.  Does this logic sound right?

Also, I am concerned about the timing that you brought up.  The flow sensors acquire data in a WHILE running with a 1000 msec wait until next multiple.  It sounds like I can't write to the CF that fast.  How do I find out how fast I can write?  Also, what do you mean by number of write functions to a single sector?  Does that mean that a CF can only have its sectors written 10k times?  I am confused with your next comment about writing twice per minute...this sounds like access time to the CF is slow.  That is no problem, I could write once per hour or so while the acquisition loop is running.

Thanks again for your help.

JG

0 Kudos
Message 4 of 5
(4,382 Views)
Hi!
   CF access  is quite fast, the only thing is that each memory sector of CF card will fail after something like 10k times or 20k times you write it, so I suggest to write new files each time, so yopu change sector at each write, and you return to the first sectors only after a lot of time. Then you can overwrite files....

   Anyway, have you already tried to write to file? Does it works?

  Let me know.... I'll be back in 2 days, (I'll have to travel for work..).

   Have a nice day!

graziano

0 Kudos
Message 5 of 5
(4,350 Views)