RE: Interacting  with FORTRAN code

Hi all,
I am currently working on some stuff which is written in FORTRAN and I need to put a GUI for that code. I want to know how to do it, I think I would need to use JNI and also I need to use JIT( as the program would run based on the user input). Am i in the right direction ? can someone give any guidelines as to how to do it. I have seen some of JNI documentation and all it mentions is about C,C++, assembly isnt FORTRAN supported ?
Thank you
amarsh

This link could help:
http://www.math.ucla.edu/~anderson/JAVAclass/JavaInterface/JavaInterface.html

Similar Messages

  • JNI to interface with fortran code

    So suppose my fortan program has (6 functions)
    and I use Java JNI method to make use of existing fortran code
    here is my ?,
    should i declare prototypes of all 5 fortran functions in c or
    should i declare only the topmost entry method(main) of fortran?
    my inclination is that if my fortran main method has access to all variables in program, then i only need the topmost fortran main prototype funciton to be declared in c.
    is this correct?

    how does one pass primitive data types such as char, int, single & multiple dim arrays from C to fortran?
    what about passing them from fortran to C?
    I had previously posted this
    ? in another forum not knowing about this JNI forum, so thanks for your patience.

  • Writing binary data in same format as with FORTRAN code

    Hello,
    I would like to write out data in a binary format that is used by FORTRAN unformatted direct access files. I have some code in FORTAN that produces the correct format; however, I have been unable to reproduce the output with a Java method.
    The FORTAN code to write an array Z is:
    REAL Z(72,46,16)
    OPEN(8,FILE='grads.dat',FORM='UNFORMATTED',
    & ACCESS='DIRECT',RECL=72*46)
    IREC=1
    DO 10 I=1,16
    WRITE (8,REC=IREC) ((Z(J,K,I),J=1,72),K=1,46)
    IREC=IREC+1
    10 CONTINUE
    The Java code I was able to come up with to write out an array arrTS produces binary data differently:
              FileOutputStream fosOut = new FileOutputStream(filename,false);
              for(int x=0; x<this.xmax; x++) {
                   for(int y=0; y<this.ymax; y++) {
                        ByteArrayOutputStream bosOut = new ByteArrayOutputStream(2);
                        DataOutputStream dos = new DataOutputStream(bosOut);
                        dos.writeFloat((float)this.arrTS[x][y]);
                        byte[] arrByte = bosOut.toByteArray();
                        fosOut.write(arrByte);
              fosOut.close();
    Any help is greatly appreciated.
    Best regards,
    Stefan

    I am using a software to read in the data that I am calculating in Java. I cannot easily change the format that software is reading; therefore, ASCII is not an option.
    The software that reads the data states something about "Little-endian". Do you which Java classes to use for that?
    Best regards,
    Stefan
    First, you need to find out the format of yourFORTRAN
    output. Is it ASCII? EBCDIC? BCD? IEEE?
    Big-endian? Little-endian?
    Until you know that you won't know which Javaclasses
    to use.Also I wouldn't be too sure different FORTRAN
    compilers use the same data format.
    In my view the best system interchange format still is
    the ASCII text file. Why don't you let the Fortran
    program use it to write its data to file. It should be
    no problem reading it from Java.

  • Interaction with transaction codes with interactive reports

    hi..
    i want to call a transaction code from the report which i prepared.for example...if im displaying the list of order no.of a customer as output ,then when i want to make some changes in the order details ..instead of going to transcode VA02 ..i want the transcation has to open when i double click the order number.

    Hi,
    you have to do some thing like this ...
    REPORT  ZTETS_CURSOR                            .
    DATA: FIELD(20),
          VALUE(10).
    DATA: BEGIN OF ITAB OCCURS 0,
            VBELN LIKE VBAK-VBELN,
            POSNR LIKE VBAP-POSNR,
           END OF ITAB.
    SELECT VBELN
           POSNR
           FROM VBAP
           UP TO 100 ROWS
           INTO TABLE ITAB.
    TOP-OF-PAGE.
      WRITE:(10) 'VBELN',
             (6) 'POSNR'.
    END-OF-SELECTION.
      LOOP AT ITAB.
        WRITE: /(10) ITAB-VBELN,
                 (6) ITAB-POSNR.
      ENDLOOP.
    AT LINE-SELECTION.
      GET CURSOR FIELD FIELD VALUE VALUE.
      IF FIELD = 'ITAB-VBELN'.
        CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
          EXPORTING
            INPUT  = VALUE
          IMPORTING
            OUTPUT = VALUE.
        SET PARAMETER ID 'AUN' FIELD VALUE.
        CALL TRANSACTION 'VA02' AND SKIP FIRST SCREEN.
      ENDIF.
    Regards
    vijay

  • Can a java code interact with trigger

    Hi guyz ,
    is there any way by which a trigger can interact with JDBC ?
    I want to check the database each time its updated and if some condition is violated , the info((row from table which has voilated some rule) is passed to java code which can then take necessary action . Can anyone help me out in this because i am not aware of any way by which a trigger can interact with java code .
    Regards,
    Nikhi

    nikhil456123 wrote:
    Hi guyz ,
    is there any way by which a trigger can interact with JDBC ?
    I want to check the database each time its updated and if some condition is violated , the info((row from table which has voilated some rule) is passed to java code which can then take necessary action . Can anyone help me out in this because i am not aware of any way by which a trigger can interact with java code .Note that even though it might be possible you might want to consider that it isn't necessarily a good idea.
    Say the action is "send email". Then every time an insert/update/delete occurs then an email is sent. That would obviously slow down those operations a lot. Not to mention that if 1000 inserts occur then someone is going to get 1000 emails.
    There can be alternatives that are much better.

  • Display and interact with a vi front panel on remote C++ app

    Hello:
    I am new to LV and need a little advice.  I need to display a LabVIEW VI front panel in my C++ .Net application that users can interact with to view real-time spectrum data.  The C++ app (client) must reside on a separate computer(s) from the VI so that the client can connect from anywhere around the world and interact with the VI. 
    I am not sure about the basic architecture that should accompany a good solution.  We want to use TCP/IP but not DataSocket.  I do not have access to Measurement Studio but I do have access to LabVIEW Professional Development System v 8.2.  Can anyone provide suggestions on what I need to do in order to
    1.  Connect to my TCP server using my C++ client app - I have already written TCP client and server code which communicate but now I need to integrate LV
    2.  Get access to the VI sitting on that server
    3.  Send the VI front panel to the client for display
    4.  Allow the user to modify parameters on the front panel displayed on the C++ client, send those changes back to the server, and refresh the front panel displayed in the C++ client given the new parameters (I would like a real-time display of the spectrum to always be available)
    Is this possible?  Has anyone done this using C++ .NET in VS2005?  Are there examples I can mimic or references that will help direct me?  I have searched and searched through NI's help and found a lot of good stuff but I'm still feeling confused about the best way to utilize LV.
    Thank you in advance!

    One more question ... what if I could use Measurement Studio?  The documentation seems to indicate that it's easy to create network applications and therefore it would be easy for me to re-create our VI's front panel using Measurement Studio components in my C++ app and then simply connect those components to the networked hardware (TCP/IP or DataSocket) that could be located anywhere in the world.
    Depending on what components you are using in your LabVIEW panel, it is probably pretty easy to build a Measurment Studio application to look like a LV panel.
    Given that, you could use network shared variables to move data across the network, no TCP programming necessary -- I think that this is pretty easy to do, but I don't know the specifics about variable programming in that environment.  Also, you will probably need to add some smarts to the server side to make sure that it is reading to and writing from variables in an appropriate manner.
    Question: why can't you just use LabVIEW for the client application also?

  • How to convert an array collection instance to a complex object for interaction with webservice

    Hi there,
    I have a stubborn problem that I am trying to work out the best way to solve the problem.  I am interacting with a WebService via HTTPService calling a method called find(String name) and this returns me a List of ComplexObjects that contain general string and int params and also lists of other Complex Objects.  Now using the code:
    ArrayCollection newOriginalResultsArray = new ArrayCollection(event.result as Array)
    flex converts my complex objects results to an arraycollection so that I can use it in datagrids etc.  Now up until this part is all good.  My problem is when getting a single instance from the results list, updating it by moving data around in a new datagrid for example - I want to interact with the webservice again to do an create/update.  This is where I am having problems - because these webservice methods require the complex object as a parameter - I am struggling to understand how I can convert the array collection instance back to my complex object without iterating over it and casting it back (maybe this is the only way - but I am hoping not).
    I am hoping that there is a simple solution that I am missing and that there is some smart cookie out there that could provide me with an answer - or at least somewhere to start looking. I guess if I have no other alternative - maybe I need to get the people who built the service to change it to accept an array - and let them do the conversion.
    Any help would be greatly appreciated.
    Bert

    Hi Bert,
    According to my knowledge you can use describeType(Object) method which will return an XML... That XML will contain Properties and values just iterate through the XML and create a new Object..   Probably u can use this method...
    public function getObject(reqObj:Object,obj:Object,instanceName:String,name:String=null,index:int=-1):Obj ect
                if(!reqObj)
                    reqObj = new Object();
                var classInfo:XML = describeType(obj);
                var className:String = instanceName;
                if(name!=null)
                    className=name+"."+className;
                if(index!=-1)
                    className=className+"["+index+"]";
                for each (var v:XML in classInfo..accessor)
                    var attributeName:String=v.@name;
                    var value:* = obj[attributeName]
                    var type:String = v.@type;
                    if(!value)
                        reqObj[className+"."+attributeName] = value; 
                    else if(type == "mx.collections::ArrayCollection")
                        for(var i:int=0;i<value.length;i++)
                            var temp:Object=value.getItemAt(i);
                            getReqObject(reqObj,temp,attributeName,className,i);
                    else if(type == "String" || type == "Number" || type == "int" || type == "Boolean")
                        reqObj[ className+"."+attributeName] = value; 
                    else if (type == "Object")
                        for (var p:String in value)
                            reqObj[ className+"."+attributeName+"."+p] = value[p];
                    else
                        getReqObject(reqObj,value,attributeName,className);
                return reqObj;
    Thanks,
    Pradeep

  • Interacting with MS Word through Java

    Hi friends,
    How to interact with a MS Word file through the java program. please send me some sample codes. Thanks in advance.....
    Regards,
    Prakash.....

    Prakashjava wrote:
    Hi friends,
    How to interact with a MS Word file through the java program. please send me some sample codes. Thanks in advance.....
    Can't be done in pure Java.

  • JNI with Fortran (and C)

    Has anyone tried this example:
    http://www.csharp.com/javacfort.html
    Im having trouble creating the .dll for the
    C code and Fortran code in Visual C++.
    any ideas?
    Thanks.

    i did compile the Fortran code with the FORCE compiler (which uses the gnu g77). I just finished installing cygwin so wish me luck in figuring it all out (its a little intimidating).
    The problem is linking the CCode.obj with the FortranCode.f in Visual C++.
    I agree that using cygwin works but its not very convenient.
    (i cant install cygwin at work where i have Visual Studio).
    Thanks.

  • Problem in Interacting with Weblogic JMS through Informatica ETL server

    Hi All,
    We are trying to configure Informatica PowerCenter server to interact with JMS queues created on Weblogic 11gR1 server. We have copied the necessary
    jar file - wlfullclient.jar to the classpath of the Informatica server.
    Now when i try to read contents of a JMS queue created on Weblogic server through Informatica, i get this error:-
    Failed to get the Queue Connection Factory [weblogic.jms.common.DestinationImpl]. Reason: Failed to look up object [While trying to lookup 'weblogic.jms.common.DestinationImpl' didn't find subcontext 'common'. Resolved 'weblogic.jms'Exception Stack: javax.naming.NameNotFoundException: While trying to lookup 'weblogic.jms.common.DestinationImpl' didn't find subcontext 'common'. Resolved 'weblogic.jms' [Root exception is javax.naming.NameNotFoundException: While trying to lookup 'weblogic.jms.common.DestinationImpl' didn't find subcontext 'common'. Resolved 'weblogic.jms']; remaining name 'common/DestinationImpl'
         at weblogic.rjvm.ResponseImpl.unmarshalReturn(ResponseImpl.java:237)
         at weblogic.rmi.cluster.ClusterableRemoteRef.invoke(ClusterableRemoteRef.java:464)
         at weblogic.rmi.cluster.ClusterableRemoteRef.invoke(ClusterableRemoteRef.java:272)
         at weblogic.jndi.internal.ServerNamingNode_1211_WLStub.lookup(Unknown Source)
         at weblogic.jndi.internal.WLContextImpl.lookup(WLContextImpl.java:418)
         at weblogic.jndi.internal.WLContextImpl.lookup(WLContextImpl.java:406)
         at javax.naming.InitialContext.lookup(InitialContext.java:392)
         at com.informatica.powerconnect.jms.server.common.JNDIConnection.getJNDIObject(JNDIConnection.java:84)
         at com.informatica.powerconnect.jms.server.common.PlginJMSConnection$PlginJMSQueueConnection.createConnection(PlginJMSConnection.java:363)
         at com.informatica.powerconnect.jms.server.common.PlginJMSConnection.<init>(PlginJMSConnection.java:90)
         at com.informatica.powerconnect.jms.server.common.PlginJMSConnection$PlginJMSQueueConnection.<init>(PlginJMSConnection.java:352)
         at com.informatica.powerconnect.jms.server.common.PlginJMSConnection.create(PlginJMSConnection.java:115)
         at com.informatica.powerconnect.jms.server.reader.JMSReaderSQDriver.createPartitionDriver(JMSReaderSQDriver.java:557)
    Caused by: javax.naming.NameNotFoundException: While trying to lookup 'weblogic.jms.common.DestinationImpl' didn't find subcontext 'common'
    I have checked that this class file exists in the above said location :- "weblogic/jms/common/DestinationImpl.class" within the wlfullclient.jar but still the
    code is not able to access the class. Similar error came initially while doing JNDI connection using "weblogic.jndi.WLInitialContextFactory" class but it vanished,
    when i explicitly named the jar file on classpth, instead of just the folder containing the jar file.
    To all the users/experts/moderators of Weblogic - Could you please help me understand why Weblogic is not able to look up subcontext 'common'
    for the class - "weblogic.jms.common.DestinationImpl" ??
    Thanks & Regards
    Raj
    Edited by: user8931188 on May 17, 2012 7:39 AM

    You are experiencing a NameNotFoundException, not ClassNotFoundException so it seems there is something wrong about the client connection code or WebLogic config.
    Can you share your client connection connection config/code?

  • How can I interact with a Database?

    I've got a project I'm working on in my Java class, and I can't find out how to make the program interact with a database. I was wondering if anybody here could help me out at all? My partners and I have already gotten most of the program figured out (but not programmed), and this is giving us a little bit of trouble. Our books don't have this information, and our teacher told us to check here, so here I am. Any help would be appreciated. Thanks.

    You need to get a jdbc driver for your database. Your vendor should provide you with one. If not then you can try looking for free implementations of that particular database.
    This jdbc driver is used by your program to execute sql statements in the database itself, removing the need for you to handle all the nitty gritty stuff. Kind of like ODBC.
    Like the earlier post pointed out, the tutorials is a good place to look at code samples
    I've got a project I'm working on in my Java class,
    and I can't find out how to make the program interact
    with a database. I was wondering if anybody here
    could help me out at all? My partners and I have
    already gotten most of the program figured out (but
    not programmed), and this is giving us a little bit of
    trouble. Our books don't have this information, and
    our teacher told us to check here, so here I am. Any
    help would be appreciated. Thanks.

  • Combo box visible and loaded but cant interact with it

    I have two swf files onSiteSearch and onSiteReg. Both work as
    expected when used alone but when onSiteReg is loaded from onSite
    Search the comboBox on onSiteReg cannot be interacted with. It is
    visible and has the correct data in it but there is no ability to
    drop down the comboBox. I have tried many suggestions I have found
    here including making sure there is an instance of the comboBox in
    the onSiteSearch but nothing seems to change.
    The onSiteSearch brings up a dataGrid and when a list item
    from the grid is click it loads the onSiteReg (see code below).
    Everything works as it should including checkBoxs and actionScript
    but I can change the selected choice in the comboBox.
    Thanks in Advance for any insight and/or help.
    var dgListener:Object = new Object();
    dgListener.cellPress = function(event) {
    txtTalentEventID.text =
    dgResults.getItemAt(event.itemIndex).TalentEventID;
    _global.thisTalentEventID =
    dgResults.getItemAt(event.itemIndex).TalentEventID;
    loadMovie("onSiteReg.swf",_level0);
    dgResults.addEventListener("cellPress",dgListener);

    Ok. I changed the code to use loadMovieNum like this:
    var dgListener:Object = new Object();
    dgListener.cellPress = function(event) {
    txtTalentEventID.text =
    dgResults.getItemAt(event.itemIndex).TalentEventID;
    _global.thisTalentEventID =
    dgResults.getItemAt(event.itemIndex).TalentEventID;
    //loadMovie("onSiteReg.swf",_level0);
    loadMovieNum("onSiteReg.swf", 2);
    dgResults.addEventListener("cellPress",dgListener);
    and now the onSiteReg comboBox works fine but now i have both
    movies on the screen at the same time and can't figure out how to
    get rid of onSiteSearch.
    Yes, I am new to this flash stuff. Have been doing CF since
    v2.0 but flash is kicking my ***!

  • Java interaction with websites?

    Hey,
    I'm been learning java for a few months now, and know the basics well, I have written a few small programs, including one which transfers songs from iPod to computer.
    I need some advice on where to start on my next project. Basically I want to make a program which automatically performs tasks in the background on websites, for example listing an item on ebay, or uploading a video to youtube. And I'd also like it to read information from different pages, so that I could maybe gather a database of prices from ebay, or somthing along those lines.
    Which classes could I use java to interact with html?
    Where do I start? :)
    My java vocabulary isn't great yet ;)

    Ryanz wrote:
    Ok ... I'm checking it out at the moment, are there any other maybe simpler ways? Or can somone explain how to get the JAX-WS installed and ready to use with eclipse?Ryanz,there are few things involved here.
    1).First and foremost you need to findout whether if respective website offers you any kind of Web-Services to serve your cause.
    Just as an example eBay offers set of services to serve your cause to know more about this you can visit the below links
    [http://www.xml.com/pub/a/2005/09/28/ebay-metadata-web-services.html]
    [http://developer.ebay.com/community/featured_projects/default.aspx?name=Code%20Samples%20Project]
    Similarly identify whether if respective other focused webservice providers offer any specific services serving your cause.
    2).Analyse their service specifications
    3).Identify and Plan for list of Data Transfer Objects to which we can bind this service
    4).Implement for a Stub (may be using Apache Axis) or use JAX-RPC or use JAX-WS or any other related technologies to implement your Webservice Client.
    Coming back to using tools like Apache Axis,JAX- RPC or JAX-WS.
    you might be intrested in looking towards the below set of turtorials
    [http://www.onjava.com/pub/a/onjava/2002/06/05/axis.html]
    [http://www.ibm.com/developerworks/webservices/library/ws-castor/]
    [http://java.sun.com/j2ee/1.4/docs/tutorial/doc/JAXRPC.html]
    [http://www.ibm.com/developerworks/edu/j-dw-java-jaxrpc2-i.html]
    [http://java.sun.com/webservices/docs/2.0/tutorial/doc/]
    [http://www.myarch.com/create-jax-ws-service-in-5-minutes]
    It is not nessary that a provider has to provide relvant data in form offering webservices and sometimes they can offer you different specs which could be Like regular Java RMI services or DCOM object or something like Feeds(RSS 2.0/ATOM) for providing Latest updates on your account.I'd say it'd be more work for us to identify what kind of service the provider is provding us and how best make use of it so that we can use the relavant data in our application.
    and believe me in most of the cases only point 4 changes after going through point 1,2 & 3.
    Hope that helps :)
    REGARDS,
    RaHuL

  • How do I interact with a loaded swf?

    Hi,
    I have a "lesson" that I'm building that will display a series of "pages" based on an XML file. I have simple navigation buttons that work to page through the XML file. but I'd like to use load an external SWF file with buttons to use as my navigation panel. Everything is AS 3.0. The code to load the navigation movie looks like this:
    // load navigator
       navLoader = new Loader;
       navLoader.contentLoaderInfo.addEventListener(Event.INIT, handleInit);
       navLoader.x = 50;
       navLoader.y = 200;
       lessonSprite.addChild(navLoader);
       navLoader.load( new URLRequest("Navigator1.swf"));
    The loaded navigation movie has two buttons. How do I add an event listener to those buttons so that they call a function in the parent movie so I can detect when the user clicks on the button named "GoNext" in the loaded movie?  I've tried several ways but I've had no luck. Could someone please point me in the right direction? This navigation panel is only one application of this sort of communication that I'll need in other parts of this type of lesson so I really need to figure out how to detect user interaction interaction with the loaded movie. Guess I need to know how to call a function in the parent movie from the loaded movie.
    Thanks,
    Peter H.

    Hey Pete,
    The answer that you seek and the simplest one as well will be from the MouseEvent. that  you will most likely have applied to your loaded swf.
    As long as both swfs are in the same domain, you wont have any issues with security and therefor, the MouseEvent. which bubbles up, will be able to reach your swf file which has loaded it.
    You can then write your code in your loaded swf to simply listen to the loadedMovieClip  by targeting the contents of navLoader just like this,
    navLoader.content.addEventListener(MouseEvent.MOUSE_DOWN,onDown)
    protected function onDown(me:MouseEvent){
    now providing you have given your two buttons names in your loaded swf, you will be able to perform addition tasks by receiving the name of the target.
    protected function onDown(me:MouseEvent){
    var btnClip:Movie= me.target as MovieClip
              var btnName=btnClip.name
    if(btnName==(button1)){
         //do the following
    }else{
           //it was button two
    button1 was just a random name in this case .
    This will do the trick

  • How to make player interact with game world objects?

    I am trying to make a side scrolling rpg game similar to South Park Stick of Truth. Right now I have the player done and i sketched the outline of the room i wanted in order to test the the collision detector. So right now there are only 4 classes. The main class that adds the walls, player and does something with the constants class.The walls class that doesn't really do anything. The player class that moves with keyboard input, test for collisions with the walls and initiates the walking animation. There is also a constants class that i don't really know how it works but based on tutorials I have seen they want me to use it. I want to add different things in the room that when the player gets close enough to, it allows the person playing to press a button and it will interact with it. It could be for making a small animation, having the player do some different dialog or have a closer look at the object. I can't find any tutorial on how to do that. All the actionscript 3 tutorials are for really simple shooter and platform games that don't interact with the game world at all. Any help would be greatly appreciated.

    You could make all of your "interactable" objects implement an interface. Say for example your Interface defines showButton() and hideButton() functions. Then, when you detect a collision on any of these objects, you call showButton(). The button can be set up to dispatch an event that your Main Class is listening for. For example, this might be a custom MoreInfoEvent that has its own "infoItem" property in addition to the other properties Event has.
    The code might look like this:
    protected function onButtonClick(e:MouseEvent):void {
         dispatchEvent(new MoreInfoEvent(MoreInfoEvent.SHOW_INFO, true, "rockObject"));
    Then the MainClass would do something like this:
    protected function onMoreInfoEvent(e:MoreInfoEvent):void {
         switch(e.infoItem) {
              case "rockObject":
                   rockInfo.visible=true;
                   break;
              //other case statements for other info
              default:
                   break;
    If you don't know how to create a custom event, there are a lot of tutorials for that.

Maybe you are looking for