Data acquisition using Fortran and RS232 Port

  • Context: Fortran 
  • Thread starter Thread starter Ariche
  • Start date Start date
  • Tags Tags
    Data Fortran
Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
2 replies · 3K views
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?
 
Physics 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