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.

*.cr* program modification


smile Jun 27, 2013 07:43 PM

Hello everyone,

does anyone know if is possible make simple edits of the program that is running on the CR basic logger without data loss? Example: Change the multiplier of a sensor.
This was possible with the old logger in terminal emulator and making sure compilation with * 6, there is a similar procedure for actual logger?

Many thanks

Regards

Smile


XxVashxX Jun 28, 2013 06:27 PM

I remember to read something in the manual, if im not wrong is possible but only if you dont change the data in the ouput table,

Maybe you can cheq the "run options" of the programs,i remember you have to select a different run option to this work.

Hope this help


kirving Jun 28, 2013 09:48 PM

No, the CRBasic loggers do not support this same functionality as the CR10X ones, but other methods can be used that are nearly equivalent. The '*6' command I think retained values in intermediate registers, and I do not think that is possible in CRBasic loggers however.

Instead of editing changes into the program directly, I'd recommend using the Constants Table to define multipliers and
so on as named constants. Entries in the Constants Table can be modified using the keypad or by other means, then when you save those changes the program is recompiled using the new values. When the program recompiles, all working memory (e.g., variable values, accumulated values in tables) is reset; i.e., it is closer to *0 than *6 on the older loggers.

If the changes made to Constant Table entries do not change the memory allocation -- e.g., table sizes are not changed -- then I've found this to be relatively safe in terms of preserving data already stored in table files on the logger. This would apply to changes to multipliers and offsets for instance.

If at all possible, I'd still recommend downloading the data just to be safe before making any changes, but would not expect changing a multiplier to cause already logged data to be lost.

I'd also recommend logging the program signature along with the data in tables in order to explicitly associate those data with a certain version of the program, or at least to flag when any changes to the program occur. That value can be copied into a variable, e.g., 'progSig=status.ProgSignature'. The program signature can be found in the header of logged data tables, but may not be representative of all the data if minor changes are made as described.


Sam Jul 1, 2013 04:14 AM

You can also try making the multiplier a Public variable. You can also use the "PreserveVariables" instruction to variable values across boots / power-ups.


XxVashxX Jul 1, 2013 04:40 PM

Sorry jijiji

I read something that i think will work, i read page 131 of the manual a of a CR1000:

9.2.1 Preserving data at program send

This could work somehow? sorry for the confusion

Regards


smile Jul 2, 2013 05:37 AM

Ok many thanks for the reply,

there are some more opportunities in the loggers with display and keypad (CR3000, CR850 or CR1000KD)? or logic does not change?

thanks again

Smile


Sam Nov 10, 2014 01:10 AM

Method 1:
* Changes to variables will take effect the next scan
* Use Table Monitor in Connect, LoggerLink, etc or use keyboard display to change multiplier and offset as needed

PreserveVariables

Public Reading
Public Multiplier = 1
Public Offset = 0

DataTable (Test,1,1000)
DataInterval (0,15,Sec,10)
Sample (1,Reading,IEEE4)
EndTable

BeginProg
Scan (1,Sec,0,0)
VoltSe (Reading,1,mV5000,1,1,0,250,Multiplier,Offset)
CallTable Test
NextScan
EndProg


Method 2:
* Program will recompile / restart when settings are applied
* Use datalogger terminal menu option "C" or use keyboard display's consttable constants editor to change multiplier and offset as needed

ConstTable
Const Multiplier = 1
Const Offset = 0
EndConstTable

Public Reading

DataTable (Test,1,1000)
DataInterval (0,15,Sec,10)
Sample (1,Reading,IEEE4)
EndTable

BeginProg
Scan (1,Sec,0,0)
VoltSe (Reading,1,mV5000,1,1,0,250,Multiplier,Offset)
CallTable Test
NextScan
EndProg


Method 3:
* Program will recompile / restart when settings are applied
Same as Method 2 above, but starting with OS 28 you can have the ConstTable show up in the Connect, LoggerLink, etc. table monitor by providing some additional parameters (NameOfConstTable,IsHiddenFlag). Kind of nice that you don't have to use a terminal or have a keyboard display. The Hidden flag will make the consttable behave like a user defined table containing the tablehide() function.


Example:
ConstTable(StationConfig,0)
Const Multiplier = 1
Const Offset = 0
EndConstTable

With each of these methods, your data will be retained. You have not made a change to the program table defs (i.e. change public or user defined table content) that will cause memory to be reallocated.

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