READ data from file [message #1864482] |
Tue, 19 March 2024 12:01  |
Eclipse User |
|
|
|
Hi!
We have FBs able to write data to files (CSV). Is there an FB able to read data from a CSV or TXT file?
If not, does the framework provides any way to implement this?
Thanks in advance.
|
|
|
Re: READ data from file [message #1864492 is a reply to message #1864482] |
Tue, 19 March 2024 21:25   |
Eclipse User |
|
|
|
Hi,
currently not. You could take the CSV writer as a reference and implement your own SIFB which would read, I would expect, one line per event, parses the line and applies the parsed values with the fromString method to the outputs. Should be rather straight forward.
|
|
|
|
Re: READ data from file [message #1872171 is a reply to message #1864494] |
Thu, 24 October 2024 13:24   |
Eclipse User |
|
|
|
Hello, what would be the impact if I read the entire file in a single event ? That event would take much longer, what would happen then ? I need to parse configuration files once and for all when the system starts, so under the point of view of performance it would not be a problem if I missed a few ticks initially. Would there be any side effects ? Do we have some "constraints" in execution time of events ?
|
|
|
Re: READ data from file [message #1872192 is a reply to message #1872171] |
Thu, 24 October 2024 21:51   |
Eclipse User |
|
|
|
If you are doing longer lasting things in your FB you are blocking all event distribution in the same thread (normally the same resource). This most of the time will just delay other FBs. The only problematic thing that can happen is that external events are queued up. For performance reasons external evetns are stored in a separate queue: the external event queue. External events are transferred to the internal event processing only when no FB is executing. So if you have a long running FB and lots of external events are happening that queue may overflow and you use events. You can do two things to prevent this:
1. increase the external event queue size in your CMake configuration
2. first do all your long running initialization stuff and only then start anything that is generating external events (e.g., E_CYCLE, SUBCRIBE, IX).
I would strongly suggest the second option as it is much cleaner.
|
|
|
|
Powered by
FUDForum. Page generated in 0.05399 seconds