- 신규로 표시
- 북마크
- 구독
- 소거
- RSS 피드 구독
- 강조
- 인쇄
- 부적절한 컨텐트 신고
How do I connect to a USB port from Fortran.
Regards
John Nichols
링크가 복사됨
- 신규로 표시
- 북마크
- 구독
- 소거
- RSS 피드 구독
- 강조
- 인쇄
- 부적절한 컨텐트 신고
- 신규로 표시
- 북마크
- 구독
- 소거
- RSS 피드 구독
- 강조
- 인쇄
- 부적절한 컨텐트 신고
A small company in Iowa has a nice device that I would like to communicate with directly as I noted before. I went looking and found a device driver INF file which notes that they are using WINUSB as the interface package, as shown in the attached file.
I would like to access this from Fortran, can I do it? Or do i ahve to use something like C#
Regards
JMN
- 신규로 표시
- 북마크
- 구독
- 소거
- RSS 피드 구독
- 강조
- 인쇄
- 부적절한 컨텐트 신고
http://msdn.microsoft.com/en-us/windows/hardware/gg487341.aspx
Once the initialization is done, you get a file handle for the device and then use the standard ReadFile() and WriteFile() API functions. All of this can be done directly from IVF, but you may have to create your own F90 interfaces for the WinUSB API functions.
- 신규로 표시
- 북마크
- 구독
- 소거
- RSS 피드 구독
- 강조
- 인쇄
- 부적절한 컨텐트 신고
Thanks a lot for the help.
life was simpler when one only had 2 floppies, a serial port, a printer port and black hair.
Did you all know that the first Mirosft Fortran could run on two 5.25 inch floppies on the original compaq portable sewing machine. (It looked like a sewing machine.)
Those were better times, one had time to drink a beer in comfort as the program was compiling.
Ah for a simple life.
JMN
- 신규로 표시
- 북마크
- 구독
- 소거
- RSS 피드 구독
- 강조
- 인쇄
- 부적절한 컨텐트 신고
- 신규로 표시
- 북마크
- 구독
- 소거
- RSS 피드 구독
- 강조
- 인쇄
- 부적절한 컨텐트 신고
We also ran FORTRAN-II in O/S 8 on that same machine, initially with 12K word of Core memory. We had 3 fixed head hard drives each 256KB (you read it right KB). We also ran the FORTRAN-D on a 4K word PDP-8L with "mass storage" as 10 character per second paper tape. In those days you kept your programs short (short symbol name choice) and you tended to program without error.
Now I have to have at least 1,000,000 as much memory anddisk. You couldn't run what we do now but the point to drive home is you can get a lot done in a small amount of memory.
Jim Dempsey
- 신규로 표시
- 북마크
- 구독
- 소거
- RSS 피드 구독
- 강조
- 인쇄
- 부적절한 컨텐트 신고
I bet it was a lot of fun if you dumped that sucker on the floor.
Usually you would diagonal mark the edge with a majic marker but you had to hand sort it in the event of the oops.
Jim
- 신규로 표시
- 북마크
- 구독
- 소거
- RSS 피드 구독
- 강조
- 인쇄
- 부적절한 컨텐트 신고
- 신규로 표시
- 북마크
- 구독
- 소거
- RSS 피드 구독
- 강조
- 인쇄
- 부적절한 컨텐트 신고
I will bet the FORTRAN-II compiler was in binary format as opposet to text (Hollerith). Binary cards did not have sequence numbers.
At shool we also had a card reader on our PDP-8I and you could load binary programs. The cards had 12 rows which fit in nicely with the 12-bit word length of that machine. You would toggle in a few word program to suck in the first card and overwrite the code you toggled in. That 80-word program would be a larger loader program that read in the rest of the loader, then loader was followed by a control program that managed the compiler.
Our FORTRAN-II compiler (on paper tape)was a three pass compiler which wrote assembly source code to an output device (paper tape or card punch). The load process was toggle in a smallbootstrap that would load in a tape containing the RIM loader (Read In Mode), this tape was followed by the BIN (Binary)loader, then you loaded the tape with the FORTRAN-II compiler. Three passes of your source code through the compilerto produce a tape with assembler source.Then you had to toggle in the loader again and load in the SABR assembler, three passes later again and your had the binary for the program (six passes now plus the tree tapes to get the compiler going and the three tapes to get the assembler going). Next you had to toggle in the loader again, and load in your binary program together with runtime libraries. On a 10cps paper tape it could be several hours before you get to see your program burp and crash. This is why you tended to do your coding right the first time. I am glad I do not have to go through that any more.
Jim Dempsey
- 신규로 표시
- 북마크
- 구독
- 소거
- RSS 피드 구독
- 강조
- 인쇄
- 부적절한 컨텐트 신고
Now back to USB via FORTAN:
I have a USB-GPIB interface to some lab instruments. It works fine with Agilent's software, but I want to address the instruments via Compaq Visual Fortran which is somewhat the same as IVF.
Agilent only gives examples in C++ or VB, which might as well be Latin as far as enlighteniing me any!
They say write ID = iopen ("gpib0,23") in either VB or C++
They don't give the value or type of the variable gpib0, or how it gets defined.
I guess this translates to a Fortran OPEN statement, but what would the arguments in a Fortran OPEN statement be?
All clues are appreciated.
- 신규로 표시
- 북마크
- 구독
- 소거
- RSS 피드 구독
- 강조
- 인쇄
- 부적절한 컨텐트 신고
Then you can call the C function form your Fortran code.
Once you can call the sample program (as subroutine) from fortran, then you can start modifying it.
The sample program can do something simple like identyfy device.
iopen is likely a function included in the Agilent library (which you may be able to link with your Fortran application).
Jim Dempsey