Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2018-05

Realtime and freepascal???

12 messages · 8 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Darius Blaszyk

Hi,

For a hard real-time project I am considering using freepascal. As this is my first endeavour in real-time I would like to ask the community on their experiences. Is FPC suitable for this kind of applications? If so what commercially available boards are out there? I believe a beagle bone for instance is capable of doing realtime applications because of the PRU. Any other credit card size boards worthwhile investigating? What RTOS do people have good experience with in combination with freepascal?

To get an idea of the scope of the project:

My project is planned to do data acquisition, either storing data to flash memory or sending it over RF, not decided yet. Later on video should be incorporated, also over RF. There are also multiple analogue controllers planned to be implemented. Some "simple" bus system (such as CAN??) should allow easy extension with modules (for data acquisition as well as for the controllers). The response time should be in the order of 10ms ideally.

Hoping for some useful replies. Thanks in advance for all the tips and pointers!

Rgds, Darius

Reply by email

Paul Breneman
to Darius Blaszyk

Hi Darius,

I can't provide very many specifics, but do have a couple of links (which you may already know about). I'm looking forward to what others share on this *interesting* topic!

This page has two related links:
http://www.turbocontrol.com/devoptions.htm

Those two links are these:
http://www.machinekit.io/ - uses BeagleBone
http://rtxi.org/

This page has two links:
http://www.turbocontrol.com/helloworld.htm

Those two links are these:
http://wiki.freepascal.org/linux/kernel/module_development http://wiki.freepascal.org/Target_NativeNT

Thanks,
Paul
www.ControlPascal.com

Darius Blaszyk wrote 23 lines
Hi, For a hard real-time project I am considering using freepascal. As this is my first endeavour in real-time I would like to ask the community on their experiences. Is FPC suitable for this kind of applications? If so what commercially available boards are out there? I believe a beagle bone for instance is capable of doing realtime applications because of the PRU. Any other credit card size boards worthwhile investigating? What RTOS do people have good experience with in combination with freepascal? To get an idea of the scope of the project: My project is planned to do data acquisition, either storing data to flash memory or sending it over RF, not decided yet. Later on video should be incorporated, also over RF. There are also multiple analogue controllers planned to be implemented. Some "simple" bus system (such as CAN??) should allow easy extension with modules (for data acquisition as well as for the controllers). The response time should be in the order of 10ms ideally. Hoping for some useful replies. Thanks in advance for all the tips and pointers! Rgds, Darius

Reply by email

Marco van de Voort
to Darius Blaszyk: For a hard real-time project I am considering using freepascal. As this is my first…

In our previous episode, Darius Blaszyk said:

Show quoted text 6 lines
To get an idea of the scope of the project: My project is planned to do data acquisition, either storing data to flash memory or sending it over RF, not decided yet. Later on video should be incorporated, also over RF. There are also multiple analogue controllers planned to be implemented. Some "simple" bus system (such as CAN??)

I mostly work with barebone MCUs instead MPU's with RTOS, so I can't answer the question, but CAN doesn't really have the bandwidth for audio or video. It is meant for short (<=8bytes) control packets and has considerable per packet overhead.

Reply by email

Dennis
to Darius Blaszyk: For a hard real-time project I am considering using freepascal. As this is my first…
Darius Blaszyk wrote 11 lines
Hi, For a hard real-time project I am considering using freepascal. As this is my first endeavour in real-time I would like to ask the community on their experiences. Is FPC suitable for this kind of applications? If so what commercially available boards are out there? I believe a beagle bone for instance is capable of doing realtime applications because of the PRU. Any other credit card size boards worthwhile investigating? What RTOS do people have good experience with in combination with freepascal?

I am not sure Beagle Bone is a good choice because it seemed to have supply problem for many years. It is hard to purchase large quantity of it. In the past, I have use raspberry Pi connected to many simple devices via a serial bus. The PI acts as a server to accept commands from the internet and forward them to the devices on the serial bus and pass back the responses to the internet.  The software was written in FPC.

