Periodic reading data with event driven programming

Hi all
I want to read data from a device periodically, for example every 2 seconds.
but I want to use event driven programming in order to response user events.
now I don't know how to do this......!!
maybe I should use timed loop or timed sequence structure
if I use this structures, should I use then inside the while loop or outside the while loop( I mean the while loop that contains the event cases)?
please help me and accept my thanks....

You ned to run these in two separate loops. Look at the Producer/Consumer template. Put a two second time-out on the Dequeue Element and you have a loop that will run every two seconds. The loop should also handle information from the event structure.
Separate loops is the best way of handling this.
Rob

Similar Messages

  • Event-Driven Programming

    Hello Everyone,
    I am new to this forum and also new to event-driven programming. Anyways, I am doing a small exercise to get myself familiar with event-driven programming. In particular, the program responds to keys entered on a keyboard. The exercise in a way resembles how a second hand moves in a clock. So, here's what I am trying to do. Originally the hand points at 12 o'clock. when I press the right arrow key the hand should move 6 degrees to the right and when I press the left arrow key the hand should move 6 degrees to the left. The code I have so far seems fairly correct to me but when I run the program and press the arrow keys on my keyboard nothing happens. Any help would be appreciated and thank you in advance.
    Here is my code:
    import java.awt.*;
    import java.util.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class hittingBalloons extends JFrame{
         hittingBalloons(){
              mouseKeyboardListeners p = new mouseKeyboardListeners();
              add(p);
              p.setFocusable(true);
         public static void main(String[] args){
              hittingBalloons frame = new hittingBalloons();
              frame.setTitle("Hitting Balloons");
              frame.setSize(500,500);
              frame.setLocationRelativeTo(null);
              frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              frame.setVisible(true);
         public class mouseKeyboardListeners extends JPanel{
              private int xCenter=250;
              private int yCenter=250;
              private int xEnd =250;
              private int yEnd =210;
              private int angle=0;
              private int gunLength=40;
              private int xBall = 150;
              private int yBall = 150;
              private int radius = 20;
              public mouseKeyboardListeners(){
                   addKeyListener(new KeyAdapter(){
                        public void keyPressed(KeyEvent e){
                             if(e.getKeyCode() == KeyEvent.VK_LEFT){
                                  angle = (int)(angle - (Math.PI/30));
                                  xEnd = (int)(xCenter + gunLength*Math.sin(angle));
                                  yEnd = (int)(yCenter - gunLength*Math.cos(angle));
                                  repaint();
                             else if (e.getKeyCode() == KeyEvent.VK_RIGHT){
                                  angle = (int)(angle + (Math.PI/30));
                                  xEnd = (int)(xCenter + gunLength*Math.sin(angle));
                                  yEnd = (int)(yCenter - gunLength*Math.cos(angle));
                                  repaint();
              protected void paintComponent(Graphics g){
                   super.paintComponent(g);
                   g.drawLine(xCenter,yCenter,xEnd,yEnd);
    }

    A few notes and suggestions:
    1) Welcome to the forum!
    2) When posting code, please use code tags as it makes your code easier to read. the FAQ will show you how. e.g.,
    import java.awt.*;
    import java.util.*;
    import java.awt.event.*;
    import javax.swing.*;
    public class hittingBalloons extends JFrame{
         hittingBalloons(){
              mouseKeyboardListeners p = new mouseKeyboardListeners();
              add(p);
              p.setFocusable(true);
         public static void main(String[] args){
              hittingBalloons frame = new hittingBalloons();
              frame.setTitle("Hitting Balloons");
              frame.setSize(500,500);
              frame.setLocationRelativeTo(null);
              frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              frame.setVisible(true);
         public class mouseKeyboardListeners extends JPanel{
              private int xCenter=250;
              private int yCenter=250;
              private int xEnd =250;
              private int yEnd =210;
              private int angle=0;
              private int gunLength=40;
              private int xBall = 150;
              private int yBall = 150;
              private int radius = 20;
              public  mouseKeyboardListeners(){
                   addKeyListener(new KeyAdapter(){
                        public void keyPressed(KeyEvent e){
                             if(e.getKeyCode() == KeyEvent.VK_LEFT){
                                  angle = (int)(angle - (Math.PI/30));
                                  xEnd = (int)(xCenter + gunLength*Math.sin(angle));
                                  yEnd = (int)(yCenter - gunLength*Math.cos(angle));
                                  repaint();
                             else if (e.getKeyCode() == KeyEvent.VK_RIGHT){
                                  angle = (int)(angle + (Math.PI/30));
                                  xEnd = (int)(xCenter + gunLength*Math.sin(angle));
                                  yEnd = (int)(yCenter - gunLength*Math.cos(angle));
                                  repaint();
              protected void paintComponent(Graphics g){
                   super.paintComponent(g);
                   g.drawLine(xCenter,yCenter,xEnd,yEnd);
    }3) For key listeners to work, the component must have the focus, and JPanels don't get focus by default. You have to call setFocusable(true) first and then request focus in window on the JPanel.
    4) Even better would be to use key binding, and to learn to use these, check out the Sun tutorial.
    Luck and again, welcome!

  • Event Driven Programming is withheld from LabVIEW Base.

    Can anyone give me a good answer why?  Every other programming language in the world has Event Driven Programming (EDP) built in, even free languages.  So when all I wanted was to use LV as a graphical programming language, (hey, that's what the "G" in G-programming stands for) I was disappointed to find that in my undervalued LV Base I can't look for mouse movement, mouse enter, mouse leave, keyboard actions and countless other possibilities that would be standard fare in any other language, unless, I pay over 1200 dollars more for the Full development package.  I know I should have read up on it more before purchasing, and understood what I would be missing out on.  But how was I to know that the fundamental programming function of EDP would be considered on par with Data Acquisition and Signal Processing?  So basically in order to get a complete programming language, I need to spend more than twice the cost of the Base package just to receive the last key component.  And all this because the Evaluation of LV gives you near limitless possibilities, so a new LV programmer gets used to having these tools at his/her disposal, only to yank some of the most critical tools.  So after saying all this, I am pleading for an explanation.  Why isn't there at least some add-on module that would allow a user to install the withheld functionality of EDP to a Base Development package?  Surely making money is the goal of any business, and I won't claim bait and switch here, or any other wrong doing here.  But there is, in my opinion, a marketing misjudgment here.
    -Orion Williams

    Unfortunately to upgrade, it would cost me the difference between the base version and the full version.  What I think is in order is an add-on module that will give customers the functionality of EDP, without having to also pay for signal processing, which is clearly a more robust programming tool, that I don't need.  I am hoping to show NI that by withholding EDP from the base version with no upgrade option except paying for the full version, that their customers who come into LV at the base version are getting an undervalued version, and they know it, and that without at the very least, and add-on module for EDP, isolating smaller business and individuals.  I agree that signal processing, data acquisition and EDP are worth an extra 1300 dollars, but I don't agree that EDP on it's own is worth an extra 1300 dollars, but that's the only option that I have at this moment.  My suggestion is to create an add-on module that includes EDP and sell it for 300 dollars, since I know signal processing is a much more complex feature and is worth more of that upgrade price than EDP.  Of course all versions of LV should include EDP, so if that drives the price of LV base up, so be it.  Just don't let anyone else be fooled into thinking they are buying a Graphical Programming Language unless all the features of a programming language are included at all price points.  Can I get a witness?

  • Play sound in specified duration and desired file when reading data with VISA functions ?

    Hi.
    I read data with VISA read function and then I use functions like multiple for showing data on Chart. every thing is OK.
    now I want play a specified sound (like a 3s song in my desired folder) when signal amplitude cross over from specified value. then after desired time, it will be wait for new cross over from specified value and this procedure repeat again until I stop the program. 
    Data comes from MCU and it doesn't stop when system play sound and when system play sound, incoming data for this part (play sound) will be ignore them until specified expired.
    I use this VI for reading data and mentioned part which is sound part is empty and I don't know what I must done ?
    altougth I use another while loop for sound apart because I want save CPU time.
    Thanks.
    Solved!
    Go to Solution.

    I would recommend making the data type of the notifier a cluster that contains a path and a numeric (double).  The path tells the player which file to play.  The numeric is the duration.
    Now for a slightly complicated, but really neat, way to stop your second loop.  Do not use a second notifier.  Instead, send the normal notification but use Not A Path for the path in the cluster.  Your second loop can do a check for the Not A Path and stop when that is recieved.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • Highlight Dates with Events in YUI Calendar

    I have created a calendar in Dreamweaver CS4 using the YUI Calendar widget and a Spry data set, following the instructions from the Adobe Developer Connection articles. (http://www.adobe.com/devnet/dreamweaver/articles/using_yui_widgets.html) I think it works well for my purposes, however I think it would be more user friendly if I could have dates with events highlighted.
    For example, if there was an event on December 15, 2009, I would want that date in the YUI Calendar to be highlighted in a different color.
    I have read some different ways to do so, but I have limited knowledge of CSS and barely understand any JavaScript.
    Is there anyone who can provide me with a simple way to highlight these dates? I would really appreciate any help.

    For those of you JavaScript people who don't use YUI, here's the code for my page:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xmlns:spry="http://ns.adobe.com/spry">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>SSAC /// Calendar</title>
    <script src="SpryAssets/SpryData.js" type="text/javascript"></script>
    <script src="SpryAssets/SpryHTMLDataSet.js" type="text/javascript"></script>
    <script src="scripts/YUI/2.6.0/build/yahoo-dom-event/yahoo-dom-event.js" type="text/javascript"></script>
    <script src="scripts/YUI/2.6.0/build/calendar/calendar-min.js" type="text/javascript"></script>
    <script type="text/javascript">
    <!--
    var ds1 = new Spry.Data.HTMLDataSet("events.html", "events");
    //-->
    </script>
    <link href="main.css" rel="stylesheet" type="text/css" />
    <link href="scripts/YUI/2.6.0/build/fonts/fonts-min.css" rel="stylesheet" type="text/css" />
    <link href="scripts/YUI/2.6.0/build/calendar/assets/skins/sam/calendar.css" rel="stylesheet" type="text/css" />
    </head>
    <body>
    <div id="wrapper">
      <div id="header"></div>
      <div id="navbar"><script type="text/javascript" src="navbar.js"></script></div>
      <div id="content">
        <div id="yuicalendar1"></div>
        <script type="text/javascript">
    // BeginWebWidget YUI_Calendar: yuicalendar1
      (function() {
        var cn = document.body.className.toString();
        if (cn.indexOf('yui-skin-sam') == -1) {
          document.body.className += " yui-skin-sam";
      var inityuicalendar1 = function() {
        var yuicalendar1 = new YAHOO.widget.Calendar("yuicalendar1");
        // The following event subscribers demonstrate how to handle
        // YUI Calendar events, specifically when a date cell is
        // selected and when it is unselected.
        // See: http://developer.yahoo.com/yui/calendar/ for more
        // information on the YUI Calendar's configurations and
        // events.
        // The YUI Calendar API cheatsheet can be found at:
        // http://yuiblog.com/assets/pdf/cheatsheets/calendar.pdf
        //--- begin event subscribers ---//
        yuicalendar1.selectEvent.subscribe(selectHandler, yuicalendar1, true);
        yuicalendar1.deselectEvent.subscribe(deselectHandler, yuicalendar1, true);
        //--- end event subscribers ---//
        yuicalendar1.render();
      function selectHandler(event, data) {
      // The JavaScript function subscribed to yuicalendar1.  It is called when
      // a date cell is selected.
      // alert(event) will show an event type of "Select".
      // alert(data) will show the selected date as [year, month, date].
      var formattedDateString = data[0][0][1] + "/" + data[0][0][2] + "/" + data[0][0][0];
      var r = ds1.findRowsWithColumnValues({"Date": formattedDateString }, true);
      var region = Spry.Data.getRegion("events");
    if(r){
        ds1.setCurrentRow(r.ds_RowID);
        region.setState("showEvent", true);
    } else {
    region.setState("ready", true);
      function deselectHandler(event, data) {
      // The JavaScript function subscribed to yuicalendar1.  It is called when
      // a selected date cell is unselected.
      // Create the YUI Calendar when the HTML document is usable.
      YAHOO.util.Event.onDOMReady(inityuicalendar1);
    // EndWebWidget YUI_Calendar: yuicalendar1
      </script>
        <div spry:detailregion="ds1" id="events">
          <div spry:state="showEvent">
            <table width="400" border="0">
              <tr>
                <td colspan="2">Event Name:{Event}</td>
              </tr>
              <tr>
                <td rowspan="3"><u>Desription:</u><br />
                  {Description}</td>
                <td><u>Time:</u> {Time}</td>
              </tr>
              <tr>
                <td><u>Location:</u> {Location}</td>
              </tr>
              <tr>
                <td><u>Contact:</u> {Contact}</td>
              </tr>
            </table>
          </div>
          <div spry:state="ready"> There are no events on this date. Please select another date. </div>
        </div>
      </div>
      <div id="footer"><script type="text/javascript" src="footer.js"></script></div>
    </div>
    </body>
    </html>
    I hope this helps.

  • Prioritized Messages in combination with Event-Driven Message Processing

    Hi,
    our Scenario (EO): Sender A sends large IDocs to Receivers X and Y (> Split)
    1.
    What we did first:
    Prioritized Message Processing
    Sender A sends large Messages, therefore we prioritzied Messages in the IE with EO_MSG_SIZE_LIMIT > 4000.
    This works fine: Messages are queued in XBTL and XBTM and afterwards they are send to Receiver X and Y.
    2.
    What we did next:
    Event-Driven Message Processing
    Now we want to send the Message from Sender A to Receiver X directly and to Receiver Y at night time.
    We add Event-Driven Message Processing, Sender- and ReceiverID for A and Y,Job and so on...
    On it's own (without Prioritized Message Processing), this works fine: The messages are send at night time.
    But in combination (Event-Driven + Prioritized Message Processing) the messages only passes the Prioritized Message Processing and the Event-Driven is ignored.
    Our "Hop-List" for Split A to Y was:
    1. XBTL
    2. XBTJ2008...
    3. XBTM
    But actually all Messages passes:
    1.XBTL
    2.XBTM
    Why are the messages not filtered for the Event-Driven Message Processing (in combination with the Prioritized Message Processing)?

    It was an error in the SourceCode and is now corrected by SAP:
    Hinweis 1295746 - XI Runtime: Fehler in Ereignisgesteuerte Messageverarbeitung
    Olaf

  • How to read data with different XML schemas within the single connection?

    I have Oracle 11g database
    I access it through jdbc:oracle:thin, version 11.2.0.3, same as xdb.
    I have several tables, each has one XMLType column, all schema-based.
    There are three different XML schemata registered in the DB
    I may need to read the XML data from several tables.
    If all the XMLTypes have the same XML schema ,there is no problem,
    If the schemata are different, the second read throws BindXMLException.
    If I reset the connection between the reads of the XMLType column with different schemata, it works.
    The question is: how can I configure the driver, or the connection to be able to read the data with different XML schemata without resetting the connection (which is expensive).
    The code to get the XMLType data is textbook implementation:
    1   ResultSet resultSet = statement.executeQuery( sql ) ;
    2   String result = null ;
    3    while(resultSet.next()) {
    4   SQLXML sqlxml = resultSet.getSQLXML(1) ;
    5   result = sqlxml.getString() ;
    6   sqlxml.free();
    7   }
    8   resultSet.close();
    9    return result ;

    It turns out, that I needed to serialize the XML on the server and read it as Blob. Like this:
    1    final Statement statement = connection.createStatement() ;
    2    final String sql = String.format("select xmlserialize(content xml_content_column as blob encoding 'UTF-8') from %s where key='%s'", table, key ) ;
    3   ResultSet resultSet = statement.executeQuery( sql ) ;
    4   String result = null ;
    5    while(resultSet.next()) {
    6   Blob blob = resultSet.getBlob( 1 );
    7   InputStream inputStream = blob.getBinaryStream();
    8   result = new Scanner( inputStream ).useDelimiter( "\\A" ).next();
    9   inputStream.close();
    10   blob.free();
    11   }
    12   resultSet.close();
    13   statement.close();
    14
    15   System.out.println( result );
    16    return result ;
    17
    Then it works. Still, can't get it work with XMLType in resultset.On the client unwrapping XML blows up when trying to switch to different XML schema. JDBC/XDB problem?

  • Read data with trigger usb-6210

    Hello
    I'm using LabView 8.6 full development
    First sorry for my english
    My problem is: I'm using USB-6210. I connected a encoder signal to one of digital inputs and then generate trigger signal according to encoder. Now I need to read data from 4 analog inputs at the rising edge of trigger. But I must read all data at one time. I have around 200 measurements points. So my idea is: when the trigger appears card read data, but I not taking them. I take data when card have all 200 measurement points. Is it possible to do with this card? and how. Frequency of trigger signal is around 1kHz
    Bartek

    Hello Bartek,
    If I understand correctly, you need to start Analog Input (AI) measurement on 4 AIs with rising edge on digital input (DI). Moreover, you want to read all configured samples at once.
    If I understand correctly, than you need to perform Finite Samples AI Acquisition with Digital Start Trigger.
    I strongly recommend to read some manuals to get familiar with your device. I would start with M Series User manual, which I personally consider to be very useful for finding most important information about your device. Moreover, there might be some "specialties" for USB-6210, which you might find in NI USB-621x Specifications. 
    Please go trough following sections of recommended manuals:
    AI Start Trigger Signal - M Series User  Manual page 4-35
    Chapter 11, Triggering of M Series User Manual
    NI USB-621x Specifications - page 9, External Digital Triggers
     If you wonder how to realize the measurement in LabVIEW, I would point you to Example Finder, where you can actually find such a example.
    In LabVIEW menu, open Help -> Find Examples...
    Navigate to Hardware Input and Output -> DAQmx -> Analog Measurements -> Voltage
    Open Acq&Graph Voltage-Int Clk-Dig Start.vi
     I believe this example should perform exactly what you need.
    Best regards,
    Martin Stefik
    Application Engineer
    Czech Republic

  • Problem with drawing chart in event driven programming and XControl

    Dear my friends
    I have a xcontrol, that has two buttom and a chart. i want to do this:
    1- when i press the "start" button chart starts to add random numbers
    2- when I press the "stop" button the start should stop drawing random numbers.
     I mean after pressing the start the chart should add points until I press the stop button.
    also I add "start button value change"  event case and i put the code inside that event.
    but when i press the start the chart adds one point.
    using while loop inside a event case is not good for adding extra points.
    can someone help me how to do this?
    I oppologize due to my weak english.....

    An Xcontrol immediately returns after each Read or write. It should not stall the calling VI. It is not something that should run for extended periods. You can use a plain reentrant subVI, for example.
    If you want to learn about Xcontrols, have a look at the dual mode thermometer (or similar) that is included with the example finder.
    LabVIEW Champion . Do more with less code and in less time .

  • Issue with Reading data with FOR EACH LOOP.

    Hi Guys,
    Scenario
    We Plan Sales of an Article on a half years(fiscal variant MQ with 2 periods of half year each). We also plan the
    number of Weeks in Sales as a Key figure.  The cummulative Sales for two half years in then distributed to number of weeks for which the Article is sold (0CALWEEK)
    In another Cube we plan a distribution profile. This cube contains just three elements.
    Characteristic = ZPROFILE
    TIme Char = 0CALWEEK
    Keyfigure = ZDIST
    (Note : You will notice The distribution profile is not stored per Article here)
    The logic of distribution is :
    1.  Sales of Article is cummulated for 1 years ( eg. for periods 001.2010 & 002.2010 )
    2.  Find the number of weeks in Sales for this Article ( eg. 14 weeks. ) [Technically we store this value on the first fiscal
    period. In our example it is stored in 001.2010
    3.  User choose a distribution profile in a variable ( e.g ZH55 )
    4   ZDIST is summed for number of Sale Weeks for this Article. in our case it is14 weeks.
    5. Distribution = Sales of Article (WEEK N) = [Sales Cummulated for 1 year] * [ZDIST(Week N) / ZDIST(sum of 24 weeks)]
    This loop is run 14 times. (N from 201001 to 201014.)
    TECHICAL DETAILS
    Cube 1 (0CM_SKU = Material, 0CPBAINSABU = SALES key figure, WEEKINSALE = Number of weeks for which Material will be
    sold). The Sales Planned data is stored as # for 0CALWEEK.
    0CM_SKU/0CALWEEK/0FISCPER/0FISCVARNT/0CPBAINSABU--/WEEKINSALE
    SHIRT/000000/2010001/ZP/100EUR--/24
    SHIRT/000000/2010002/ZP/200EUR--/00
    PANTS/000000/2010001/ZP/300EUR--/35
    PANTS/000000/2010002/ZP/200EUR--/00
    CUBE 2 ( the profile data is stored here )
    ZPROFILE/0CALWEEK/ZDIST
    ZH55/201001/10
    ZH55/201002/12
    ZH55/201003/8
    ZH55/201004/11
    ZH55/201005/10
    ..so on.
    9:11 PM
    Edited by: Dheeraj Gupta on Apr 5, 2010 9:20 PM

    My Sample CODE IS BELOW.
    DATA CW1 TYPE 0CALWEEK.
    DATA CW2 TYPE 0CALWEEK.
    DATA PER1 TYPE 0FISCPER.
    DATA PER2 TYPE 0FISCPER.
    DATA FVAR TYPE 0FISCVARNT.
    DATA PROV1 TYPE 0INFOPROV.
    DATA PROV2 TYPE 0INFOPROV.
    DATA SKU TYPE 0CM_SKU.
    DATA DPROF TYPE ZPROFILE.
    DATA CUMSALES TYPE F.
    DATA TEMP TYPE F.
    DATA PRO TYPE F.
    DATA COUNT TYPE I.
    *I WILL READ THE PROFILE VALUE FROM VARIABLE IN ACTUAL PROGRAM.
    HARDCODED FOR TEST PURPOSES. 
    DPROF = 'ZH55'.
    *FISCAL YR VARIANT
    FVAR = 'MQ'.
    *HARDCODED FOR TEST PURPOSES. 
    PER1 = 2010001.
    PER2 = TMVL(PER1, 1, FVAR).
    *CUBE FOR SALES
    PROV1 = 'ZCLARK'.
    *CUBE FOR PROFILE
    PROV2 = 'C_ZCLARK'.
    FOREACH SKU.
    *SUM UP SALES FOR ONE YEAR
    *Operand:{Key figure name, 0CALWEEK, 0CM_SKU, 0FISCPER, 0FISCVARNT, 0INFOPROV, ZPROFILE}
    CUMSALES = CUMSALES + {0CPBAINSABU,#,SKU,PER1, FVAR,PROV1,#} + {0CPBAINSABU,#,SKU,PER2, FVAR,PROV1,#}.
    *READ NUMBER OF WEEKS OF SALES
    COUNT = {ZNWEEK,#,SKU,PER1, FVAR,PROV1,#}.
    *HARDCODED FOR TEST PURPOSES. 
    Starting week of distrbution is first week of the year
    CW2 = 201001.
    CW1 = 201001.
    *HELP NEEDED HERE ***********
    *NOT ABLE TO READ THIS PROFILE DATA
    DO COUNT TIMES.
       PRO = PRO + {ZPROF,CW2,#,#,#,PROV2,ZPROFILE}.
       CW2 = TMVL(CW2, 1).
    ENDDO.
    DO COUNT TIMES.
    {0CPBAINSABU,CW1,SKU,#, #,PROV1,#} = CUMSALES * {ZPROF,CW1,#,#, #,PROV2,ZPROFILE} / PRO.
    CW1 = TMVL(CW1, 1).
    ENDDO.
    *RESET
    CUMSALES = 0.
    ENDFOR.

  • How to read data with BDC

    In order to search notification, I recorded a script with SHBD . This script go to IW28 and do a simple search. It works but I want to have the result to do another treatment.
    Is it possible to have the data showed in a list?
    This is my script :
    FUNCTION z_pm_web_liste_avis.
    *"*"Interface locale :
    *"  EXPORTING
    *"     REFERENCE(AVIS) TYPE  ZPM_AVIS
       PERFORM bdc_dynpro      USING 'RIQMEL20' '1000'.
       PERFORM bdc_field       USING 'BDC_CURSOR'
                                     'SELSCHEM'.
       PERFORM bdc_field       USING 'BDC_OKCODE'
                                     '=ONLI'.
       PERFORM bdc_field       USING 'DY_OFN'
                                     'X'.
       PERFORM bdc_field       USING 'DY_IAR'
                                     'X'.
       PERFORM bdc_field       USING 'DATUV'
                                     '14.03.2014'.
       PERFORM bdc_field       USING 'DATUB'
                                     '12.06.2014'.
       PERFORM bdc_field       USING 'MZEIT-LOW'
                                     '00:00:00'.
       PERFORM bdc_field       USING 'MZEIT-HIGH'
                                     '00:00:00'.
       PERFORM bdc_field       USING 'AUZTV-LOW'
                                     '00:00:00'.
       PERFORM bdc_field       USING 'AUZTV-HIGH'
                                     '00:00:00'.
       PERFORM bdc_field       USING 'AUZTB-LOW'
                                     '00:00:00'.
       PERFORM bdc_field       USING 'AUZTB-HIGH'
                                     '00:00:00'.
       PERFORM bdc_field       USING 'VARIANT'
                                     '/AAI_PM_REL'.
       PERFORM bdc_dynpro      USING 'SAPMSSY0' '0120'.
       PERFORM bdc_field       USING 'BDC_CURSOR'
                                     '04/03'.
       PERFORM bdc_field       USING 'BDC_OKCODE'
                                     '=BACK'.
       PERFORM bdc_dynpro      USING 'RIQMEL20' '1000'.
       PERFORM bdc_field       USING 'BDC_OKCODE'
                                     '/EE'.
       PERFORM bdc_field       USING 'BDC_CURSOR'
                                     'SELSCHEM'.
       PERFORM bdc_transaction USING 'IW28'.
       COMMIT WORK.
    ENDFUNCTION.
    *&      Form  bdc_dynpro
    *       text
    *      -->PROGRAM    text
    *      -->DYNPRO     text
    FORM bdc_dynpro USING program dynpro.
       DATA gs_bdcdata TYPE bdcdata.
       CLEAR gs_bdcdata.
       gs_bdcdata-program  = program.
       gs_bdcdata-dynpro   = dynpro.
       gs_bdcdata-dynbegin = 'X'.
       APPEND gs_bdcdata TO gt_bdcdata.
    ENDFORM.                    "BDC_DYNPRO
    *&      Form  bdc_field
    *       text
    *      -->FNAM       text
    *      -->FVAL       text
    FORM bdc_field USING fnam fval.
       DATA gs_bdcdata TYPE bdcdata.
       CLEAR gs_bdcdata.
       gs_bdcdata-fnam  = fnam.
       gs_bdcdata-fval  = fval.
       APPEND gs_bdcdata TO gt_bdcdata.
    ENDFORM.                    "BDC_FIELD
    *&      Form  bdc_transaction
    *       text
    *      -->TCODE      text
    FORM bdc_transaction USING tcode.
       DATA: messtab TYPE TABLE OF bdcmsgcoll WITH HEADER LINE.
       DATA: l_mstring(480).
       DATA: l_subrc LIKE sy-subrc.
       REFRESH messtab.
       CALL TRANSACTION tcode USING gt_bdcdata
                        MODE   'A'
                        UPDATE 'S'
                        MESSAGES INTO messtab.
       l_subrc = sy-subrc.
       WRITE: / 'CALL_TRANSACTION',
                tcode,
                'returncode:'(i05),
                l_subrc,
                'RECORD:',
                sy-index.
       LOOP AT messtab.
         MESSAGE ID     messtab-msgid
                 TYPE   messtab-msgtyp
                 NUMBER messtab-msgnr
                 INTO l_mstring
                 WITH messtab-msgv1
                      messtab-msgv2
                      messtab-msgv3
                      messtab-msgv4.
         WRITE: / messtab-msgtyp, l_mstring(250).
       ENDLOOP.
       SKIP.
       REFRESH gt_bdcdata.
    ENDFORM.                    "BDC_TRANSACTION

    It turns out, that I needed to serialize the XML on the server and read it as Blob. Like this:
    1    final Statement statement = connection.createStatement() ;
    2    final String sql = String.format("select xmlserialize(content xml_content_column as blob encoding 'UTF-8') from %s where key='%s'", table, key ) ;
    3   ResultSet resultSet = statement.executeQuery( sql ) ;
    4   String result = null ;
    5    while(resultSet.next()) {
    6   Blob blob = resultSet.getBlob( 1 );
    7   InputStream inputStream = blob.getBinaryStream();
    8   result = new Scanner( inputStream ).useDelimiter( "\\A" ).next();
    9   inputStream.close();
    10   blob.free();
    11   }
    12   resultSet.close();
    13   statement.close();
    14
    15   System.out.println( result );
    16    return result ;
    17
    Then it works. Still, can't get it work with XMLType in resultset.On the client unwrapping XML blows up when trying to switch to different XML schema. JDBC/XDB problem?

  • Read data with spreadsheet in different formats

    Hi all,
    I have to read these data table using the VI Read From Spreadsheet File of .dat file:
    377.88 6.326826E+03 2.024894E+03 253.794 
    377.89 6.328341E+03 2.026409E+03 253.984 
    377.90 6.329855E+03 2.027923E+03 254.173 
    377.91 6.331370E+03 2.029438E+03 254.363
    377.88 6.326826E+03 2.024894E+03 253.794
    377.89 6.328341E+03 2.026409E+03 253.984 
    377.90 6.329855E+03 2.027923E+03 254.173 
    377.91 6.331370E+03 2.029438E+03 254.363
    Note that we have two differents formats: float and scientific notation, then i tried with %#g for example, but i can' t read, only i read the first colum.
    Could u help me plz?
    César

    Not sure, but it may be the delimiters you are using in your file. Can you attach part of one of your data files? What are you using as a "delimiter" between the values? If you copy the text and paste in to a string control or indicator you can then right click on it and select "\" Codes Display to see what characters are used. Also the end of line character needs to be examined. The "Read from spreadsheet" expects carriage return, newline displayed as \r\n in the above way. It (the read from spreadsheet vi) does have a terminal that allows you to specify the EOL as well as the "delimiter". It expects tabs "\t" so if you have spaces "\s" it won't differentiate between groups on a line, which would give you only the first column.
    Putnam
    Certified LabVIEW Developer
    Senior Test Engineer
    Currently using LV 6.1-LabVIEW 2012, RT8.5
    LabVIEW Champion

  • How to Fill Sorted Data with model Driven Development

    Hello
    I am using model driven development. I am using getAll in the Fill method. But the results are not returned sorted by some field that I am interested in. How do I tell the Fill to sort it by some field. Is there some annotation that I can provided in the model...
    thanks
    RK

    You should be able to achieve what you want with an explicit criteria filter on your entity.
    In the Modeler Design view, select your entity and add a filter. You'll see that there is a an "Order By" field in the Properties view.
    Enter the value you want there and then save and redeploy your model. When you don't enter anything in the "Criteria" field, you create a getAll fill.
    Here's an example of an entity created with this type of filter; it is sorted by price in ascending order:
    <entity name="Product" persistent="true">
      <annotation name="ServerProperties" ServerType="LCDS"/>
      <annotation name="DMS" Table="PRODUCT"/>
      <annotation name="RDS" introspectedColumns="PRODUCTID,DESCRIPTION,PRICE,PRODUCTNAME"/>
      <annotation name="VisualModeler" width="115" height="110" x="364" y="203"/>
      <id name="productid" type="integer">
      <annotation name="DMS" ColumnName="PRODUCTID"/>
      </id>
      <property name="description" type="string" length="255">
      <annotation name="DMS" ColumnName="DESCRIPTION"/>
      </property>
      <property name="price" type="float">
      <annotation name="DMS" ColumnName="PRICE"/>
      </property>
      <property name="productname" type="string" length="255">
      <annotation name="DMS" ColumnName="PRODUCTNAME"/>
      </property>
      <filter name="MyFill" order="price ASC"/>
      </entity>

  • New LabHSM Toolkit - Agile development of complex event-driven maintainable LabVIEW applications with active objects / actors based on a universal Hierarchical State Machine / statechart template.

    Dear Fellow LabVIEW programmers:
    Most of the systems you deal with are reactive. It means that their
    primary function is constant interaction with their environment by
    sending and receiving events. But most likely, they can have something
    happening inside them too, even when they are not processing messages
    received from outside. So, such systems have to continuosly react to
    external and internal stimuli. Right? Moreover, most likely, they
    consist of subsystems that are reactive too and, in turn, can have
    their own "life", to an extent independent from other parts (with
    which they still communicate, of course). Reactive (event-driven)
    systems are more naturally modeled with active objects. So, why then
    should we try to model and code them with GOOP and its passive
    ("dead"!) objects?
    "Flat" State Machines have been known for decades to have severe
    limitations. It's been more than 20 years since Dr. Harel invented
    Hierarchical State Machines (statecharts) to fight those limitations.
    Then why does NI still tout the same old good Moore FSM as the
    ultimate tool for event-driven programming in LabVIEW in its $995
    State Diagram KIt?
    The LabHSM toolkit we are happy to present, makes it possible to
    easily create and then maintain complex event-driven applications in
    LabVIEW as a collection of HSM-driven active object VIs using a higher
    level of abstraction and agile software development methodologies.
    These active object VIs are created based on a universal Hierarchical
    State Machine ( HSM or statechart ) template. So. all your code looks
    similar regardless of its functionality!
    We all love just jump to code, right? However, to be good boys, we
    need to do design first. Then implement it in code. If the logic is
    modified we need to redo the design first and then redo the code. When
    using LabHSM where behavior information is abstracted into a separate
    HSM data file editable with a supplied editor, there is no need for
    coding separate from design any more. The modified behavior becomes
    code automatically as soon as the HSM file is saved. Design is code!
    The implementation basically follows Dr. Samek's Quantum Programming
    paradigm. (see http://www.quantum-leaps.com). However, as already
    mentioned, LabHSM stores the behavior information in a file separate
    from the code itself. It also adds state dependent priorities to
    events, a separate queue for public events/messages, and, of course,
    some LabVIEW specific code like capturing front panel user events and
    putting them into the private Events queue. Communication and
    instantiation functions are also rather specific for LabVIEW.
    It is available for UNLIMITED PERIOD trial. Please visit
    http://www.labhsm.com for details and download. The site also contains
    references which you may want to check to learn more about
    hierarchical state machines and active object computing.
    Since this is our debut we will appreciate any comments and
    suggestions. Our contact information is available on our site, of
    course.
    Have a G'day!

    Symtx is currently hiring the following position. Please contact me if interested.
    Amy Cable
    Symtx, HR
    [email protected]
    Symtx, the leading supplier of functional test equipment, hires the brightest & most talented engineering professionals to design & manufacture complex custom electronic systems for advanced technology leaders in the defense, aerospace, communications, medical, transportation & semiconductor industries. Symtx’ challenging & dynamic work environment seeks to fill openings with highly qualified electronic engineering design professionals.The ideal candidate will be responsible for defining the requirements, software design and code development, and integration of test control software for custom functional test systems. Candidate should be familiar with data acquisition concepts, instrument control, complex test, measurement and calibration algorithm development and definition and implementation of control interfaces to hardware. Prefer familiarity with instrument control via GPIB, VXI, MXI, RS-232 desirable. Requires BS/MSEE and 3 -7+ yrs of experience in one or several of the following test applications in a Windows NT/2000/XP environment using Labwindows CVI, TestStand, Labview, Visual Basic, C++ and knowledge of RF systems is a plus. Job responsibilities will include software design, development, integration, team leadership, and interfacing with customers( includes PDR’s & CDR’s).

  • Wpf: Event driven vs MVVM design pattern

    I'm a beginning coder and I've been working on a WPF app for several months now and struggled to implement anything in MVVM due to time constraits to learn so I coded my program the only way to knew how: with code behind, tight coupling, and a whole bunch of
    spaghetti code.
    My program has grown into 20,000+ lines of messy (but working) code that is mostly event driven. The app I am building will probably be used and continue to be developed for years to come, but I will be the only one working on the code.
    However, now that I have time to start learning MVVM, I'm wondering how useful it really is to follow the MVVM pattern. I'm considering refactoring my code into the MVVM pattern but everything seems 100x difficult to do with little documentation. With using
    code behind and tight coupling, I can make the UI do exactly what I want it to do and everything seems like it can be coded so much faster through the event-driven methods.
    How important is it to follow the MVVM design pattern for WPF apps, especially in the long run? Do you think it's a good idea for me to invest my time to redesigning this app and following an MVVM pattern?

    20k lines is a lot.
    That will mean maintenance will be a significant overhead.
    Anything making maintenance harder will mean maintenance takes longer.
    If you're going to do any serious wpf development ( and 20k lines is serious imo) then you should be using mvvm.
    The thing is though, it's different.
    You will need to learn it before it becomes second nature and doesn't appear to be an overhead.
    It isn't true that "everything" can be coded so much faster with event driven methods.
    In fact a number of things are way easier to do using mvvm rather than code behind.
    If that isn't enough to persuade you.
    Teams use MVVM.
    Go to an interview and tell your prospective team lead you think mvvm is no good and you may as well not go to the interview.
    If it becomes obvious in an interview you haven't learnt mvvm then you will not be chosen.
    Teams also use automated testing.
    This is nigh on impossible with code behind and one of the selling points of mvvm.
    You can test without instantiating a view which means you can run thousands of fast tests in seconds.
    That means you can make changes safe in the knowledge you're not breaking stuff you haven't worked on.
    It means someone else in the team doesn't break your code without realising.
    Since UI and code are decoupled you can makes changes to either or both rather easier - that decoupling = flexibility.
    As your code base grows then re-factoring becomes MASSIVELY faster if you have automated tests in place and your layers are loosely coupled.
    I don't know about this paraticular app you have because I don't know almost anything about it.
    If you plan on doing professional wpf development then I suggest you re-adjust your opinions on MVVM. 
    Please don't forget to upvote posts which you like and mark those which answer your question.
    My latest Technet article - Dynamic XAML

Maybe you are looking for

  • How do i write latex in numbers

    How do I write math with latex in numbers?

  • SQL not showing in Embedded OC4J Server window

    Previously, when we'd run a page through JDeveloper, the sql statements that were used to execute the query would appear in the Embedded OC4J Server window in JDeveloper. Now they no longer appear (along with a lot of other logging data that used to

  • Currency option in fbl1n/fbl5n/fk10n/fd10n

    Hi i am posting doucment in local currency as well as in USD and EUR in my vendor and customer account. but in FBL1N / FBL5N/ FD10N/ FK10N i am ONLY able to view the statement in local currency. wheras i want to view only those transaction which are

  • How do I uninstall adobe reader 11

    How do I uninstall adobe reader 11? I am running OSX 10.9.1 Mavericks. I have not configured it completely. When it ask if I wanted the reader to be the default instead of preview I said no and have tried to find  a way to uninstall it. Also what do

  • Why is the JVM geiing Aborted !!!

    Hi all When i am working with a particular form i got the error 'FRM - 92101 - Forms session aborted.Unable to communicate to the runtime process' I debugged it and found that JVM is getting Aborted when i reach a particular Trigger. Could anyone tel