trying to count bats: log transit times and direction

cmp20

Registered User.
Local time
Today, 22:05
Joined
Nov 12, 2010
Messages
34
Hi,

I really dont know where to begin here::( I inherited an Access database (attached) which is permanently connected to a data source (wo electonic triggers from pair of Infrared beams). These are used to count bats entering and leaving a roost. There are 2 sequential beams so hopefullly direction can be calcuated by sequence and possibly speed by elapsed time.

The triggers are on pin zero and pin one; pin state 0 means no signal, pin state 1 is triggered i.e. IR beam blocked.

So for example, the sequence of one bat flying through this would be as follows:
start with both beams un-triggered: pin 0=0, pin 1=0,
bat flying through in one direction: pin 0=1, pin1=1, pin 0=0, pin1=0.
bat returning in other direction : pin 1=1, pin0=1, pin 1=0, pin0=0.

Any ideas how can I do this using the data below -and attached?

Event Ticks = (number of 100-nanosecond intervals that have elapsed since 12:00 A.M., January 1, 0001)

a sample of the main data table (as csv) -note: the last few transits are blockages which also need to be determined or ignored.

ID,EventTicks,EventTime,IPAddress,Pin,State
2007,634251616470553000.00,12-Nov-10,192.168.1.9,1,1
2008,634251616470580000.00,12-Nov-10,192.168.1.9,0,1
2009,634251616470601000.00,12-Nov-10,192.168.1.9,1,0
2010,634251616471864000.00,12-Nov-10,192.168.1.9,0,0
2011,634251616496660000.00,12-Nov-10,192.168.1.9,0,1
2012,634251616496687000.00,12-Nov-10,192.168.1.9,0,0
2013,634251616496709000.00,12-Nov-10,192.168.1.9,1,1
2014,634251616496730000.00,12-Nov-10,192.168.1.9,1,0
2015,634251616518431000.00,12-Nov-10,192.168.1.9,1,1
2016,634251616518457000.00,12-Nov-10,192.168.1.9,0,1
2017,634251616518479000.00,12-Nov-10,192.168.1.9,0,0
2018,634251616519841000.00,12-Nov-10,192.168.1.9,1,0
2019,634251616548064000.00,12-Nov-10,192.168.1.9,0,1
2020,634251616548091000.00,12-Nov-10,192.168.1.9,1,1
2021,634251616548114000.00,12-Nov-10,192.168.1.9,0,0
2022,634251616549173000.00,12-Nov-10,192.168.1.9,1,0
2023,634251616555524000.00,12-Nov-10,192.168.1.9,1,1
2024,634251616559656000.00,12-Nov-10,192.168.1.9,1,0
2025,634251616562781000.00,12-Nov-10,192.168.1.9,1,1
2026,634251616564494000.00,12-Nov-10,192.168.1.9,0,1
2027,634251616566711000.00,12-Nov-10,192.168.1.9,0,0
2028,634251616568526000.00,12-Nov-10,192.168.1.9,0,1
2029,634251616568553000.00,12-Nov-10,192.168.1.9,0,0
2030,634251616570038000.00,12-Nov-10,192.168.1.9,1,0
2031,634251616574372000.00,12-Nov-10,192.168.1.9,1,1
2032,634251616574400000.00,12-Nov-10,192.168.1.9,0,1
2033,634251616575480000.00,12-Nov-10,192.168.1.9,0,0
2034,634251616575504000.00,12-Nov-10,192.168.1.9,1,0
2035,634251616592112000.00,12-Nov-10,192.168.1.9,0,1
2036,634251616592138000.00,12-Nov-10,192.168.1.9,1,1
2037,634251616592160000.00,12-Nov-10,192.168.1.9,1,0
2038,634251616592182000.00,12-Nov-10,192.168.1.9,0,0
2039,634251616613480000.00,12-Nov-10,192.168.1.9,1,1
2040,634251616613506000.00,12-Nov-10,192.168.1.9,0,1
2041,634251616613528000.00,12-Nov-10,192.168.1.9,0,0
2042,634251616614790000.00,12-Nov-10,192.168.1.9,1,0
2043,634251616637872000.00,12-Nov-10,192.168.1.9,0,1
2044,634251616637899000.00,12-Nov-10,192.168.1.9,1,1
2045,634251616638981000.00,12-Nov-10,192.168.1.9,1,0
2046,634251616639006000.00,12-Nov-10,192.168.1.9,0,0
2047,634251616661659000.00,12-Nov-10,192.168.1.9,1,1
2048,634251616661685000.00,12-Nov-10,192.168.1.9,0,1
2049,634251616661708000.00,12-Nov-10,192.168.1.9,0,0
2050,634251616661730000.00,12-Nov-10,192.168.1.9,1,0
2051,634251616677282000.00,12-Nov-10,192.168.1.9,0,1
2052,634251616677321000.00,12-Nov-10,192.168.1.9,0,0
2053,634251616677344000.00,12-Nov-10,192.168.1.9,0,1
2054,634251616678492000.00,12-Nov-10,192.168.1.9,0,0
2055,634251616678517000.00,12-Nov-10,192.168.1.9,0,1
2056,634251616682222000.00,12-Nov-10,192.168.1.9,1,1
2057,634251616682248000.00,12-Nov-10,192.168.1.9,1,0
2058,634251616698046000.00,12-Nov-10,192.168.1.9,0,0
2059,634251616711249000.00,12-Nov-10,192.168.1.9,1,1
2060,634251616721733000.00,12-Nov-10,192.168.1.9,1,0
2061,634251616728990000.00,12-Nov-10,192.168.1.9,1,1
2062,634251616729016000.00,12-Nov-10,192.168.1.9,0,1
2063,634251616739775000.00,12-Nov-10,192.168.1.9,0,0
2064,634251616739801000.00,12-Nov-10,192.168.1.9,1,0

after thinking about it, since the id is consecutive, perhaps could start by looking for two consective records where pins 0 and 1 are both 0
then examine next 4 records to see if sequence of pin states is 1,1,0,0 and if so this is a valid transit, if not, search for next consective records where pins 0 and 1 are both 0,
if a valid transit then can determine directiion by recording which pin went high first. and possible elapsed time of transit by diff between ticks?
but I have no idea how to do this in access....
many thanks
cp
 

Attachments

Last edited:
well first of all, your relevant fields are "pin" and "state". and you're saying "pin1" and "pin2". so which is which? and what are you trying to determine or analyze?

there is no way to analyze this in Access using queries. vba will have to do. excel might be better for you.
 
hi, this is logging continuously and will soon exceed the number of rows in excel

I am trying to log the date/time of transit and the direction -speed would be nice.
VBA would be great but how?
there are two inputs: pin 1 and 2 -it doesnt matter which is whic,h since "out" or "in" can be determined at any time by observation.
each pin can be in one of two states triggered (1) or idle (0)
as soon as any pin is triggered or goes idle, it writes to the database (time/date/1 or 0/ and nanoseconds as above)
 
i wouldn't know any other way to do it than recordsets. Access is horrible with vertical analysis of data in one table.

isn't there any other pattern besides record by record that you can look for? as far as helping you, I still have no idea what the connection is between the 1's and 0's. You say it doesn't matter, but if it doesn't matter, why would the system be set up in the first place?

I assume it is set up to monitor migration or flight patterns or something?
 
its to monitor rare roost populations.
A zero means the absence of a bat breaking the beam, a one means the beam is broken. Thus each of the beams will be at one if there are no bats crossing. If a bat crosses the 1st beam will change from zero to one and then back to zero after the bat leaves the beam -then this happens for the next beam in sequence- except for the fact that the beams are so close that both beams will be at level one together for a short time, this allows for discrimation of insects which will only cause one beam to be at 1 at at a time
 
this is pretty complex in Access, but what you need to figure out is the patterns. Almost like writing an algorithm. You need to figure out what each pattern means, and more importantly, when each one begins and ends. Without that, the data would mean nothing i would think. for instance, this pattern:

Code:
2007,634251616470553000.00,12-Nov-10,192.168.1.9,1,1
2008,634251616470580000.00,12-Nov-10,192.168.1.9,0,1
2009,634251616470601000.00,12-Nov-10,192.168.1.9,1,0
2010,634251616471864000.00,12-Nov-10,192.168.1.9,0,0
looks like a bat crossed the first beam and then a second beam. So what it looks like (given that there is a "1,0" record before the first one), is that a bat came in, triggered beam 1, then beam 2, and the system thought both beams were on so it entered another record with "1,1", then the bat either left the way it came in or continued out the other side (of what region, I don't know).

what you said earlier applies too. since the first record shows 1,1 - obviously the bat was flying fast enough to trigger both beams at once. I have no idea what triggers a record entry, as that still is not clear. But regardless, a study of mammal migration like this is obviously pattern-based. So what can you do to figure out the different patterns that can happen? Once you get that down, it is simply a matter of looping the recordsets and running your algorithms against the sequential data patterns, because it is clear that the records are automatically entered as time goes by. The "nanoseconds" entry tells you that. A billion nanos equals one second, but that might be irrelevant.

That goes with saying that Access is obviously not the best program to be doing this in, but it's not impossible. The biggest hurdle with this is obviously if two bats are involved. At that rate, it would be impossible to know what's going on with the behavior because the size of the analysis need would simply be too overwhelming for Access.

I might not even know what I'm talking about either. It's just an interesting problem to ponder.
 
hi, its not speed that causes both beams to trigger -and crucially stay triggered for long enough-it is the size of the animal. A bat is big enough to trigger both beams wheras an insect will only trigger one at a time as it transits. Thus a bat produces the pattern: pin1=1, a few ms later pin 2=1 as it transits, and as it leaves the beams pin1=0, pin2=0
i.e. 1,1,0,0.
An insect will cause the pattern 1,0,1,0 since the beams are 3 cm apart it cannot trigger both -unless it is huge. Patterns will always start with p1=0 and p2=0 so the only transit patterns can be 1,1,,0,0 or 1,0,1,0. however the associated pins could be reversed with direction of flight.
i.e. timestamp and sequence p1=1,p2=1,p1=0,p2=0 would mean "in" wheras p2=1,p1=1,p2=0,p1=0 would mean "out"

you say " simply a matter of looping the recordsets and running your algorithms against the sequential data patterns" but how would I do this?
should I be posting this in the vba section instead of queries?
 
the only transit patterns can be 1,1,,0,0 or 1,0,1,0.
OK cmp, so if those are the only two patterns possible, you can simply go through the set and look for those patterns, right? obviously the first column is an autonumber, so you can open the set by sorting it on that. but what analysis do you want?

keep in mind AGAIN, that this is a very messy way to analyze and there has to be something better than this program to do this with. but at any rate, so you have two patterns possible. but you also say:
Patterns will always start with p1=0 and p2=0
so again, I don't know what you're looking to analyze. At this point, I understand the meaning of the pin and state columns, so I can relate now. :) woohoo!

so let us take a portion of the data your originally posted. Is it safe to assume that one animal is flying through at a time? If so, that makes life easy. If not, this analysis is almost impossible because data consistency will be lost. but let us assume YES.

you said earlier that patterns always end with 0,0. that makes sense to me as well, because an animal flying either way would always leave a beam on one side or the other. but that is not related to the dataset directly, because pin=0 and state=0 just means that an animal left one beam on one side. getting back to the point though, the first 4 records indicates a flythrough by something other than a bat:
Code:
pin	state
0	1
0	0
1	1
1	0
the beams were not on at the same time. am I correct here? but take a look at the NEXT 4 records after those initial 4:
Code:
pin	state
1	1
0	1
0	0
1	0
so what happened here? looks like a bat came through, because beam 0 was triggered while beam 1 was still triggered, right? but look at the 3rd record. the second beam was triggered as "off" before the first one was. that doesn't make logical sense if the bat was flying strait through the observation area. and it also doesn't make any sense if the bat changed his mind midway through and flew back out the side he came in. are you following?

again, I might not be making any sense, but that's the way I see this data as it is now.

but at any rate, since the data is not consistent a function to analyze it would be pointless, but let us say it WAS consistent and we were looking for the following two patterns ONLY:

  • 1, 1, 0, 0 = BAT WENT THROUGH
  • 1, 0, 1, 0 = SOMETHING ELSE WENT THROUGH

but we can't just look at those "state" numbers, because they have to accompany the appropriate "pin" numbers too, otherwise we're back to the data making no sense.

again, if the data was consistent, you could analyze a count of both the number of bats and number of insects that flew through the observation area. such code would look something like this (I am only considering the "state" column in this example):
Code:
dim bats as long
dim insects as long
dim temp as string
dim bpattern as string
dim ipattern as string
dim db as dao.database
dim rs as dao.recordset

set db = currentdb
set rs = db.openrecordset("SELECT * FROM table ORDER BY autoNumberCol", dbopendynaset)

bats = 0
insects = 0
bpattern = "1100"
ipattern = "1010"

rs.movelast
rs.movefirst

with rs
   do while not .eof
      temp = temp & cstr(!statecolumn)

         select case temp
            case = bpattern
               temp = ""
               bats = bats + 1
            case = ipattern
               temp = ""
               insects = insects + 1
         end select

      .movenext
   loop
end with

msgbox "Bats that flew through: " & cstr(bats) & vbcrlf & vbcrlf & _
           "Insects that flew through: " & cstr(insects)

rs.close
db.close

set rs = nothing
set db = nothing

does that help?
 
sorry about this:
"so what happened here? looks like a bat came through, because beam 0 was triggered while beam 1 was still triggered, right? but look at the 3rd record. the second beam

I put my arm through the beams and pulled it back out thus the strange pattern -normally I toss a paper ball through for testing.
I will have the chance to test your code tomorrow, thanks
 
you ought to be able to explain exactly what the data means.

what do you get if bats just fly in. or just fly out.

how do oyu get a 0,0 on the pins. I don't follow that.
 
you ought to be able to explain exactly what the data means.

what do you get if bats just fly in. or just fly out.

how do oyu get a 0,0 on the pins. I don't follow that.

0,0 means no signal: there is no bat in the beams (the occurance of 2 bats in the beams is so rare it can be ignored)

example bat just flies out:
noting in beams: both pins = 0
bat breaks 1st beam: pin 1 goes high (1)
bat breaks 2nd beam: pin 2 goes high (1)
bat leaves 1st beam: pin 1 goes low(0)
bat leaves 2nd beam: pin2 goes low(0)

hope this hels to expalain beter
 
cheers the_net_2.0,:D

using your code below(only modified field names) I was able to produce a msg box with number of bats and insects. This is real progress, now I need to determine direction and store the answer as a file or a table for each day (or somehow or other determine between days so the results can be graphed in excel).

Unless you can think of a better method, I would like to use -1 (in) and +1 (out) as direction so that the total number of bats in one day can be calculated by adding them together to give a maximum total for each night. i.e. the count works like this (bat behaviour is to "light sample" at dusk i.e. they go out and in a few times before finally exiting for the night): using plus and minus one is a method of cancelling out that behaviour to get a maximum nightly count.
e.g. totalling +1+1+1-1+1-1+1 means that at this time there were 5 bats maximum out of the roost -this would correlate to a precise timestamp, then as dawn approaches the -1s counts exceed the +1s as more bats return than leave the roost and the runnig total approaches zero at dawn -(there are about 600 bats there so it is never exactly even).

Could you give me some clues as to how this might be acheived by building on below?
many thanks
cp


Private Sub Command10_Click()
Dim bats As Long
Dim insects As Long
Dim temp As String
Dim bpattern As String
Dim ipattern As String
Dim db As DAO.database
Dim rs As DAO.Recordset

Set db = CurrentDb
Set rs = db.openrecordset("SELECT * FROM Events ORDER BY ID", dbopendynaset)

bats = 0
insects = 0
bpattern = "1100"
ipattern = "1010"

rs.MoveLast
rs.MoveFirst

With rs
Do While Not .EOF
temp = temp & CStr(!State)

Select Case temp
Case Is = bpattern
temp = ""
bats = bats + 1
Case Is = ipattern
temp = ""
insects = insects + 1
End Select

.MoveNext
Loop
End With

MsgBox "Bats that flew through: " & CStr(bats) & vbCrLf & vbCrLf & _
"Insects that flew through: " & CStr(insects)

rs.Close
db.Close

Set rs = Nothing
Set db = Nothing
End Sub
 
well I'm glad you're experiencing success. :D Certainly not an easy task with this program!

What you now want though is pretty simple, as you've already nailed down the method of how to analyze data. But i don't really understand the 1,-1 concept your talking about. Are you talking about assigning those integers to each record based on the four-digit pattern that is recognized after 4 records are looped? that's really the only way I see possible, because the nature of the record entries suggest that you can only analyze in a vertical fashion, like you've already done.

taking the above scenario, all you'd need to do is create a small array or something and assign all the possible 4-record patterns to it. the 1,-1 is not needed, and it may get confusing anyway. so if there are 4 possible trigger patterns based on if bats are flying in or out, you could maybe write:

Code:
Private Sub Command10_Click()
dim parray(3) as string
Dim bats As Long
Dim insects As Long
Dim temp As String
Dim batsout As long
Dim batsin As long
Dim db As DAO.database
Dim rs As DAO.Recordset

Set db = CurrentDb
Set rs = db.openrecordset("SELECT * FROM Events ORDER BY ID", dbopendynaset)

parray(0)="0101"
parray(1)="1010"
parray(2)="0110"
parray(3)="1001"

rs.MoveLast
rs.MoveFirst

With rs
   Do While Not .EOF
      temp = temp & CStr(!State)

         if len(temp) = 4 then
            for j=0 to ubound(parray)
               if temp = parray(j) then
                  select case temp
                     case = parray(0) 'BAT FLEW OUT
                        batsout = batsout + 1
                     case = parray(1) 'BAT FLEW OUT
                        batsout = batsout + 1
                     case = parray(2) 'BAT FLEW IN
                        batsout = batsin + 1
                     case = parray(3) 'BAT FLEW IN
                        batsout = batsin + 1
                  end select
                           exit for
               end if
            next j
                     temp=""
         end if

      .MoveNext
   Loop
End With

bats = batsin-batsout

MsgBox "Bats that flew out today: " & CStr(batsout) & vbCrLf & vbCrLf & _
           "Bats that flew in today: " & CStr(batsin) & vbcrlf & vbcrlf & _
           "There should be " & _
           iif(bats<0, cstr(abs(bats)) & " less bats ", cstr(bats) & " more bats ") & _
           "in the roost today than there were yesterday!"

rs.Close
db.Close

Set rs = Nothing
Set db = Nothing
End Sub

that example is JUST an example. not a real life scenario, but I'm sure you can follow it.
 
"Are you talking about assigning those integers to each record based on the four-digit pattern that is recognized after 4 records are looped?" YES!

How would I get the results into a table rather than a mgsbox?
many thanks
 
How would I get the results into a table rather than a mgsbox?
many thanks

replace this:
Code:
MsgBox "Bats that flew out today: " & CStr(batsout) & vbCrLf & vbCrLf & _
           "Bats that flew in today: " & CStr(batsin) & vbcrlf & vbcrlf & _
           "There should be " & _
           iif(bats<0, cstr(abs(bats)) & " less bats ", cstr(bats) & " more bats ") & _
           "in the roost today than there were yesterday!"
with something like this:
Code:
with rswrite
   .addnew
   !datefield = whateverateIsCurrent
   !batsinroostfield = bats
   .update
end with
at the beginning of the procedure, declare a new recordset and open it:
Code:
dim rswrite as dao.recordset
set rswrite = currentdb.openrecordset("analysistable")
before you run the code, obviously you'd have to make a table (e.g. - "analysistable") with the proper fields you want in it. So, to put it all together, and assuming you'd want to analyze each day's data, from the beginning of the time that you started analyzing this, you'd obviously have to loop a different dataset for each single day that the recordings were taking place. You could store the distinct days in an array with getrows() and use a temp recordset to perform the loops until all the days were covered. I guess if I were doing it, the entire code might look something like this:

Code:
Private Sub Command10_Click()
dim parray(3) as string
dim udays() as variant
Dim bats As Long
dim i as long
dim temptime as date
Dim temp As String
Dim batsout As long
Dim batsin As long
Dim db As DAO.database
Dim rstemp As DAO.Recordset
dim rswrite as dao.recordset

Set db = CurrentDb
Set rstemp = db.openrecordset("SELECT DISTINCT [EventTime] " & _
                              "FROM origTable ORDER BY [EventTicks]", dbopendynaset)
set rswrite = currentdb.openrecordset("analysistable", dbopendynaset)

parray(0)="0101"
parray(1)="1010"
parray(2)="0110"
parray(3)="1001"

rstemp.MoveLast
rstemp.MoveFirst

udays() = rstemp.getrows(rstemp.recordcount)

rstemp.close
set rstemp = nothing

for i = 0 to ubound(udays, 2) 'loop a table for every unique date

set rstemp = db.openrecordset("SELECT * FROM origTable " & _
                               "WHERE [EventTime] = #" & udays(0, i) & "# " & _
                               "ORDER BY [EventTicks]"
   rstemp.movelast
   rstemp.movefirst
      temptime = rstemp!EventTime

With rstemp 
   Do While Not .EOF
      temp = temp & CStr(!State)

         if len(temp) = 4 then
            for j=0 to ubound(parray) 'this loop type may need to change
               if temp = parray(j) then
                  select case temp
                     case = parray(0) 'BAT FLEW OUT
                        batsout = batsout + 1
                     case = parray(1) 'BAT FLEW OUT
                        batsout = batsout + 1
                     case = parray(2) 'BAT FLEW IN
                        batsout = batsin + 1
                     case = parray(3) 'BAT FLEW IN
                        batsout = batsin + 1
                  end select
                           exit for
               end if
            next j
                     temp=""
         end if

      .MoveNext
   Loop
End With

bats = batsin-batsout

   with rswrite
      .addnew
      !datefield = temptime
      !IncreaseOfBatsInRoostForDay = bats 'net change (in roost) from prev day
      .update
   end with

         rstemp.close
         set rstemp = nothing
            bats = 0
            batsin = 0
            batsout = 0

next i 'DO IT AGAIN

rswrite.Close
db.Close

Set rswrite = Nothing
Set db = Nothing
End Sub
keep in mind that this code will most likely freeze the program if your original table has more than 20 or 30 original dates in it (probably a lesser count like 15 actually). I've done it many a time. Access is not meant to handle large data requests and code executions like this but it eventually finishes execution if the code doesn't run too long. If it does run too long, you can corrupt the program, and even get strange data returns that are not logical for what you were asking.

also, the 2 nested 'for' loop may need to change, as the 'exit for' might break the code out of the outside loop. my brain is mush right now. I don't think that is the case, but you'll know as soon as you push the compile button. if it's in error, vba will say so. you can loop 'for' statements as many times as you want, but I can't remember what break code will do inside of nests.
 
Last edited:
0,0 means no signal: there is no bat in the beams (the occurance of 2 bats in the beams is so rare it can be ignored)

example bat just flies out:
noting in beams: both pins = 0
bat breaks 1st beam: pin 1 goes high (1)
bat breaks 2nd beam: pin 2 goes high (1)
bat leaves 1st beam: pin 1 goes low(0)
bat leaves 2nd beam: pin2 goes low(0)

hope this hels to expalain beter

not really

what if two bats fly in, and none out. what happens to the pins then?
presumably at the end of the flying period, they all fly in, and none fly out.

what i mean is it ought to be possible for you by inspecting the data, is to identify what each line means

ie
bat flies in
bat flies in
bat flies out
bat flies in

etc etc

it doesn't sound like you can do this.

assuming you can do this, its then a matter of deciding how you want to analyse the data, and therefore what data structures are necessary. Again, it doesn't sound like you know exactly what you want.


to put it another way - if you inherited a database, and it works - what are you trying to do, that it didnt do before?
 
Hi I had problems with your code -couldnt get it to work. But given what you said about the date limitations perhaps using date at this stage is not the best way to approach the problem -especially since there will be more than 30 dates.
I was thinking that using EventTicks might be better (number of 100-nanosecond intervals that have elapsed since 12:00 A.M., January 1, 0001)
since its sequential as well. Then sort by date after all the processing is done?
something like this:
1) look for state 0,0, sequence (start of a transit)
2) look at the following 2 records states -this will either give valid bat transit or rubbish data which can be discarded
3) look for next 0,0 sequence and loop

