Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » 4DIAC - Framework for Distributed Industrial Automation and Control » READ data from file
READ data from file [message #1864482] Tue, 19 March 2024 12:01 Go to next message
roger giglio is currently offline roger giglioFriend
Messages: 15
Registered: August 2023
Junior Member
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 Go to previous messageGo to next message
Alois Zoitl is currently offline Alois ZoitlFriend
Messages: 1638
Registered: January 2014
Senior Member

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 #1864494 is a reply to message #1864492] Wed, 20 March 2024 01:50 Go to previous messageGo to next message
roger giglio is currently offline roger giglioFriend
Messages: 15
Registered: August 2023
Junior Member
Hi!

Thank you Professor. I'll give it a try.
Re: READ data from file [message #1872171 is a reply to message #1864494] Thu, 24 October 2024 13:24 Go to previous messageGo to next message
Guido Piasenza is currently offline Guido PiasenzaFriend
Messages: 17
Registered: October 2024
Junior Member
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 Go to previous messageGo to next message
Alois Zoitl is currently offline Alois ZoitlFriend
Messages: 1638
Registered: January 2014
Senior Member

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.
Re: READ data from file [message #1872255 is a reply to message #1872192] Fri, 25 October 2024 19:11 Go to previous message
Guido Piasenza is currently offline Guido PiasenzaFriend
Messages: 17
Registered: October 2024
Junior Member
Thanks ! Much appreciated !
Previous Topic:4DIAC with Factory I/O
Next Topic:User defined function in basic function block
Goto Forum:
  


Current Time: Tue Jan 14 13:25:36 GMT 2025

Powered by FUDForum. Page generated in 0.03229 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top