FieldPoint Family

cancel
Showing results for 
Search instead for 
Did you mean: 

cFP file

I I am writing a cFP code where the cFP will save some settings in a bunch of files.  I dont have the cFP 2120 yet but am writing the code ahead of time.  Are there any restrictions to this file IO.  There will be several files with 100-500Bytes each saved on the system.  Are there any gotchas to file IO on the cFP, such as creating files, file naming, File paths.  Can I just write to one level above the top level VI (2 in the executable code) and dor long names acceptable or is short (naming convention 8.3) naming required.  I am using the write/read binary file io under Labview 8.51.

Anyone have experience here?

 

Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
0 Kudos
Message 1 of 8
(7,710 Views)

Hi Paul,

If you are using the 21xx or 20xx series controllers that run the PharLap RTOS, for the most part, file I/O on your FieldPoint should be very similar to a normal computer. The main thing to watch out for with FieldPoint controllers is losing power when files are open. This can lead to corruption of the file allocation table which requires a format to repair. This can be mitigated with the use of a UPS. If you are planning on using the 22xx series controller then a different path format has to be used that is similar to unix style. I would recommend using the cFP-22xx controller if you can because it is the cheapest and fastest and the different file commands are easy to deal with. Feel free to post any additional questions you might have.

Eric A.
National Instruments
Distributed I/O Product Support Engineer
Message 2 of 8
(7,707 Views)
Power loss is not likely, this is an industrial system and is hardwired.  I do use the watchdog timer,  do I need to disable the watchdog durring file writes to prevent the system from auto rebooting?  The writes and reads from file are infrequent, reads at startup (should happen almost never) and the writes are to save new settings maybe a few times per day or much less.  Is the path strip method the same on the cFP2120? That is I want to wrate at the directory of the toplevel vi (durring coding lifecycle stage) or the directory of exe in normal operation.  Thanks for the halp.
Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
0 Kudos
Message 3 of 8
(7,703 Views)

Hi Paul,

I think all the file functions should behave the same way. I would suggest trying your file I/O techniques out on your controller when you receive it to make sure that  none of the directories get confused but you can expect the VIs to behave the same way. You should write your code in a way that ensures the file references are closed if your controller were to reboot so disabling the watchdog timer during file I/O would accomplish that.

Eric A.
National Instruments
Distributed I/O Product Support Engineer
0 Kudos
Message 4 of 8
(7,695 Views)

Hi!

   If you cyclically delete and create new files, I think you should consider fragmentation.  Of course, keeping file size similar and low would help about this.

 

   If you don't know exactly in advance the number of file your VI will create, consider some check of disk space left.  This works like on PC based labview apps.

 

   It's interesting to know that cFP-22xx behaves differently: we currently have code written for cFP-2020 and cFP-2120, and it's completely portable (exept performance problem with cFP-2020).

 

graziano

0 Kudos
Message 5 of 8
(7,663 Views)

Hi Paul,

 

Just wanted to see how things are progressingw ith you application. Have the suggestions been helpful?

Regards,
Claire Reid
National Instruments
0 Kudos
Message 6 of 8
(7,642 Views)

Thanks for all the suggestions.  I will have access to the cFP controller next week hopefuly late next week.  I have coded the app on the RT so that the application will read the configuration from the base dirrectory, and over write these files periodically (maybe several times a year)  there is 5-10 config files (log files) who should be 1 or 2k eact.  I think it is a good idea to check the free space on disk prior to writing the files.  Can this be done with the same vis as in windows or in the RTOS different.  As for defragmentation how does this work on a RTOS, wil;l it effect the control loops running on the cFP?  I should know how it all works out in a in November. Thanks to all,

 

 

Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
0 Kudos
Message 7 of 8
(7,635 Views)

Hey,

 

For checking the free-space on your rt system please see How Can I Programmatically Determine the Amount of Free Storage Space Available On My Real-Time Seri...

 

For defragmenting all I am able to find at the moment is Defragmenting an RT PXI Controller. I understand this isn't directly related, but thought it might help.

 

Let me know how things go!

Regards,
Claire Reid
National Instruments
0 Kudos
Message 8 of 8
(7,599 Views)