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.

Windows Runtime error when attempting to compile CR5000 program


fluxtech Nov 1, 2012 02:06 PM

I receive the following Windows Visual C++ error when trying to compile a CR5000 program in CRBasic:

Debug Error!
Program: C:/CampbellSci/Lib/Compilers/CR5Comp.exe
Module: C:/CampbellSci/Lib/Compilers/CR5Comp.exe
File:
Run-Time Check Failure #3- The variable 'off_val' is being used without being initialized.

After selecting "Ignore" the program will compile, but I'm having a problem with a multiplexer connected to this CR5000 that may or may not be associated with this error. The multiplexer works for days to weeks but stops cycling eventually, leading to fixed numbers from each of its output channels.

I tried downloading the most recent CR5000 OS files and restarting Loggernet to no avail.

Here is the code for the multiplexer instruction:
SlowSequence

Scan (5,sec,1,0)
'Turn on the AM16/32.
PortSet (5,TRUE)

'Clock the AM16/32A.
PulsePort (6,10000)
Delay (1,20,mSec)
VoltDiff (par(1),1,mV20,7,TRUE,450,250,1,0)

'Clock the AM16/32A.
PulsePort (6,10000)
Delay (1,20,mSec)
VoltDiff (NDVI(1),1,mV5000,7,TRUE,450,250,1,0)

'Clock the AM16/32A.
PulsePort (6,10000)
Delay (1,20,mSec)
VoltDiff (NDVI(2),1,mV5000,7,TRUE,450,250,1,0)

'Clock the AM16/32A.
PulsePort (6,10000)
Delay (1,20,mSec)
VoltDiff (NDVI(3),1,mV5000,7,TRUE,450,250,1,0)

'Clock the AM16/32A.
PulsePort (6,10000)
Delay (1,20,mSec)
VoltDiff (NDVI(4),1,mV5000,7,TRUE,450,250,1,0)

'Clock the AM16/32A.
PulsePort (6,10000)
Delay (1,20,mSec)
VoltDiff (NDVI(5),1,mV5000,7,TRUE,450,250,1,0)

'Clock the AM16/32A.
PulsePort (6,10000)
Delay (1,20,mSec)
VoltDiff (NDVI(6),1,mV5000,7,TRUE,450,250,1,0)

'Clock the AM16/32A.
PulsePort (6,10000)
Delay (1,20,mSec)
VoltDiff (NDVI(7),1,mV5000,7,TRUE,450,250,1,0)

'Clock the AM16/32A.
PulsePort (6,10000)
Delay (1,20,mSec)
VoltDiff (NDVI(8),1,mV5000,7,TRUE,450,250,1,0)

PulsePort (6,10000)
Delay (1,20,mSec)
TCDiff(TCAV,1,mV20C,7,TypeE,panelT_5000_in,True,200,250,1.0,0)

PulsePort (6,10000)
Delay (1,20,mSec)
VoltDiff (par(2),1,mV200,7,True,450,250,157.98,0)

PulsePort (6,10000)
Delay (1,20,mSec)
VoltDiff (shf(3),1,mV20,7,True,450,250,1,0)

'Turn off the AM16/32.
PortSet (5,FALSE)

dsble_flg_on_mux = FALSE
NextScan


Dana Nov 5, 2012 12:32 PM

What is the date reported by the precompiler for a program that will compile? (I ask because I copied your code above and it compiles fine once I add a few variables to my program). When the datalogger compiles the program, are there any error messages?

The precompiler is a syntax check only, and will not affect the operation of the code in the datalogger.

Dana W.


fluxtech Nov 5, 2012 01:12 PM

I'm assuming precompiler info is reported in the first line of the CRBasic Editor message window. I included this below from a .CR5 program that does compile. If this isn't the correct location for the date, where can I find it? This is the same date reported if I select "Ignore" from the Windows Runtime error message and the program compiles

[Version]C:\Campbellsci\Lib\Compilers\CR5Comp.exe VERSION:CR5000.Std.06 DATE:111215

There aren't errors when the program compiles on the datalogger. So, is this something I shouldn't really be bothered by? Maybe the multiplexer issue is caused by something else? Thanks!


GTProdMgr Nov 6, 2012 05:47 PM

> [Version]C:\Campbellsci\Lib\Compilers\CR5Comp.exe
> VERSION:CR5000.Std.06 DATE:111215

What you see above is that your CR5Comp.exe pre-compiler
is the Std6 version dated December 15th, 2011. You
should confirm by looking at the status table of
your CR5000 that you actually have the Std6 OS loaded
in your datalogger (it will also have the same date
of 12/15/11). This is the latest shipping version of
the CR5000 OS.

I'm a bit skeptical that this text you report is a
Visual C++ error. It seems instead to be an error reported
by CR5Comp.exe:

> Debug Error!
> Program: C:/CampbellSci/Lib/Compilers/CR5Comp.exe
> Module: C:/CampbellSci/Lib/Compilers/CR5Comp.exe
> File:
> Run-Time Check Failure #3- The variable 'off_val'
> is being used without being initialized.

Assuming this a pre-compiler error, you should look
for a variable named "off_val" in your CRBasic program.
It might have been declared with a Public or Dim
statement, and then is being used when it contains an
invalid value. If you really aren't using that variable
for anything useful within your program, you could remove it and the error would probably go away.

If you don't have any variable named "off_val" in your
program, then this probably is a severe/unhandled
exception thrown by CR5Comp.exe. In that case, you should
call the appropriate CSI office and open an official support issue. We would like to see a screenshot of the error, and also have the entire program (instead of just part of it) so we can try to duplicate the error here in house. Once duplicated, we can recommend workarounds for the program as well as consider whether an OS development change is needed.

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