Data acquisition using Fortran and RS232 Port

  • Context: Fortran 
  • Thread starter Thread starter Ariche
  • Start date Start date
  • Tags Tags
    Data Fortran
Click For Summary
SUMMARY

This discussion focuses on data acquisition using Fortran and the RS232 port on a Linux system. Users need a driver to interface with the RS232 port, and it is suggested to utilize Fortran calls for this purpose. An alternative method involves writing controlling functions in C and passing data buffers to Fortran for processing. The conversation highlights the challenges and considerations when using Fortran for serial communication, particularly regarding the reading of the serial port as a file in Linux.

PREREQUISITES
  • Fortran programming knowledge
  • Understanding of RS232 serial communication
  • Familiarity with Linux file I/O operations
  • Basic C programming skills for interfacing with Fortran
NEXT STEPS
  • Research how to open and read from the RS232 port in Fortran
  • Learn about interfacing Fortran with C for data processing
  • Explore serial communication libraries available for Fortran
  • Investigate driver options for RS232 communication on Linux
USEFUL FOR

This discussion is beneficial for software developers, particularly those working with Fortran and C, as well as engineers involved in data acquisition and signal processing using RS232 communication on Linux systems.

Ariche
Messages
1
Reaction score
0
I'm on Linux, and I want to treat the flow of data through the RS232 port, using the Fortran language , how can I do?
 
Technology news on Phys.org
Hello Ariche, :welcome:

I see you don't get a rapid response, so I'll put in my two cents (fortran knowledge OK, interfacing directly via serial port, ...?):

You'd need a driver of some sort to do this. To write fortran calls like https://www.xlsoft.com/jp/products/intel/cvf/docs/vf-html_e/pg/pggsport.htm

Googling gives a lot of discussions on why not to use fortran for such things, but they are interspersed with tips that might be useful (this one? this ? Or in PF ?)
 
Last edited by a moderator:
What is the reasoning behind your decision to implement in Fortran?
Is is because the signal processing functions are implemented in Fortran, and you don't want to, or can't convert to another language?

An alternate approach might be to write the controlling functions in C and interface to the Fortran from there.
I'd prepare buffers of data with C and pass them to the fortran processing. You can research calling fortran from C.

In Linux the serial port (as does all IO) appears as a file you can read from. I'm not sure how to open it and read it from Fortran.
 
  • Like
Likes   Reactions: Silicon Waffle

Similar threads

Replies
64
Views
11K
  • · Replies 2 ·
Replies
2
Views
1K
  • · Replies 20 ·
Replies
20
Views
4K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 62 ·
3
Replies
62
Views
14K
  • · Replies 14 ·
Replies
14
Views
5K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 9 ·
Replies
9
Views
6K
  • · Replies 15 ·
Replies
15
Views
2K
  • · Replies 17 ·
Replies
17
Views
6K