Also, check out this https://ultibo.org/
Which is an embedded OS written in FPC, so you just modify the source code to include your application and recompile a new embedded OS for use with raspberry Pi.
That way, it has lower latency and lower RAM requirement than running your FPC program on top of the Linux OS.

Dennis

Reply by email

Mark Morgan Lloyd
to Dennis
Dennis wrote 6 lines
Darius Blaszyk wrote:> Hi,>> For a hard real-time project I am considering using freepascal. As > this is my first endeavour in real-time I would like to ask the > community on their experiences. Is FPC suitable for this kind of > applications? If so what commercially available boards are out there? > I believe a beagle bone for instance is capable of doing realtime > applications because of the PRU.

Which are certainly good for data capture, anything more complicated than that and I hope you're good at assembler.

Show quoted text 8 lines
other credit card size boards > worthwhile investigating? What RTOS do people have good experience > with in combination with freepascal?>I am not sure Beagle Bone is a good choice because it seemed to have supply problem for many years. It is hard to purchase large quantity of it.In the past, I have use raspberry Pi connected to many simple devices via a serial bus. The PI acts as a server to accept commands from the internet and forward them to the devices on the serial bus and pass back the responses to the internet.  The software was written in FPC.

It's notable that the Boeing "Dreamliner" uses Ethernet heavily for both control and passenger entertainment, allegedly with the various subsystems both firewalled and airgapped (which raises the question: would one really need both if one were confident in what he was doing?).

Show quoted text 5 lines
Also, check out this https://ultibo.org/Which is an embedded OS written in FPC, so you just modify the source code to include your application and recompile a new embedded OS for use with raspberry Pi.That way, it has lower latency and lower RAM requirement than running your FPC program on top of the Linux OS.

Which is certainly a valiant attempt, although my tastes run towards systems with robust protection between segments/addressspaces.

Mark Morgan Lloyd markMLl .AT. telemetry.co .DOT. uk [Opinions above are the author's, not those of his employers or colleagues]

Reply by email

Marc Santhoff
to Darius Blaszyk: For a hard real-time project I am considering using freepascal. As this is my first…
Darius Blaszyk wrote 6 lines
My project is planned to do data acquisition, either storing data to flash memory or sending it over RF, not decided yet. Later on video should be incorporated, also over RF. There are also multiple analogue controllers planned to be implemented. Some "simple" bus system (such as CAN??) should allow easy extension with modules (for data acquisition as well as for the controllers). The response time should be in the order of 10ms ideally.

Normally this would not be done on one Machine. If so it is a big one, having enough power for running (parts of) the OS in real time. My suggestion would be to use a small embedded SoC and a OS or programming technique doing hard real time and another one, RPi would fit here from 15$ or so upward, recording and / or streaming video.

Regarding data acquisition it is really hard to decide which bus or communicaation port to use if the target measuring hardware isn't known. Many industrial installations use modbus on RS485.

Hoping for some useful replies. Thanks in advance for all the tips and pointers!

http://wiki.freepascal.org/Operating_Systems_written_in_FPC http://wiki.freepascal.org/ARM
https://en.wikipedia.org/wiki/Comparison_of_real-time_operating_systems

Have fun,
Marc

Marc Santhoff

Reply by email

Marc Santhoff
to Mark Morgan Lloyd: Which are certainly good for data capture, anything more complicated than that and I hope…
Mark Morgan Lloyd wrote
It's notable that the Boeing "Dreamliner" uses Ethernet heavily for both control and passenger entertainment, allegedly with the various subsystems both firewalled and airgapped (which raises the question: would one really need both if one were confident in what he was doing?).

They most probably use industrial ehternet for the important things. There are approaches doing both, tcp/ip and industrial protocols on one cable, but I personally would not set one foot into a plane doing so. ;)

Marc Santhoff

Reply by email

Brian
to Darius Blaszyk: For a hard real-time project I am considering using freepascal. As this is my first…

The brief description of your project suggests that it may not need "hard real-time" , since you are planning to write to flash memory or send the data over an RF link. Hard real-time usually implies receiving input data and responding with an output control in a timely and predictable manner.

