Overlapped and ReadFile() question
-
HAPPY FRIDAY!!!:-D In the ReadFile() function there's an option where you can set it to be overlapped (i.e. be used in asynchronous I/O operations). If you want to be asynchronous you have to set the "Overlapped" struct's offset member... However, it says that: "Offset - File position at which to start the transfer. The file position is a byte offset from the start of the file. The calling process must set this member before calling the ReadFile function. This member is used only when the device is a file. Otherwise, this member must be zero." Here is where my confusion comes from... I have a FIFO, from a device that I'm communicating with, which is 1K by 32-bit word large. I need to make ReadFile() asynchronous because of speed constraints. Can I set the "Offset" if I'm reading from a FIFO? Will FIFO be considered a "File" in this case? The theory is to send an initial command to fill the FIFO upto 0x155 32-bit words. Then initiate ReadFile(). While this is doing it's thing I'm going to send another command that fills the FIFO with another 0x155 32-bit words. Then initiate ReadFile() on that set of words. While this is happening send a third command, issue a ReadFile()... After this go back and check to see if the 1st ReadFile() issued has completed, etc. is this possible? or am I dreaming... Thanks!
Kitty5
-
HAPPY FRIDAY!!!:-D In the ReadFile() function there's an option where you can set it to be overlapped (i.e. be used in asynchronous I/O operations). If you want to be asynchronous you have to set the "Overlapped" struct's offset member... However, it says that: "Offset - File position at which to start the transfer. The file position is a byte offset from the start of the file. The calling process must set this member before calling the ReadFile function. This member is used only when the device is a file. Otherwise, this member must be zero." Here is where my confusion comes from... I have a FIFO, from a device that I'm communicating with, which is 1K by 32-bit word large. I need to make ReadFile() asynchronous because of speed constraints. Can I set the "Offset" if I'm reading from a FIFO? Will FIFO be considered a "File" in this case? The theory is to send an initial command to fill the FIFO upto 0x155 32-bit words. Then initiate ReadFile(). While this is doing it's thing I'm going to send another command that fills the FIFO with another 0x155 32-bit words. Then initiate ReadFile() on that set of words. While this is happening send a third command, issue a ReadFile()... After this go back and check to see if the 1st ReadFile() issued has completed, etc. is this possible? or am I dreaming... Thanks!
Kitty5
Are you opening up a serial port to use with ReadFile?
If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week Zac
-
Are you opening up a serial port to use with ReadFile?
If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week Zac
Zac Howland wrote:
Are you opening up a serial port to use with ReadFile?
I've created a handle to the device which is plugged in to one of the PCI slots. The card is a PCI/Altera-485 LVDS card. I'm trying to get data from the Xilinx's DMA FIFO. -- modified at 10:49 Friday 11th August, 2006
Kitty5
-
Zac Howland wrote:
Are you opening up a serial port to use with ReadFile?
I've created a handle to the device which is plugged in to one of the PCI slots. The card is a PCI/Altera-485 LVDS card. I'm trying to get data from the Xilinx's DMA FIFO. -- modified at 10:49 Friday 11th August, 2006
Kitty5
This is just a guess, but I would imagine that the card would treat the FIFO like a buffer stream. That is, you will always be reading from the top fo the stream, so you would always pass in 0 to ReadFile.
If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week Zac