Our full technical support staff does not monitor this forum. If you need assistance from a member of our staff, please submit your question from the Ask a Question page.


Log in or register to post/reply in the forum.

CrBasic : Use an external file? Include()_like instruction?


Vigon Sep 22, 2011 11:32 AM

Hi all,

I'm looking for a way to use an external file. My goal is to create a "generic program" for 20 Cr1000 and modify the parameters (calibration constants, ports used, etc.) in external files.

I'm thus looking for a way to use an instruction like the PHP "include()".

Thanks in advance.


jra Sep 22, 2011 01:15 PM

Take a look at the CalFile instruction. From the help:
The CalFile instruction can also be used to write one or more stored calibration files to the datalogger's non-volatile flash memory. When the datalogger is powered up, all such files located in flash memory will be loaded into SDRAM memory, which can then be accessed by the program through the use of the CalFile instruction.

Let us know if that doesn't do it for you.

Janet


jtrauntvein Sep 22, 2011 04:03 PM

CRBasic also has an "Include" option as in the following:

Include "device:filename"

This instruction works like the C pre-processor #include directive and tells the compiler to include the contents of the specified file in the place of the Include statement. The downside to using this is the the program will not compile unless the file specified is present. This would mean that, for at least the first time, you would need to send at least two files to the datalogger before telling it to compile the program.

Log in or register to post/reply in the forum.