Your application seems more like data logging where you don't want to lose any data , and in that case Linux will suffice if you use a 1Gbps Ethernet link which I have tested using Synapse and handles data at roughly 800Mbps using Free Pascal.

If you have access to hardware such as FPGA , or some special hardware , then preconditioning the data using buffers removes the need for hard real-time and Free Pascal running under vanilla Linux will more than suffice.

Brian

Reply by email

Darius Blaszyk
to Brian

Hi all,

Thanks for all the feedback I got. I am looking into different solutions and admittedly I'm at a loss. For the data acquisition part I indeed will not be using an MPU. Instead I found some good references to using arduino in a master / slave setup. The master will poll all slaves over I2C and transmit the data using a simplified xmodem protocol over RF.

One last point I have not covered is the use of video. For that I will need an MPU and as it stands I am thinking about using a Raspberry PI. I found this link on GPIO handling from FPC https://github.com/inforisorse/fprpiled. Anyone have a reference on reading HP video from RPI?

Rgds Darius

AM Brian wrote 25 lines
The brief description of your project suggests that it may not need "hard real-time" , since you are planning to write to flash memory or send the data over an RF link. Hard real-time usually implies receiving input data and responding with an output control in a timely and predictable manner. Your application seems more like data logging where you don't want to lose any data , and in that case Linux will suffice if you use a 1Gbps Ethernet link which I have tested using Synapse and handles data at roughly 800Mbps using Free Pascal. If you have access to hardware such as FPGA , or some special hardware , then preconditioning the data using buffers removes the need for hard real-time and Free Pascal running under vanilla Linux will more than suffice. Brian -- Sent from: http://free-pascal-general.1045716.n5.nabble.com/ _______________________________________________ fpc-pascal maillist - http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply by email

Paul Breneman
to Darius Blaszyk
Darius Blaszyk wrote 14 lines
Hi all, Thanks for all the feedback I got. I am looking into different solutions and admittedly I'm at a loss. For the data acquisition part I indeed will not be using an MPU. Instead I found some good references to using arduino in a master / slave setup. The master will poll all slaves over I2C and transmit the data using a simplified xmodem protocol over RF. One last point I have not covered is the use of video. For that I will need an MPU and as it stands I am thinking about using a Raspberry PI. I found this link on GPIO handling from FPC https://github.com/inforisorse/fprpiled. Anyone have a reference on reading HP video from RPI? Rgds Darius

I don't do video stuff very much anymore (did for thirty years: www.BrenemanLabs.com has a few links about that).

I do have fun with Raspberry Pis a lot. You should check out www.Ultibo.org as they *are* working with video with Free Pascal.

Thanks for the link to simple LED code for the RPi with FPC! I want to try that with this HAT: http://rasp.io/prohat/

That last link (and others) are on this page:
http://controlpascal.com/tutorial.htm

There is other RPi stuff here:
http://controlpascal.com/self-hosted.htm

Please keep us informed on how things are going!

Reply by email

Marc Santhoff
to Darius Blaszyk: Thanks for all the feedback I got. I am looking into different solutions and admittedly…
Darius Blaszyk wrote 5 lines
One last point I have not covered is the use of video. For that I will need an MPU and as it stands I am thinking about using a Raspberry PI. I found this link on GPIO handling from FPC https://github.com/inforisorse/fprpiled. Anyone have a reference on reading HP video from RPI?

I'd recommend looking at "Ultibo", too. Best source if you want to do anything in pure Object Pasal.

The standard way of getting video out of a rpi would be "mjpg-streamer". Easy to set up, using webcams or the pi cam and you can use mostly any program able to read streams from the net (vlc, mplayer, mpv, ...) If you do not wanna use those they can be a source of information, how to handle streams. In the end you deal with opening a socket for reading data packets...

Another program dealing with video (surveillance stuff, ROI, multiple cams iirc) is "motion".

Many 3D-prionters use Octopi (using mjpg.streamer) to have an eye on the print, so there are lots of tutorials inthat information space.

Sorry, no more hints on programming, although I'm interested a bit, too. My goal would be to show a video from file on the screeen and be able to navigate by time code and by single picture.

Marc Santhoff

Reply by email