| Dettagli del download |
|
This sample shows how to access files reading and/or writing from the CycleUpdate method, thus in a cyclic way. This sample contains the following projects and module instances.
When starting the sample, the writing module starts writing data to the file, which will be located in the Bootproject-Path (usually C:TwinCAT3.xBootAsyncTest.txt). The input variable “bDisableWriting” could be used in inhibit writing. The objects are connected to each other: After writing is done the WritingModule triggers the DetectModule of the TcAsyncBufferReadingDrv. This initiates a read operation by the ReadingModule. Please monitor the “nBytesWritten” / “nBytesRead” output variables of the WritingModule / ReadingModule. Additionally, log messages are generated on level “verbose”. As usual, these could be configured using the TraceLevelMax Parameter of the modules.
Use the input variable “bExecute” to trigger the action. The Parameter “FilePath” holds the directory to list (default: “c:TwinCAT3.1Boot*”). Please monitor the trace (Loglevel “Verbose”) for list of found files.
Understanding the Sample The TcAsyncFileIO project contains different classes in a static library. This library is used by the driver projects for reading and writing. Each class is dedicated to represent one file-access operation like open / read / write / list / close / ... Since the execution is done within a cyclic real time-context, each operation has a state and the class encapsulates this statemachine. As an entry point for understanding the file access, please start with the TcFsmFileReader and TcFsmFileWriter classes. If there are too much trace messages for understanding the sample, disable modules! |
|
|||||||||||||||||||||||||||||||||

Gli esempi presenti su questo sito sono stati liberamente inviati dagli utenti di automationforum.it, è stato espressamente specificato loro di inviare solo esempi FREE. Automationforum.it non si ritiene responsabile dell'eventuale presenza di esempi rilasciati sotto licenza commerciale, Automationforum.it invita tutti coloro che individuano esempi rilasciati sotto licenza commerciale presenti in questa raccolta a segnalarlo dall'apposito