Undefined Variable: DC_Write_Fixed/DC_Write_Free - PV WAVE [message #79691] |
Thu, 22 March 2012 13:30  |
Erini Lambrides
Messages: 6 Registered: March 2012
|
Junior Member |
|
|
Hello all, I am getting this error message when i attempt to .run my
procedure compare_target_offset2
Compiled module: COMPARE_TARGET_OFFSET2.
% Compiled module: $MAIN$.
% DC_WRITE_FREE: Variable is undefined.
and the same for DC_WRITE_FIXED, when I try to write my data in a
variable to a .txt file. These two functions should be in the pv wave
library - I have version 9.00.
here is how I use it within the code:
status= DC_WRITE_FREE('C:\Cryo\SphereCenterData
\referencetargetdata.txt',rtar)
I apologize now if it's a silly mistake. Thanks!
|
|
|
Re: Undefined Variable: DC_Write_Fixed/DC_Write_Free - PV WAVE [message #79705 is a reply to message #79691] |
Wed, 28 March 2012 04:54   |
Heinz Stege
Messages: 189 Registered: January 2003
|
Senior Member |
|
|
Hi Erini,
it seems, that there are no other PV-Wave users in this group. I
myself switched to IDL 5 years ago. :-) Before that I used PV-Wave
for a long time. So I will try to help. See below.
On Tue, 27 Mar 2012 10:43:40 -0700 (PDT), Erini Lambrides wrote:
> I get this error message:
>
> % Internal error: Attempt to store into Temp variable with dynamic
> allocation..
> % Execution halted at COMPARE_TARGET_OFFSET2 <C:\wave_bin\pvpro
> \elam_pro/compare_target_offset2.pro( 80)> (DC_WRITE_FREE).
> % Called from $MAIN$ .
>
> Right after the loop finishes its first iteration. This is the code:
>
>
> loop4:
> artar=fltarr(nfiles)
> axc=fltarr(nfiles)
> ayc=fltarr(nfiles)
>
> for i=0, nfiles-1 do begin
>
> spherecenter,aimg(*,*,1),rtar,xc,yc,1,1
> artar(i)=rtar
> axc(i)=xc
> ayc(i)=yc
>
> status= DC_WRITE_FREE('C:\Cryo\SphereCenterData
> \referencetargetdata.txt',fnames(i),artar(i),/Column, $
> Dt_Template=[1], Format="(A10, 1X, F4.2)")
>
> endfor
>
> fnames(i): String=Array(5)
> artar(i):Float=Array(5)
The error message from PV-Wave is not very helpful for me. So I played
around a little with DC_WRITE_FREE. The following is working without
errors. All tests with PV-WAVE Version 7.51 (i386nt Windows-NT 80x86):
filename='Testfile_'+string(indgen(20),form='(i2.2)')+'.tmp'
a='a'+strtrim(sindgen(10),2)
b=findgen(10)
info,dc_write_free(filename(0),a,b,/column)
info,dc_write_free(filename(1),a,b(0),/column)
a0=a(0)
info,dc_write_free(filename(2),a0,b,/column)
info,dc_write_free(filename(3),[a(0)],b,/column)
But the following statement does not work. It throws the same error
message as your code:
info,dc_write_free(filename(4),a(0),b,/column)
I don't really know why. As the error message says, it is an "Internal
error". Does PV-Wave need to temporary write something into the
parameter? The command with b(0) was working. DC_WRITE_FREE seems to
make a difference between a scalar _string_ expression and a scalar
_floating point_ expression.
What is your intend with the Dt_Template=[1] keyword? As I understand
the manual, it has to be used in combination with date/time data
represented in the !DT structure format. Another question: Why don't
you use PRINTF instead of DC_WRITE_FREE? I myself always felt happy
with PRINTF (and WRITEU).
Cheers, Heinz
|
|
|
Re: Undefined Variable: DC_Write_Fixed/DC_Write_Free - PV WAVE [message #79766 is a reply to message #79705] |
Tue, 03 April 2012 11:12  |
Erini Lambrides
Messages: 6 Registered: March 2012
|
Junior Member |
|
|
On Mar 28, 7:54 am, Heinz Stege <public.215....@arcor.de> wrote:
> HiErini,
>
> it seems, that there are no other PV-Wave users in this group. I
> myself switched to IDL 5 years ago. :-) Before that I used PV-Wave
> for a long time. So I will try to help. See below.
>
>
>
>
>
>
>
>
>
> On Tue, 27 Mar 2012 10:43:40 -0700 (PDT),EriniLambrideswrote:
>> I get this error message:
>
>> % Internal error: Attempt to store into Temp variable with dynamic
>> allocation..
>> % Execution halted at COMPARE_TARGET_OFFSET2 <C:\wave_bin\pvpro
>> \elam_pro/compare_target_offset2.pro( 80)> (DC_WRITE_FREE).
>> % Called from $MAIN$ .
>
>> Right after the loop finishes its first iteration. This is the code:
>
>> loop4:
>> artar=fltarr(nfiles)
>> axc=fltarr(nfiles)
>> ayc=fltarr(nfiles)
>
>> for i=0, nfiles-1 do begin
>
>> spherecenter,aimg(*,*,1),rtar,xc,yc,1,1
>> artar(i)=rtar
>> axc(i)=xc
>> ayc(i)=yc
>
>> status= DC_WRITE_FREE('C:\Cryo\SphereCenterData
>> \referencetargetdata.txt',fnames(i),artar(i),/Column, $
>> Dt_Template=[1], Format="(A10, 1X, F4.2)")
>
>> endfor
>
>> fnames(i): String=Array(5)
>> artar(i):Float=Array(5)
>
> The error message from PV-Wave is not very helpful for me. So I played
> around a little with DC_WRITE_FREE. The following is working without
> errors. All tests with PV-WAVE Version 7.51 (i386nt Windows-NT 80x86):
>
> filename='Testfile_'+string(indgen(20),form='(i2.2)')+'.tmp'
> a='a'+strtrim(sindgen(10),2)
> b=findgen(10)
> info,dc_write_free(filename(0),a,b,/column)
> info,dc_write_free(filename(1),a,b(0),/column)
> a0=a(0)
> info,dc_write_free(filename(2),a0,b,/column)
> info,dc_write_free(filename(3),[a(0)],b,/column)
>
> But the following statement does not work. It throws the same error
> message as your code:
>
> info,dc_write_free(filename(4),a(0),b,/column)
>
> I don't really know why. As the error message says, it is an "Internal
> error". Does PV-Wave need to temporary write something into the
> parameter? The command with b(0) was working. DC_WRITE_FREE seems to
> make a difference between a scalar _string_ expression and a scalar
> _floating point_ expression.
>
> What is your intend with the Dt_Template=[1] keyword? As I understand
> the manual, it has to be used in combination with date/time data
> represented in the !DT structure format. Another question: Why don't
> you use PRINTF instead of DC_WRITE_FREE? I myself always felt happy
> with PRINTF (and WRITEU).
>
> Cheers, Heinz
Your suggestions worked perfectly! And I will continue to use Printf
from now on - I too now prefer this. I used the dc_functions simply
because that was suggested. It is my own fault for not trying my own
way first! Thank you very much!
-Erini Lambrides
|
|
|