what do you think?:confused:
 
Hi Gemma, the database I inherited works as far as collecting raw data -it is generic for hardware:http://www.ipcas.com/products/serial-ethernet.html
the problem I have is converting the data which is collected into something that is useful.
Thenet2 understands the issue and I am trying to explain it to you: REPLIES IN CAPS below-no offence, Im not shouting!

"not really what if two bats fly in, and none out. what happens to the pins then?
IT IS IRRELEVANT, THE PINS ARE A RECORD OF A TRIGGER OR NOT
presumably at the end of the flying period, they all fly in, and none fly out
THEY FLY IN AND OUT AT DIFFERENT TIMES BUT MOST WILL HAVE RETURNED BY DAWN -NEVER EXACTLy MaTCHING THOUGH
what i mean is it ought to be possible for you by inspecting the data, is to identify what each line means

IT IS NOT POSSIBLE FROM A SINGLE LINE (RECORD) TO DETERMINE ANYTHING BECAUSE YOU NEED FOUR SEQUENTIAL RECORDS TO DETERMINE A SINGLE FLIGHT

Does this help explain better?
 
Hi I had problems with your code -couldnt get it to work. But given what you said about the date limitations perhaps using date at this stage is not the best way to approach the problem -especially since there will be more than 30 dates.
I was thinking that using EventTicks might be better (number of 100-nanosecond intervals that have elapsed since 12:00 A.M., January 1, 0001)
since its sequential as well. Then sort by date after all the processing is done?
something like this:
1) look for state 0,0, sequence (start of a transit)
2) look at the following 2 records states -this will either give valid bat transit or rubbish data which can be discarded
3) look for next 0,0 sequence and loop

what do you think?:confused:
I guess I think that's fine. It's not me that has to do it, it's you, right? :)
 

Users who are viewing this thread

Back
Top Bottom