Scattergrams and lines


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Scattergrams and lines



Hi there,
I e-mailed before about the problem that I was having with 
the IPPlotData function, that I wanted to join the points 
on a scattergram, and I couldn't use a line plot because I 
got an application error 2 times out of 3. Well I get an 
application error with the scattergram aswell. I get an 
error message along the lines of:
___________________________________________________________
Dr Watson for windows NT
	An application error has occured and an application 
log is being generated
		ipwin32.exe
Exception: access violation(0x0000005), Address:0x77f7d622
___________________________________________________________

Image Pro Plus shuts down. The error can occur at any time 
during or after the macro has run, but it quite often 
occurs after the macro has finished and I close all windows 
left open, (usually the graph and the image window). 
The only real consistency I can see is that the error 
occurs almost exactly 2 times out of 3.
The address number is rarely the same but the message 
usually follows the same format
The following function is in a loop. The macro plots 8.5 
points a second.
IT ALWAYS WORKS WHEN I PLOT ON JUST ONE AXIS, (VERTICAL OR 
HORIZONTAL).
IT USUALLY WORKS THE FIRST TIME IT IS RUN.
The following line has opened the Random Access File
Open "0000000001.RAN" For Random As #8 Len = Len(point)
and to close it:
Close #8
Kill "0000000001.RAN" 
I'm not sure if both of these lines can go in together but 
the error occurs without them aswell.

Any help greatly appreciated


Karen Hawthorn
Heriot-Watt University

___________________________________________________________
Type pointtype
	intensity As Integer
	timed As Double
End Type
Dim howlong As Single
Dim seconds As Single
Dim zeroseconds As Single
Dim I As Integer
Dim plotID As Integer
Dim title As String
Dim n As Integer
Dim j As Integer
Dim point As pointtype

'*********************************************************************
Private Function histoloop4() 
'*********************************************************************

	ret = IpAcqSnap(ACQ_CURRENT)  'snap next image
		If I=1 Then
			zeroseconds = Timer
		End If
	seconds = Timer
	ret = IpHstGet(GETSTATS,0,histstats(0))         'get hist stats	
	howlong = seconds - zeroseconds	
	point.intensity = histstats(4)
	point.timed = howlong
	Put #8, I, point
	ret = IpOutput("Int: " + Str$(histstats(4)) + "	Time: " + Str$(howlong) + vbCrLf)
	
	If I < 51 Then
		n = 1
	Else
		n = I - 49
	End If
	
	
	j = 0
	x = I - 1
	
	If x < 50 Then
		y = x
	Else
		y = 49
	End If
	
	For j = 0 To y
		Get #8, n, point
		valueplot(j) = point.intensity
		timeplot(j) = point.timed
		n = n + 1
	Next j
	
	ret = IPPlotData(plotID,0,PDT_FLOAT,timeplot(0),y + 1)
	ret = IPPlotData(plotID,1,PDT_FLOAT,valueplot(0),y + 1) 
	
	ret = IPPlotUpdate(plotID)		'update plot
	I = I + 1

End Function
______________________________________________________________












Search this Archive