POS - Port Operaton System

Working on Port operation system of one of the PSU. The processes have been mapped in std PM/SD functionalities. lots of developments requried to satisfy the requirement.
Can functionalities be used from Bulk transportation for mining - Marine Scheduling, Fleet mgt with Vessel Characteristics, Nomination, Berth planning board, Berth Scheduling, Laytime/Demurrage etc in ECC 6.0.
This will help to get integrated std SAP solution. Please provide your inputs.

Hi Avinash,
We are facing similar issue, I hear that Traders and Schedulers Workbench with is part if IS-OIL has these functionalities. The standard SAP does not have any mechanism to track this. Did you find any solution for your implementation. It would be great if you could share your experience in tackling this situation.
Regards
Gunjan

Similar Messages

  • Integration of GIS & POS (Port Operational System)

    Hi ALL,
    can anyone come across integrating the GIS( geographical Information system) and POS ( Port Operational system) with XI...?
    Thanks in Advance...
    Regards,
    vasanth.

    Hi,
    Please can anyone can provide step by step solutionns to start integrating the GIS system with XI...
    Thanks in advance..
    vasanth.

  • ChaRM for Dual Stack ABAP & JAVA - No http port for system SPD

    Hi,
    I have configured the CHARM for Dual stack ( Java, ABAP). when I perform the action 'Logon to System' it gives me following option
    " The system is a dual stack system. You can log
    on to the ABAP stack or non-ABAP stack
    To which stack do you want to log on?
    ABAP or Non ABAP"
    If I click on Non ABAP, one more message comes
    "You can logon to system SPD or just display its
    transport requests
    What do you want to run?
    Requests  Or Logon"
    If I click on Logon I get the Information " No http port for system SPD "
    & If I click Continue It will take me to Ugent Correction & error appears as 'Action System Logon in system SPD 100 of type Source Systems has been cancelled'
    How to Solve this error.
    Regards
    PK
    Edited by: PK on Sep 1, 2010 5:59 AM

    Its possible to login to portals(non-ABAP systems).
    Please check.
    http://wiki.sdn.sap.com/wiki/display/SMSETUP/Initial+Configuration
    Pl. make sure SLD for the Java stacks are defined correctly.
    regards,
    Arun.

  • Reports at POS & SAP Retail System

    Hi Experts
    What are all reports run POS and SAP Retail System at end of the day..
    How the reports are run at POS and SAP System?
    Thanks for your time
    vijaya

    Hi Experts
    What are all program run in POS & Retail System at EOD
    Regards
    Vij

  • Token and smart card reader are not detected on Mavericks if not plugged on a USB port during system boot

    Well, both token and smart card reader are not detected on OS X 10.9 if not plugged on a USB port during system boot. So, if I am already working within the system and need to use my certificates I have to plug the token or smart card reader on a USB port and restart Mavericks.
    Token is a GD Starsign and Smart Card Reader is a SCR3310 v2.
    Thoughts?

    SCS is a very good app, since I've read that Apple has discontinued support for PC/SC interfaces after the release of Mountain Lion.
    (My previous installation was a Mavericks upgrade from Lion)
    However, I don't know what and how to debug using Smart Card Services. Do you know any commands to use?
    Apparently, the SC reader reports no issues: the LED is blinking blue when no smart card is present and becomes fixed blue when a smart card is inserted – according to the manuals, this shows that there is correct communication between the OS and the CCID reader.
    I don't know what to do; I'm beginning to hypothesize it's a digital signer issue. In fact, my smart card only supports one application called File Protector (by Actalis) to officially sign digital documents. This application seems to have major difficulties in identifying the miniLector EVO.
    The generic and ambiguous internal error comes when I try to manually identify the peripheral.
    Athena CNS is one of the Italian smart cards and is automatically recognized and configured (so it's correct – no doubts about this), while "ACS ACR 38U-CCID 00 00" seems to be the real name of the miniLector.
    (I'm assuming this because System Information also returns that the real manufacturer is ACS... bit4id is a re-brander)
    However, when I click on it and then tap OK, it returns internal error.
    As first attempt, I would try to completely erase&clean File Protector files to try a reinstall. Then, if this still doesn't work, I'd debug using the terminal.
    So:
    - Do you know any applications to 100% clean files created by an installer?
    - Do you have in mind any solutions that I might have forgotten?
    Thanks in advance from an OS X fan!

  • Limiting POs from backend system for Confirmations

    We have activated the ALE model for Confirming Goods Receipt from backend POs.  I know that I can use BADI BBP_WF_LIST to filter the POs displayed in the Create/Display Confirmation transaction.  However I would like to limit the POs that are sent from the backend system to EBP by document number range.  This should prevent cluttering the EBP system with junk POs.  Is this possible?
    Thanks,
    Nancy

    Hi
    <b>Please go through the links below, which deal with the same issue -></b>
    BADI BBP_WF_LIST implementation
    Re: Is it the right BADI
    Get PO details from backend
    Filtering content in the SRM confirmation worklist
    Re: Worklist for confirm goods using BBPCF02
    Problem in badi for sourcing worklist 'BBP_WF_LIST'
    Re: Confirm Goods / Services Centrally - BBPCF03
    Using BADi's BBP_PGRP_FIND  and BBP_WF_LIST  for Sourcing
    Hope this will help.
    Do let me know.
    Regards
    - Atul

  • BioSRC: a Ports-like system for installing bioinformatics software

    While this might not be of great use for people administering their own Arch Linux system, I do know that there are at least a couple other bioinformaticians around these parts who might find it useful anyway. Many bioinformaticians use shared computing resources (clusters), so they do not have administrative permissions to install software system-wide.  Instead, we manually install software to our home directories or shared drives. Unfortunately, bioinformatics software is usually released by biologists, not software engineers, so the packaging standards, if there are any, generally leave something to be desired. Often some amount of manual work needs to be done to compile and install the software.
    I got tired of dealing with this on a personal level and in our group we were setting up a lot of software to be shared between us. So, I hit on the idea of adapting another package that I maintain, GSRC, which uses the Ports-like GARstow system to install GNU software, to produce a dedicated system for easily installing bioinformatics software, called BioSRC.
    BioSRC includes many common bioinformatics tools (under pkg/bio), as well as general tools that are useful in analysis pipelines (pkg/tools), bioinformatics-related libraries or library-dependencies of other BioSRC software (pkg/libs) and the latest versions of common programming languages/environments (pkg/dev...really handy if, like me, your cluster only has ancient versions of Python). New packages are being added as fast as I can and I welcome requests (note that I'm only adding properly licensed free and open source software...no "academic use only", license-free, or otherwise proprietary software will be included in BioSRC).
    Currently there are no formal releases but rather you should just  clone the Git repository. Setting up is simple:
    $ git clone git://gitorious.org/biosrc/biosrc.git
    $ cd biosrc
    $ ./bootstrap
    $ ./configure --prefix=/foo/bio-software
    $ make install
    The last step is optional and just installs the documentation ("info biosrc") and a biosrc script (see below).
    After that, any software can be installed easily to your chosen directory, /foo/bio-software in the above example, with Make:
    $ make -C pkg/bio/ncbi-blast install
    This will fetch the package, verify its checksums, extract it, configure it, build it and finally install it. Under your install prefix, packages are first installed to the "packages" directory and their contents are then symlinked into the standard locations under the prefix (i.e. ${prefix}/bin/bar will be a link to ${prefix}/packages/foo-1.0/bin/bar). Installing a new version of a package does not uninstall the old version; only the links are replaced. Thus, if you still need to use the old version for whatever reason, it  remains available in the packages directory.
    To make your life even easier, the biosrc script automates a lot of stuff for you, allowing you to install, uninstall, search, display info, etc from any directory:
    $ biosrc search alignment
    $ biosrc info hmmer
    $ biosrc install ncbi-blast
    See the documentation for more information.
    Enjoy!
    Website
    Project site on Gitorious
    Mailing List
    Last edited by jakobcreutzfeldt (2014-03-07 13:51:18)

    THIS IS CHEATING!!!!!!!!!!!!!!!!!!!!!!!!!!
    People ranging from system experts to housewives install Adobe software all the time, but most of the times this occurs under very stressfull situations like: an opreating system reinstall or just after unboxing a brand new computrer. People does not come to Adobe website to browse and see if they like something, they come because they are unable to make another piece of software work, lot of them come frustrated or in a hurry, and they do not notice the check box, it is intentionally designed to pass unoticed. Even experts hit "download" without any further reading, just becuase Adobe was believed to be a serious and reliable company. But this kind of practices deminishes your credibility and image. I think, having the checkbox checked by default is not a nice practice, in fact I consider it unethical and fraudulent. A honset company would make very sure to have a checkbox like this cleared by default.
    I used to trust blindly in companies like yours, because I considered them honest and ethical, but sadly this changes everything.
    Too bad you cheat people like this.

  • TS2002 using a multi-port adapter to increase the number of USB ports - affects system functioning?  Port priority?  In advance, I send my thanks!

    Hello.  I've never "started a discussion" before.  Ah well I've always had good luck with the communities so here goes.  Today I plugged a Belkin multi-port adapter into my MacBook Pro running OS X Version 10.6.8  This enabled me to plug in my keyboard; mouse and printer.   Yes after two years I wanted to be back to an independent full keyboard and mouse.  BUT ALAS!  Now the little spinning wheel keeps appeariing while I'm on the Internet and I learned through my "Help" app that I have "slow start-up, pausing at Initializing network or "Configuring network time"  (sounds like some of the men I've dated).
    Could it be the multi-port adapter?  Should I use a different model?  The abiltiy to have the printer; keyboard and mouse all connected at the same time is important to my work. 
    In advance, I send my thanks!
    Jeannie-Marie

    I think it is the server socket which controls the number of client sockets to be opened. The number of connections that are accepted by the server socket is called the backlog of server socket. By default its value is 50. (See java.net.ServerSocket class in java docs)...
    we can specify the backlog in the constructor of server socket...
    ~pacific

  • Lab View is not detecting two com ports of system

    Hi,
       In my PC, three com ports are there COM1, COM4 and COM6. But when we create new visa resource name, lab view is detecting only COM1 port. I want to know is there any way to correct this.
    Regards
    Shivakumar Singh

    Hi,
    First of all check if the ports are visible in the NI MAX. If not, you can try to Create New Port by going into Measuremenmt & Automation Explorer. Assign the Port values accordingly. This can be done by right clicking on the Ports (Serial & Parallel) section of the Devices and Interfaces tree.
    Regards,
    Deepu.

  • Cannot specify non-default KDC port using system property krb5.kdc

    For testing / debug it's very useful to be able to run the KDC on a non-default port. This can be specified in Kerberos config file by appending the port number to the KDC host name, delimited with a colon.
    The java.security.krb5.kdc property can be used to locate the KDC - Unfortunately in Config.java in the sun.security.krb5 package, when parsing the property the colon is used as a delimiter for multiple KDCs. The config object String.replace()s the colons with space chars. Then the KrbKdcReq.java module, when testing for a non-default port in the KDC string from the config object, looks for the colon delimiter - but this has been zapped. So it seems that it's not possible to specify the non-default port via the property.
    The workaround is to use the config file approach instead, but this is inconvenient and limits programmability (especially when using configuration reload) - Is there a prospect that the config parser might be adjusted backwards compatible (say, to recognise a double colon or an escape char) to fix this?
    regards
    Ted Hayes

    Greetings
    I'm sorry to dig this thread up, but I could really use some help concerning this. I need to set up ApacheDS in a remote machine, but I'm not allowed to have root access to it, which means I can't make ApacheDS to run its KDC at port 88. Port 88 is a reserved port in *nix machines, so I can't make ApacheDS to list on that port without admin previledges.
    On the other hand, I already have a client/server demo program that can connect to a kdc (which can be found at http://thejavamonkey.blogspot.com/2008/04/clientserver-hello-world-in-kerberos.html), but I don't know how to set it up to run on any other port. I noticed that teddy_salad mentioned something about a config file approach, but I don't know what he is referring to.
    At this point I should mention that its my first time trying to use JGSS, but I'm also running out of time to make the ApacheDS work. I'm supposed to make some benchmarking tests for my masters degree dissertation, and the deadline is approaching :\
    I only need to know how to change hte default port to which that application connects to. Thanks in advance to anyone who replies to this.

  • Tracking legacy system POs in Oracle

    Has anyone imported Requisitions from multiple legacy systems, Autocreated Purchase Order using those Reqs and extracted the Purchase Order information for interface back to the legacy systems? How do you differentiate the POs for one legacy system from another? Did you track a legacy system identifier with the Purchase Order to allow only POs for specific systems to be extracted? Is this a flag? Flexfield (How since flexfields aren't carried through the Autocreate process)?
    Thanks for any help!
    Cara

    POs from different legacy systems can be identified through the INTERFACE_SOURCE_CODE field in the following PO tables:
    po_requisitions_interface_all
    po_requisition_headers_all
    po_headers_all
    Hope this helps you.

  • Secound eithernet port fails to sending DHCP after system startup.

    I am trying to up grade a g4 xserve from 10.3.9 to 10.4. Sotfware installs ok but shortly after start up the system light starts flashing.
    I have setup DHCP service on eithernet port en1 which send ip address to clients on startup but quits when system light starts flashing and clients can no longer retive ip address. I have tried to reinstall software but keep getting the same responce from en1 port and system light. Would like to know if this is a problem with my pci card ( pci106,B ) or with 10.4 or maybe the firmware?
    The xserve worked fine under 10.3 with no problems with the en1 port or dhcp service.
    John

    It turned out that the firewall was still blocking dhcp on en1, not shure why system identifier light is blinking.

  • Porting an old system to a new one

    I am working on a project which is in the maintainance stage. The current configuration being -->
    Currently my system is working on -->
    OS == RedHat 7
    Web Server ==Tomcat4
    DB ==Postgres 7.
    Tomcat ==jdk 1.3
    Struts ==1.0
    Java Classes ==jdk 1.4
    We are planning to port the system to -->
    OS ==CentOS 5
    Web Server == Tomcat5(because CentOS 5 works with Tomcat5 or above as per my knowledge)
    DB == Postgres 8
    The problem is there are many deprecated functions present which are giving a problem. Also according to my knowledge the newer versions of Tomcat do not support the lower jdk versions.
    It will be a lot of trouble to change deprecated functions because it is a huge project and I am a fresher with no previous working experience in java.
    Can you give me some tips/idea what problems can occur while porting the old system.

    The dropdown list is supposed to show #10 not #1....
    09-10-2008 (A) // #1
    10-10-2008 (B) // #2
    11-12-2008 (F)[2A][5P] // #10
    13-12-2008(G)[7P] // #14
    14-12-2008(D) // #15
    ummm .. ok... there are more operations which we have 2 perform on the above resultset...
    #1,#2,#5 these results are no longer used... i mean there are no further operations to be done... but should be displayed in the dropdown.
    But #10 and #14 these records are further used to fetch data from the DB..
    so depending on the value which is being displayed (selected = true) )in the dropdown list a query is fired .... to get details about the selected record. When the required operation are done ...
    #10 --> 11-12-2008 (F)[2A][5P] //( on 11 dec 2008 for shift F 2 employees were absent and five were present. )
    so these will be authenticated by senior employee and # 10 will be reduced to...
    #10 --> 11-12-2008 (F) // (employees authenticated. Now this becomes like record #1 , #2 and #15 which are not used but sholud be present in the dropdown )
    After this the control is again transferred to checkIn.jsp where the selected ie the current value being displayed should be #14..... and not #1 .
    But the value displayed is #1... BUT if we restart Tomcat for the first request for checkIn.jsp the correct record is displayed.. den it keeps on displaying #1
    All this is working properly in the older system... but if we try and run the same code on new system then it is giving problem.

  • Attach Forms With Comm Port in Oracle Forms

    I am trying to make connection of Oracle forms Builder with my device using comm port but i dnt know the complete procedure to attach the comm with oracle forms also i have no idea to convert asquii data to normal form.Please any one help me to attach comm port with my oracle forms and also convert asqui code which is showing on hyper terminal into normal data.Also I am using oracle forms 6i

    Make a java component (PJC) and use a rxtx library (http://rxtx.qbang.org/wiki/index.php/Examples) ...
    I have made a PJC to use a RS232 port from oracle forms for Hypercom POS terminal..
    Here is my code (in short i will post a component on PJC site (here I can't post a complete code because of 30000 char limit ;) )..
    If you look in method "public void init(IHandler handler) " I make a download of rxtxSerial.dll from my forms server and then I call System.loadLibrary("rxtxSerial");"
    In other way you must put the dll in windows/system32 path.. This dll is native library for rs232 communication.
    If you look at the method "public void doTransaction" you can see the initialization of comm port...
    With inputStream and OutputStream you read and write datas to/from your rs232 port..
    p.s: the code is not complete but you can see how I made the rs232 communication (also the code is not final ;) )
    ====================================================
    public class PosTerminalPjc extends VBean {
         private static final long serialVersionUID = -8814623494538014849L;
         Properties res = new Properties();
         SerialPort serialPort;
         OutputStream os;
         InputStream is;
         CommPortIdentifier portId;
         Enumeration portList;
         IHandler mHandler;
      Random randomGenerator = new Random();
            char STX = 2;
         char ETX = 3;
         char EOT = 4;
         char ACK = 6;
         char NAK = 15;
         char FS = 28;
         private static final ID COMPORT         = ID.registerProperty("COMPORT"); // serial port (COM1,COM2,COM3,...)
         private static final ID AMOUNT          = ID.registerProperty("AMOUNT"); // amount of the transaction (12)
         private static final ID TRANSACTIONTYPE = ID.registerProperty("TRANSACTIONTYPE"); // SALE, REFUND
      private static final ID EXECUTE         = ID.registerProperty("EXECUTE"); // invoke doTransaction();
      //Output parameters to form
      private static final ID TRANSACTIONPROCESSED  = ID.registerProperty("TRANSACTIONPROCESSED");
      private static final ID TRANSACTIONFLAG       = ID.registerProperty("TRANSACTIONFLAG");
      private static final ID TRANSACTIONNUMBER     = ID.registerProperty("TRANSACTIONNUMBER");
      private static final ID BATCHNUMBER           = ID.registerProperty("BATCHNUMBER");
      private static final ID TRANSACTIONDATE       = ID.registerProperty("TRANSACTIONDATE");
      private static final ID TRANSACTIONTIME       = ID.registerProperty("TRANSACTIONTIME");
      private static final ID TRANSACTIONAMOUNT     = ID.registerProperty("TRANSACTIONAMOUNT");
      private static final ID CARDDATASOURCE        = ID.registerProperty("CARDDATASOURCE");
      private static final ID NUMBERCUSTOMERCARD    = ID.registerProperty("NUMBERCUSTOMERCARD");
      private static final ID EXPIRATIONDATE        = ID.registerProperty("EXPIRATIONDATE");
      private static final ID TERMINALID            = ID.registerProperty("TERMINALID");
      private static final ID MERCHANTID            = ID.registerProperty("MERCHANTID");
      private static final ID COMPANYNAME           = ID.registerProperty("COMPANYNAME");
      private static final ID SEQUENTIALNUMBER      = ID.registerProperty("SEQUENTIALNUMBER");
      private static final ID ERRORDESC             = ID.registerProperty("ERRORDESC");
         //Events
      private static final ID EVT_OK  = ID.registerProperty("EVT_OK"); //custom event if all ok
      private static final ID EVT_ERR = ID.registerProperty("EVT_ERR"); //custom event if error occured
      // state machine variables
         long l_timeout;
         long l_wait_for = 5000; // pos terminal wait for command (5 seconds)
         long l_wait_for_transaction = 62000 * 2; // pos terminal timeout
         long l_second = 1000; // one second
         byte b_retry = 0;
         String dataValue = "";
      byte[] readBuffer = new byte[2000]; //2000 bytes buffer to read rs232 stream
         String comPort = ""; // local variable to store com port name
                                       // (COM1,COM2,...)
         String transactionType = "SALE"; // type of transaction to be executed (SALE
                                                      // or REFUND) default SALE
         String amount = "0"; // default amount value is set to 0
         //output paramerers
      String transactionProcessed = "";
      String transactionFlag = "";
      String transactionNumber = "";
      String batchNumber = "";
      String transactionDate = "";
      String transactionTime = "";
      String transactionAmount = "";
      String cardDataSource = "";
      String numberCustomerCard = "";
      String expirationDate = "";
      String terminalId = "";
      String merchandId = "";
      String companyName = "";
      String sequentialNumber ="";
      String errorDescription;
        public PosTerminalPjc() {
              super();
              System.out.println("============================");
              System.out.println("== State machine POS v1.0 ==");
              System.out.println("== Peter Valencic (c)     ==");
              System.out.println("== 03.04.2012             ==");
              System.out.println("============================");
        System.out.println("java.library.path: "+System.getProperty("java.library.path"));
              try {
                   res.load(this.getClass().getResourceAsStream("/res/language.properties")); // load language file
              } catch (Exception ex) {
                   System.err.println("Err loading language.properties file: "
                             + ex.toString());
      public void init(IHandler handler)
        super.init(handler);
        this.mHandler = handler;
        System.out.println("init handler ok");
        System.out.println("code base: "+handler.getCodeBase());
        //load dll from codeBase URL
        try
          String mylibName = "rxtxSerial.dll";
          String URLpath = "http://dekani:7777/forms/java/";
          System.out.println("URL: "+ URLpath + mylibName);
          URL libUrl = new URL(URLpath+mylibName);
          System.out.println("libUrlgetFile: " + libUrl.getFile());
          File file = new File(mylibName);
          System.out.println(file);
          if (!file.exists())
          file.createNewFile();
          URLConnection urlc = libUrl.openConnection();
          InputStream in = urlc.getInputStream();
          FileOutputStream out = new FileOutputStream(file);
          byte[] buffer = new byte[1048];
          int read;
          while ((read = in.read(buffer)) != -1){
             out.write(buffer, 0, read); // write
            out.close();
            in.close();
            System.loadLibrary("rxtxSerial");
        catch(Exception exc)
          System.err.println("Exception SystemLoadLibrary: " + exc.toString());
          this.showError(res.getProperty("s_dlg_err_title"),res.getProperty("s_lib"));
      private void doTransaction() throws Exception {
        String sequentialNumber = ""+getRandomInteger(1000,9000,randomGenerator);
              String phase = null; // initial null value for state machine phase
              long l_ack_timeout = 0; //initial value for acknowledge timeout
              // com port check
              if (getComPort().trim().equalsIgnoreCase("")) {
                   this.showError(res.getProperty("s_dlg_err_title"),
                             res.getProperty("s_com_invalid"));
              if (this.mHandler != null)
                                CustomEvent ce = new CustomEvent(this.mHandler, EVT_ERR);
                                this.setErrorDescription(res.getProperty("s_com_invalid"));
                                dispatchCustomEvent(ce);
                   return;
              // transaction type chek
              System.out.println(this.getTransactionType());
              if (!getTransactionType().equalsIgnoreCase("REFUND")
                        & !getTransactionType().equalsIgnoreCase("SALE")
            & !getTransactionType().equalsIgnoreCase("TICKET")
            & !getTransactionType().equalsIgnoreCase("VOID")
                   this.showError(res.getProperty("s_dlg_err_title"),res.getProperty("s_tran_invalid_type"));
          if (this.mHandler != null)
                                CustomEvent ce = new CustomEvent(this.mHandler, EVT_ERR);
                                this.setErrorDescription(res.getProperty("s_tran_invalid_type"));
                                dispatchCustomEvent(ce);
                   return;
              portList = portId.getPortIdentifiers();
              while (portList.hasMoreElements()) {
                   portId = (CommPortIdentifier) portList.nextElement();
          System.out.println(portId.getName());
                   if (portId.getName().equalsIgnoreCase(this.getComPort())) {
                        System.out.println("Port is used : "
                                  + portId.isCurrentlyOwned());
                        serialPort = (SerialPort) portId.open("ComDriver", 2000);
                        serialPort.setSerialPortParams(9600, SerialPort.DATABITS_7,
                                  SerialPort.STOPBITS_1, SerialPort.PARITY_EVEN);
                        serialPort.notifyOnDataAvailable(true);
                        serialPort.notifyOnOutputEmpty(true);
                        os = serialPort.getOutputStream();
                        is = serialPort.getInputStream();
                        break;
              if (portId == null) {
              this.showError(res.getProperty("s_dlg_err_title"),res.getProperty("s_com_not_found"));
          if (this.mHandler != null)
                                CustomEvent ce = new CustomEvent(this.mHandler, EVT_ERR);
                                this.setErrorDescription(res.getProperty("s_com_not_found"));
                                dispatchCustomEvent(ce);
                   return;
        else if (portId.getName().equalsIgnoreCase(this.getComPort()) == false)
                  this.showError(res.getProperty("s_dlg_err_title"),res.getProperty("s_com_not_found"));
          if (this.mHandler != null)
                                CustomEvent ce = new CustomEvent(this.mHandler, EVT_ERR);
                                this.setErrorDescription(res.getProperty("s_com_not_found"));
                                dispatchCustomEvent(ce);
          return;
              // state machine infinite loop
              while (true)
                   // SEND DATA TO POS TERMINAL
                   if (phase == null)
                        System.out.println("start phase");
                        byte[] req = null;
                        //verify transaction type to be SALE or REFUND
                        //if REFUND then transaction number must be specified
                        if (getTransactionType().equalsIgnoreCase("SALE")) {
                             System.out.println("--> SALE send message to the pos terminal");
                             System.out.println("--> amount: " + amount);
                             req = protocolStream("000000"+sequentialNumber+"01100" + FS + amount + FS
                                       + FS + "+0" + FS + "978" + FS + FS + FS + FS + FS
                                       + FS + FS + ETX);
                        else if (getTransactionType().equalsIgnoreCase("REFUND")) {
                             System.out.println("--> REFUND send message to the pos terminal");
                             System.out.println("--> amount: " + amount);
                             System.out.println("--> transaction number: " + getTransactionNumber());
                             req = protocolStream("000000123405100" + getTransactionNumber() + FS + amount
                                       + FS + FS + "+0" + FS + "978" + FS + FS + FS + FS
                                       + FS + FS + FS + ETX);
            else if (getTransactionType().equalsIgnoreCase("VOID")) {
                             System.out.println("--> VOID transaction");
                             System.out.println("--> amount: " + amount);
                             System.out.println("--> transaction number: " + getTransactionNumber());
                             req = protocolStream("000000123410100" + getTransactionNumber() + FS      + FS + FS + "+0" + FS + "978" + FS + FS + FS + FS
                                       + FS + FS + FS + ETX);
            else if (getTransactionType().equalsIgnoreCase("TICKET")) {
                             System.out.println("--> TICKET duplicate");
                               req = protocolStream("000000123413100" + getTransactionNumber() + FS      + FS + FS + "+0" + FS + "978" + FS + FS + FS + FS
                                       + FS + FS + FS + ETX);
            else {
                             //nothing ;)
                        os.write(req);
                        os.flush();
                        l_ack_timeout = System.currentTimeMillis() + 1500;
                        //wait for half second
                        Thread.sleep(500);
                        l_timeout = System.currentTimeMillis() + l_wait_for; //add some time for timeout
                        phase = "TO_POS_ACK";
                        System.out.println("phase: " + phase);
                   }//phase null
                   //CHECK IF THE TIMEOUT OCCURED
                if (phase.equalsIgnoreCase("TO_POS_ACK") & (l_timeout < System.currentTimeMillis()) & (b_retry < 4))
                    b_retry += 1;
                    System.out.println("TIMEOUT: " + b_retry);
                    l_timeout = System.currentTimeMillis() + l_wait_for;
                    if (b_retry >= 4) {
                        System.out.println("Timeout occured");
                        closePort();
                        this.showError(res.getProperty("s_dlg_err_title"),res.getProperty("s_timeout"));
                        break;
              //CHECK FOR THE ACKNOWLEDGE (FIRST RESPONSE FROM POS TERMINAL)
                if (phase.equalsIgnoreCase("TO_POS_ACK") &
                        (l_ack_timeout < System.currentTimeMillis())) {
                    try {
                        int numBytes = 0;
                        dataValue = "";
                        while ((numBytes = is.read(readBuffer)) > 0) {
                            dataValue += new String(readBuffer, 0, numBytes, "ASCII");
                        if (dataValue.getBytes().length > 0) {
                            System.out.println("->first byte: " +
                                dataValue.getBytes()[0]);
                            System.out.println("total length: " +
                                dataValue.getBytes().length);
                            //check for ack byte
                            if (dataValue.getBytes()[0] == 6) {
                                System.out.println(
                                    "<--ACKNOWLEDGE received from pos terminal");
                                phase = "WAIT_FOR_TRANSACTION";
                                l_timeout = System.currentTimeMillis() + l_wait_for_transaction;
                                System.out.println("-> wait for transaction response");
                    } catch (IOException ev) {
              //WAIT FOR TIMEOUT ON MESSAGE (watch dog timer)
                if (phase.equalsIgnoreCase("WAIT_FOR_TRANSACTION") &
                        (l_timeout < System.currentTimeMillis())) {
                    System.out.println(
                        "Error receiving response from pos terminal!!!");
                    closePort();
                    this.showError(res.getProperty("s_dlg_err_title"),
                                 res.getProperty("s_response_error"));
                  if (this.mHandler != null)
                    CustomEvent ce = new CustomEvent(this.mHandler, EVT_ERR);
                    this.setErrorDescription(res.getProperty("s_response_error"));
                    dispatchCustomEvent(ce);
                    break;
              //WAIT FOR SOME DATA TO COME FROM POS TERMINAL OVER RS232
                if (phase.equalsIgnoreCase("WAIT_FOR_TRANSACTION")) {
                    try {
                        int numBytes = 0;
                        dataValue = "";
                        Thread.sleep(500);
                        while ((numBytes = is.read(readBuffer)) > 0) {
                            dataValue += new String(readBuffer, 0, numBytes, "ASCII");
                        if (dataValue.getBytes().length > 0) {
                            System.out.println("->first byte: " +
                                dataValue.getBytes()[0] + "|" +
                                dataValue.getBytes()[1]);
                            System.out.println("->ascii: " + dataValue);
                            System.out.println("total length: " +
                                dataValue.getBytes().length);
                            if (dataValue.indexOf("PREKINIL UPORABNIK") != -1) {
                                System.out.println(
                                    "Uporabnik je prekinil povezavo!");
                                  closePort();
                                //transaction cancelled by user s_user_cancel
                                this.showError(res.getProperty("s_dlg_err_title"),
                                             res.getProperty("s_user_cancel"));
                              if (this.mHandler != null)
                                CustomEvent ce = new CustomEvent(this.mHandler, EVT_ERR);
                                this.setErrorDescription(res.getProperty("s_user_cancel"));
                                dispatchCustomEvent(ce);
                                break;
                            if (dataValue.indexOf("NAPACEN VNOS") != -1) {
                                System.out.println("Napačen vnos");
                                closePort();
                                //invalid user entry
                                this.showError(res.getProperty("s_dlg_err_title"),
                                             res.getProperty("s_user_invalid_entry"));
                               if (this.mHandler != null)
                                CustomEvent ce = new CustomEvent(this.mHandler, EVT_ERR);
                                this.setErrorDescription(res.getProperty("s_user_invalid_entry"));
                                dispatchCustomEvent(ce);
                                break;
                            if (dataValue.indexOf("PROSIM POCAKAJ") != -1) {
                                System.out.println("<-- PROSIM POCAKAJ");
                                continue;
                            //preberemo podatke iz stringe terminala
                            if (dataValue.indexOf("SPREJETO") != -1) {
                                closePort();
                                System.out.println("<-- TRANSAKCIJA SPREJETA");
                                System.out.println(dataValue);
                                StringTokenizer st = new StringTokenizer(dataValue, "\034" );
                                String dv = st.nextToken();
                                sequentialNumber = dv.substring(6,10);
                                transactionProcessed = dv.substring(1, 3);
                                transactionFlag = dv.substring(13,15);
                                transactionNumber = dv.substring(15,21);
                                batchNumber = dv.substring(21,25);
                                transactionDate = dv.substring(25,31);
                                transactionTime = dv.substring(31,37);
                                transactionAmount = st.nextToken();
                                st.nextToken(); //Amount exponent
                                st.nextToken(); //Amount currency
                                cardDataSource = st.nextToken();
                                numberCustomerCard = st.nextToken();
                                expirationDate = st.nextToken();
                                st.nextToken(); // authorization code
                                terminalId = st.nextToken();
                                merchandId = st.nextToken();
                                companyName = st.nextToken();
                                System.out.println("================");
                                System.out.println(transactionProcessed);
                                System.out.println(transactionFlag);
                                System.out.println(transactionNumber);
                                System.out.println(batchNumber);
                                System.out.println(transactionDate);
                                System.out.println(transactionTime);
                                System.out.println(transactionAmount);
                                System.out.println(cardDataSource);
                                System.out.println(numberCustomerCard);
                                System.out.println(expirationDate);
                                System.out.println(terminalId);
                                System.out.println(merchandId);
                                System.out.println(companyName);
                                if (this.mHandler != null)
                                  System.out.println("dispatch custom event");
                                  CustomEvent ce = new CustomEvent(this.mHandler, EVT_OK);
                                  dispatchCustomEvent(ce);
                                return;
                    } catch (IOException ev) {
                      System.err.println("Exception sm: " + ev.toString());
                System.out.print('*');
                Thread.sleep(200);
              }//end state machine loop
          * protocolStream prepare the stream to be send over RS232 to POS terminal
          * with LRC cheksum control
          * @param data
          * @return byte[]
         private byte[] protocolStream(String data) {
              char STX = (char) 0x02;
              String tmp = "" + STX + STX + data + "" + getLRC(data);
              System.out.println("PStream: " + tmp);
              for (int i = 0; i < tmp.getBytes().length; i++) {
                   System.out.print(tmp.getBytes() + ":");
              return tmp.getBytes();
    * close port and stream
    private void closePort()
    try {
    serialPort.close();
    is.close();
    os.close();
    } catch (Exception ee) {
         * Longitudinal Redundancy Check (LRC)
         * @param packet
         * @return String
         private String getLRC(String packet) {
              char[] splitPacket = packet.toCharArray();
              char lrc = 0x00;
              for (int x = 0; x < splitPacket.length; x++) {
                   lrc = (char) (lrc ^ splitPacket[x]);
              return "" + (char) lrc;
         private String paddingString(String s, int n, char c, boolean paddingLeft) {
              if (s == null) {
                   return s;
              int add = n - s.length(); // may overflow int size... should not be a
              if (add <= 0) {
                   return s;
              StringBuffer str = new StringBuffer(s);
              char[] ch = new char[add];
              Arrays.fill(ch, c);
              if (paddingLeft) {
                   str.insert(0, ch);
              } else {
                   str.append(ch);
              return str.toString();
    public boolean setProperty(ID id, Object value)
    if (id.toString().equalsIgnoreCase("COMPORT")) {
    setComPort((String)value);
    System.out.println("RS232 com port: " + getComPort());
    return false;
    if (id.toString().equalsIgnoreCase("AMOUNT")) {
    this.setAmount((String)value);
    System.out.println("Amount value: " + getAmount());
    return false;
    if (id.toString().equalsIgnoreCase("TRANSACTIONTYPE")) {
    this.setTransactionType((String)value);
    System.out.println("Transaction Type value: " + this.getTransactionType());
    return false;
    if (id.toString().equalsIgnoreCase("EXECUTE")) {
    System.out.println("Invoke pos terminal");
    try
    doTransaction();
    catch(Exception ex)
    System.err.println("Execute Exception>> " + ex.toString());
    this.showError(res.getProperty("s_dlg_err_title"),res.getProperty("s_gen_exception"));
    return false;
    return false;
         * Display error message inside oracle form
         * @param title
         * @param exceptionString
         private void showError(String title, String exceptionString) {
              JOptionPane.showMessageDialog(this, exceptionString, title, 0);
    Edited by: peterv6i.blogspot.com on May 8, 2012 10:18 AM
    Edited by: peterv6i.blogspot.com on May 8, 2012 10:20 AM
    Edited by: peterv6i.blogspot.com on May 8, 2012 10:21 AM

  • Setting Pins on Parallel Ports

    Ok - going crazy - am trying to run a motor via parallel port - have a basic c app that does this but need to translate it into java. The code runs fine but no data is getting to the motor. Have tried with both a PrintStream and BufferedOutputStream but neither work (if they are in fact the prob)- this is what i have for the write methods.
    public void getOutStream(){
    bos = null;
    try {
    //bos = new BufferedOutputStream(port.getOutputStream());
    pos = new PrintStream(port.getOutputStream());
    System.out.println("_GET_OUTPUT_STREAM_");
    } catch (IOException e) {
    e.printStackTrace();
    public void write(){
    int [] b = {0x19, 0x39, 0x13, 0x33, 0x16, 0x36, 0x1c, 0x3c};
    for(int i=0; i<b.length; i++){
    pos.write(b);
    //bos.write(b[i]);
    delay(500);
    Have checked out the forums and a couple of people have mentioned setting the pins on the port to set values - how and where can i do this? and will it do the trick? Maybe someone can see something wrong with the code that i've missed?
    Any help will be HUGELY appreciated - cheers

    You must to forces the buffered output bytes to be written out to the underlying output stream.
    To do this use the flush method.
    public void write(){
    int [] b = {0x19, 0x39, 0x13, 0x33, 0x16, 0x36, 0x1c, 0x3c};
    for(int i=0; i<b.length; i++){
    pos.write(b);
    //bos.write(b);
    // put here if you want to flush after write one byte.
    bos.flush();
    delay(500);
    // or here if you want to flush only after write all bytes.
    bos.flush();
    }

Maybe you are looking for