Memory Stick Datalogger Demo V1.0
marcf
Posts: 6
Hello:
I am trying to see how and where the VAR 'flag' gets set to 0 in the Subroutine 'Check_Drive' in DataLoggerDemoV1.0.bs2.
This is probably a "RTxM" problem on my part, but any help would be good.
Thanks.
Marc
I am trying to see how and where the VAR 'flag' gets set to 0 in the Subroutine 'Check_Drive' in DataLoggerDemoV1.0.bs2.
This is probably a "RTxM" problem on my part, but any help would be good.
Thanks.
Marc
Comments
this happens with the pink device once the status var is read so i presume the same happens with this one too?
Thanks for the reply.
It looks like 'VAR flag' i s set to 0 by the device during the subroutine 'Get_Data'
and is used to determine a "Connected" condition.
Buffer(0) = "D", Buffer(1) = "D" and flag = 0
I would just like to know how this is done.
It seems to me that a valid response for a "Connected" condition would be if
Buffer(0) = ">" and Buffer(1) = "0"
Thanks
marc
A successful series of events·( or at least the beginning and the end of those events·) when a flash drive is plugged in is
1. the logger transmits "DD"·
2. then there is a little more activity which is ignored by the Stamp
3. finally the logger transmits ">"
The Check_Drive loop will detect the device ("DD") when it is plugged in and keep looping until it receives the ">" character .
In the process of detecting the drive the program assigned buffer(0) the value "D" and buffer(1) a value of "D".
Immediately following that line flag is set to 1 , the reason is so that·subsequent Check_Drive loops will now ignore the lines.
because until told otherwise buffer (0) and (1) will still contain "DD"
It may or may not be crucial in this instance but is a good example of setting a "flag" to control program flow.
Jeff T.
It is clear to me how 'flag' gets set to "1", but I still do not understand how 'flag' gets set to "0".
Could you explain it to me in detail?
Inquiring minds need to know.
Thanks
Marc
variables are initialized to zero at program start
Jeff T.
I guess that I came very close to asking a stupid question.
Thanks for your understanding.
Marc