Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

Serial I/O

brian_mckenna
Beginner
982 Views
Naive secondary teacher wishes to read the data from an RS232 digital meter into Visual Fortran to help a class investigation.

I would be grateful if someone could indicate how I might do this - I have spent the last two evenings in growing desperation. The device is 9600 baud, no parity, 8 data bits and 1 stop bit.

Thank you in advance.
0 Kudos
4 Replies
Jugoslav_Dujic
Valued Contributor II
982 Views
If you have -- I think -- CVF 6.5 or newer, take a look at SPORTxxx routines in CVF help.

Jugoslav
0 Kudos
durisinm
Novice
982 Views
If you continue to have problems it would probably help to post a brief description of the device and what you're trying to accomplish with it.

Mike D.
0 Kudos
brian_mckenna
Beginner
982 Views
The device is a TES 2730 multimeter - made in Taiwan.

I am trying code along the lines (with many variations!)
INTEGER(4) iresult
INTEGER present
INTEGER count
INTEGER baud
INTEGER parity
INTEGER dbits
INTEGER sbits

CHARACTER *1024 rbuff
iresult = SPORT_CONNECT(1, 0)
print *, iresult
iresult = SPORT_SET_STATE (1, 9600, 0, 8, 1)
print *, iresult

iresult = SPORT_PEEK_LINE(1, present, count)
print *, iresult, present
end program serial
But it hangs on the last line. Thank you in advance.
0 Kudos
hweisberg
Beginner
982 Views
One approach that might help would be to partition the problem. Obtain a serial terminal such as a PC running Hyperterminal. See if you can get the DVM to communicate with the terminal and separately if you can get your Fortran program to communicate with the serial terminal. :smileyhappy:
0 Kudos
Reply