"While executing SetAxis, the following error occurred: expected name of active axis."?
I've created a procedure file that generates histograms from CSV and binary files. I have six parameters in the CSV file: two axis limits for each of the three axes that I use (left, bottom, right).
I have three statements that appear as follows:
setAxis left minMaxValues [2], minMaxValues [3]
setAxis bottom minMaxValues [0], minMaxValues [1]
setAxis right minMaxValues [4], minMaxValues [5]
These statements are meant to scale the axes to the limits that are passed to the procedure file.
This all works fine, and the axes become scaled as desired. However, whenever I run the procedure, I get an error message with the following text:
"While executing SetAxis, the following error occurred: expected name of active axis."
This doesn't really make sense to me as I specify the name of the axis to be scaled, and all the axes become scaled as desired. If this error message didn't appear, everything would be fine - I don't know why it's coming up.
It's quite annoying because I'm using the procedure file as part of an Automation server, and it makes it pop up over my client interface.
If anyone has an idea of why this is coming up, I would really appreciate you sharing it with me.
Thanks
--
J. J. Weimer
Chemistry / Chemical & Materials Engineering, UAH
August 7, 2008 at 08:00 am - Permalink
Thanks for your message. I think that's helped, but I'm still getting the same problem.
I think the reason I'm getting it is something to do with multiple windows getting created, and me not referencing the right one.
I tried putting DoWindow and DoUpdate statements before every setAxis statement. The procedure also closes the graph window with KillWindow once it's done with it (before opening a new one), and I always create new windows with the same name. I also reference that window name explicitly whenever I use SetAxis.
This all works fine when I'm running the procedure just with Igor (no error message appears, and graphs are always created with the same window name), but when I run it separately (from my client), I get the error message.
Does anyone have any insight as to why this might be happening?
Thanks again
August 7, 2008 at 10:17 am - Permalink
This is all very odd.
From what you said, it looks like you are using the /W flag to explicitly target the command, right.
I think we need to do a little debugging. You might add some code similar to this:
Make/O jack=x;display jack
SetAxis/W=Graph0 left 100,200
if( GetRTError(1) )
print "set axis error on left"
endif
SetAxis/W=Graph0 xxx 100,200
if( GetRTError(1) )
print "set axis error on xxx"
endif
End
Note that the above has the additional advantage of not raising an error dialog.
August 7, 2008 at 03:00 pm - Permalink