Inputing array data through JTextFields

Dear All,
I am working on a little programme that will manipulate array variables. However, I will like the array data to be added though a GUI form made of text fields.
I can input the data as part of the code, but I want it flexible. The array is like this
class Friends {
public Friends (String name, String Address, int age) {
thename = name;
theaddress = Address;
theage = age;}
class Main {
Friends[ ] theFriends = new Friends[ ] {
How do I populate the array throug a gui
Thanks

the class name should be Friend (singular)
the variable name for the data structure should be called friends (plural)
the data structure could be an arraylist
List friends = new ArrayList();
then you add
friends.add(new Friend(nameTextfield.getText(),addressTextfield.getText(),ageTextfield.getText()));
and you would probably have some error-handling prior to the add,
to ensure the textfields have data, possibly valid data (what if 'age' = abc, instead of 21)

Similar Messages

  • Send 102 bit data through the LPT port??I have to send 102 bit to my interface board using the LPT port, through one of the data line and be able to read data from the input line, I don't know how to realize such a task.Thanks

    Let me describe you the program I have to write:
    I have to send 102 bit serialy using one of the data line of the LPT port to a device and be able to read back data sent from a device register throug one one of the input port pin for instance pin 10 of a DB25, and synchronize the transmission by the PC clock(for write and read). If fact I am using 5 output control(D0...D4) signal from the LPT port, RST, TXD, CLK, CE,TEST, one input data RXD (pin10)
    So the program should work in normal mode (write data, read data), and test mode (use the write p
    rocedure). Since I am quite new in Labview I am little lost and I need some support or exemple that use a way to send more than 32 bit via one data line(in my case 102bit= 8 bit COMMAD(MSB)+88 bit SPI DATA+6 bits CRC(LSB)) and be able to read them back, place them in the register and be able either to monitor or modify them.
    I know that there are plenty of exemple but if I can gain time by being helped it would be great.
    Can you please advise?

    Hi Beni,
    find attached a SPI.vi - minor changed from one of
    my typical SPI's (LabVIEW 7.1). With some simple changes it will fit to your application.
    The only thing you need to do - prepare
    the bits for the input-array.
    If you need some more comments - find one of my email
    adresses in documentation of this vi.
    Regards
    Werner
    Attachments:
    102bit_SPI.zip ‏90 KB

  • Trig an analog input with NI6115 through digital data sent by NI6534

    Hello,
    I have 2 NI cards: NI6534 (master), NI6115 (slave)
    I have succeeded to do the following point:
    The slave wait a trigger given by a generated pattern data through NI6534 to start an analog acquisition
    (I noted that the start of the analog acquisition is delayed by 100 ns, is that normal?)
    Now I want to delay the analog acquisition (let's say by exactly 5.0 microseconds)
    Any idea how to do that
    Loranger

    Loranger,
    The delay you are seeing is expected. When using a trigger pulse to "trigger" acquisition on another card, there will be a small delay. Usually the card will actually "trigger" within 1-2 ticks of the timebase clock after the trigger pulse is received over the RTSI line. 2 ticks of the timebase on the NI6115 (timebase of 20MHz) corresponds to 100ns.
    In regards to delaying the analog input aquisition; this is what I would suggest. I would have the trigger from the NI6534 go to a counter on the NI6115. You could program the counter to generate a delayed pulse (5 us) when the trigger from the 6534 is received. The output of the counter could then be used to trigger the analog input acquisition. This should work for you. I hope this helps.
    Todd
    D.
    National Instruments
    Applications Engineer

  • Loading of master data through input schedule

    Hi guys!
    Is any solution for loading/updating of master data through input schedule?

    Hi Maxim,
    In addition to all above, Input Schedules are used to enter and send data for whatever dimension members you have maintained in BI or BPC.
    The master data can be maintained in BI, then you need ot load data from BI and it will be reflected in BPC.
    If you want to make changes in master data in BPC, then you need to goto Admin, select whatever properties you want to display and then Maintain Dimension Members for the same.
    However, you can also import master data from BI using DM packages in BPC Excel.
    Hope this clarifies.
    Rgds,
    Poonam

  • [BUG]: Dll modifies input array constant

    Hi,
    Not really an important one, but some of you (Ben might like it... Tested
    in LV6, 6.1, 7.0 and 7.1.
    When a dll function modifies more (1d or 2d) input arrays, one constant is
    used to initialize them and less then all indicators are wired, LV
    overwrites the constant values...
    To reproduce this, I created a two dlls (one in assembler and one in
    LabVIEW, assembler one is attached). The dll fills the array with the number
    2.
    Run the VI, update the diagram (close and open again, or scroll). The values
    in the constant array now have the same values as the output array!
    This behavior is reproducible with (at least) 1d and 2d arrays, and (at
    least) U32 and DBLs.
    I'm sure other array data types (SGL, U8, I8 etc.) s
    how the same behavior,
    but pointers to scalar values do not. Perhaps strings also do this?
    Try putting a flat sequence frame around it, and put a few seconds wait
    before and after it. You can see the constant changing while the vi is
    running.
    Regards,
    Wiebe.
    [Attachment Callbug.dll, see below]
    [Attachment Callbug.vi, see below]
    Attachments:
    Callbug.dll ‏3 KB
    Callbug.vi ‏13 KB

    Ben,
    The topic from the advanced course does seem to be describing this. So this
    behavior doesn't seem to be a bug. I couldn't find anything about this in
    the "Using External Code in LabVIEW" manual.
    When pointers to values are used, the constants are not updated, so that is
    inconsistent, but it does say "may receive", so that is covered...
    Perhaps the only bug is the fact that the block diagram is not refreshed
    properly, after the values are changed... Just kidding...
    Next question is how to make use of this?
    Regards,
    Wiebe.
    "Ben" wrote in message
    news:50650000000500000078D30100-1079395200000@exch​ange.ni.com...
    > Hi Wiebe
    >
    > Your question reminds me of a phrase from proverbs
    >
    > "A wise man goes into his store house and brings forth treasures both
    > old and new".
    >
    > I was not able to find documentaion on the the call library function
    > that talks about this issue but I did find the following in the
    > "LabVIEW Advanced 1 Course Manual, August 1998 Edition, part number
    > 321366C-01 page 242".
    >
    > "If you do not wire an indicator to the output terminal of a terminal
    > pair, LabVIEW assumes that the CIN will not modify the value you pass
    > to it. If another node uses the input data, LabVIEW does not make a
    > copy of the data.
    >
    > Note: If you don't wire the output terminal, the source code should
    > not modify the value passed into the terminal. Nodes connected to the
    > input terminal wire may receive the modified data.
    > "
    >
    > This topic brought our class to a stand still when we(those who were
    > still awake) realized that data could flow backwards through a wire!
    >
    > I believe the behaviour you have observed is correct and the quote I
    > cited above.
    >
    > I will venture a guess that the requirement from the CLA exam
    > "CLD-VPP-03-04 ...Review a LabVIEW application for run-time behavoiur
    > and memory management issue, ....Destructive and non-destructive
    > buffer reads on branched wires"
    >
    > had the behaviour in mind.
    >
    > I posted a Q re:this req years ago but never got a definative answer.
    >
    > All of the above is just my opinion.
    >
    > I would love to hear from others.
    >
    > What do you think?
    >
    > Ben
    >
    > BTW: I do not think they teach that anymore.

  • Save array data

    Hi all,
    I need help to solve a problem like following.
    I have a table 'results' with the columns
    result_id number PK
    method varchar2(200)
    readout varchar2(60)
    result number
    Also I have built a page with an array (realized through text fields) like this one:
    x1_1 x1_2
    x2_1 x2_2
    x3_1 x3_2
    x100_1 x100_2
    All elements in the array have the same method. In column readout the name of the array element has to be stored. The input of the text fields have to be stored in column result.
    I think an example makes it more clearly
    method = malinoe
    x1_1 = 15 x1_2 = 9
    x2_1 = 3 x2_2 = 7
    x3_1 = 10 x3_2 = 11
    x100_1 = 2 x100_2 = 3
    After fill in the values into the text field array you have to click the Button 'SAVE' and all values have to be stored in the table results:
    first row:
    result_id = 1
    method = malinoe
    readout = x1_1
    result = 15
    second row:
    result_id = 2
    method = malinoe
    readout = x1_2
    result = 9
    third row:
    result_id = 3
    method = malinoe
    readout = x2_1
    result = 3
    last row:
    result_id = 200
    method = malinoe
    readout = x100_2
    result = 3
    Has anybody an working example or idea how I can solve this problem?
    Thanks for help,
    ben
    Message was edited by:
    ben512

    I think that here is the best approach htmldb_collection.
    On load form fill the text items with data.
    On save fill the collection elements and then iterating through them save them in table.
    Here is QBE code for iteratiting through forms controls and if some control has name P||PAGE_ID_FIELD_NAME then this is ok control...Use just the logic of iteration through form items.
    Here is example from my source code:
    FUNCTION QBE (
            ln_page_id     NUMBER
          , ls_table    IN VARCHAR2
          , ls_select   IN VARCHAR2 DEFAULT NULL
          , ls_where    IN VARCHAR2 DEFAULT NULL
          , ls_order_by IN VARCHAR2 DEFAULT NULL
          , ln_search_type NUMBER   DEFAULT 3
          , ls_scope_mode  VARCHAR  DEFAULT 'U' 
              ) RETURN VARCHAR2
       AS  
         wrong_search_type EXCEPTION;
         wrong_date_field EXCEPTION;                
         wrong_scope_mode EXCEPTION;
        ls_sql       VARCHAR2 (32567 CHAR);
        lb_need_and  BOOLEAN := FALSE;
        lb_has_where BOOLEAN := FALSE;
        ls_field_name VARCHAR2 (128);
        lb_process_current_field BOOLEAN;
        lb_is_date_field BOOLEAN;
        -- lb_is_date_time_field BOOLEAN;
        lb_is_number_field BOOLEAN;
        lb_is_LOV BOOLEAN;
        lb_is_date_from BOOLEAN;
        c_collection VARCHAR2(32 CHAR) := 'DATE_USED_FROM'; 
       BEGIN
         HTMLDB_COLLECTION.CREATE_OR_TRUNCATE_COLLECTION (c_collection);
         IF ls_scope_mode NOT IN ('U','A') THEN
           RAISE wrong_scope_mode;
         END IF;
          -- Create SELECT part of SQL Statement
          IF (ls_select IS NOT NULL) THEN
            ls_sql := ls_select;
          ELSE
            ls_sql := 'SELECT *';
          END IF;
          -- Create WHERE part of SQL Statement
          IF (ls_where IS NOT NULL) THEN
            ls_sql := ls_sql || ' from ' || ls_table || ' ' || ls_where || ' and ';
          ELSE
            ls_sql := ls_sql || ' from ' || ls_table || ' where ';
          END IF;
          -- Loop through each column in the table specified in ls_table and see if there is a corresponding
          --   HTML DB page item on the page specified in ln_page_id
          FOR x IN (SELECT column_name, data_type FROM USER_TAB_COLUMNS WHERE table_name = UPPER(ls_table) AND ls_scope_mode = 'U'
                    UNION 
                    SELECT column_name, data_type FROM ALL_TAB_COLUMNS WHERE table_name = UPPER(ls_table) AND ls_scope_mode = 'A') LOOP
            lb_is_date_field := FALSE;
            lb_is_number_field := FALSE;   
            --lb_is_date_time_field := FALSE;
            ls_field_name := 'P' || ln_page_id || '_' || x.column_name;
            <<PLAY_IT_AGAIN_SAM>>
            IF x.data_type = 'DATE' THEN
              lb_is_date_field := TRUE;
              ls_field_name := 'P' || ln_page_id || '_' || x.column_name|| '_FROM';
              lb_process_current_field := TRUE;
              lb_is_date_from := TRUE;
              FOR j IN (SELECT c001 FROM htmldb_collections WHERE collection_name = c_collection) LOOP
                IF j.C001 = ls_field_name THEN
                  lb_process_current_field := FALSE;
                  EXIT;
                END IF;
              END LOOP;
              IF lb_process_current_field THEN
                 HTMLDB_COLLECTION.ADD_MEMBER (p_collection_name => c_collection
                                             , p_c001            => ls_field_name
                                             , p_generate_md5    => 'NO');
              ELSE
                ls_field_name := 'P' || ln_page_id || '_' || x.column_name|| '_TO';
                lb_process_current_field := TRUE;
                lb_is_date_from := FALSE;
                     FOR j IN (SELECT c001 FROM htmldb_collections WHERE collection_name = c_collection) LOOP
                       IF j.C001 = ls_field_name THEN
                         lb_process_current_field := FALSE;
                         EXIT;
                       END IF;
                     END LOOP;
                 IF lb_process_current_field THEN
                    HTMLDB_COLLECTION.ADD_MEMBER (p_collection_name => c_collection
                                                , p_c001            => ls_field_name
                                                , p_generate_md5    => 'NO');
                 END IF;
              END IF;
              lb_process_current_field := V(ls_field_name) IS NOT NULL;
            ELSIF IS_NUMBER (V(ls_field_name) ) THEN
              lb_process_current_field := (V(ls_field_name) != -100);
              lb_is_number_field := TRUE;
            ELSE -- ovo je za sve ostale!
              lb_process_current_field := (V(ls_field_name) IS NOT NULL) AND NOT (V(ls_field_name) IN ('-100','%null%','null'));
            END IF;
            IF lb_process_current_field THEN
               .... then do your work....Of course you must obey naming convention - what I can see you have done that so your control name is like:
    x1_1 xi_2.
    Hope this helps

  • Nested IPE (In Place Element) usage when accessing Cluster/Array data via DVR

    I am sharing data across several VIs and loops via a DVR, and accessing the data via a DVR IPE. The data is a cluster of arrays. The diagram below (VI attached) illustrates the structures invloved, but not the structure of the application.
    (The diagram above does not include initialization of the arrays, as it is intended only to illustrate the Cluster1 data type. Array lengths could be 100.)
    The DVR (DVR1) is passed to multiple VIs of the application at startup.
    Each VI executes loops that either read or write particular elements of each array (fArray1 or fArray2).
    I believe the DVR IPE (B1-DVR) provides blocking so that only one task can modify the data (Cluster1) at any time.
    Case 1 illustrates how I currently WRITE to array elements. The outer IPE (block B1) is rolled into a VI (not shown) that takes DVR1, Index, and Value as inputs.
    Cases 2 - 4 illustrate 3 additional methods that remove one or both of the inner IPEs (B2-Cluster and B3-Array).
    Case 2: IPE B3 (Array Index/Replace Elements) is replaced with a non-IPE 'Replace Array Subset'.'
    Case 3: IPE B2 (Unbundle / Bundle Elemnts)' is replaced with a non-IPE cluster 'Unbundle'/'Bundle'.
    Case 4: removes both B2 and B3.
    I implemented case 1 a long time ago.  When I had to do the same thing again recently, I did case 4.  When I stumbled across my earlier implementation, I was a bit suprised
    Which of the 4 cases should take the least time (or resources) to execute? I think case 4 has as few array allocations as any of the other 3.
    The attached image did not capture the Buffer Allocation marks, so I marked the ones that differed with a red "B".
    I am only interested in differences in how the arrays are handled, so I see no signioficant differences.
    Is this one of those cases where LV doesn't need my help?
    Incidently, I recently wrote a small app with shared data and decided to try FGVs to share array data.  For small arrays, 10^7 iterations, and an FGV based array-element read followed by a element write, the FGV was faster.  1.2us per read/write for FGV vs 3us per r/w for an DVR/IPE based read/write (like above).
    Peter
    LV 2011 SP1, Windows 7 64-Bit
    Attachments:
    IPE.vi ‏9 KB

    Option 1 is a definite no and as far as I know it has been NI's explicit intention to steer clear from it. I believe there's an idea in the IE which asks for this.
    I agree that option 2 makes sense, but I don't think it should be something the user specifies. Either LV can detect it automatically or it can't, but I doubt NI would let you have an option which creates the possibility for this kind of bug.
    I'm not sure, but the mark as modifier option on the IPES might be the option you're looking for. I know that it exists and I know very roughly what it does, but the documentation for it is very limited and I never actually played around with it, as usually I don't need these kinds of optimizations.
    You may well be right that a new option on the IPES is desirable and you should probably add it to the idea exchange.
    As for NIWeek, I'm not going this year, so I have no idea what kinds of sessions are around, but it's a great place to find people who know what they're talking about and ask them about it directly. Certain people in LV R&D would probably be ideal for this and if you ask relevant people, you might even get their names. I'm sure buying them a beer would also help to loosen their tounges. If you ask me, this type of interaction is the main value of the conference, not the sessions themselves.
    Try to take over the world!

  • How to send Array data using Post Method?

    Var array = $_POST['myData'];
    array[0] => 'ABC'
    array[1] => 'DEF'
    how to improve this code to support send array data...?
    String url ="http://xxxxx/test.php";
    String[] arraystr={"ABC", "DEF", "EDFF"}
    String parameter = "myData=" +arraystr;    // no support this
    Strint str = postMrthod(url, parameter );
    public static String postMethod(String url, String parameter) {
            StringBuffer b = new StringBuffer("");
            HttpConnection hc = null;
            InputStream in = null;
            OutputStream out = null;
            try {
                hc = (HttpConnection) Connector.open(url);
                hc.setRequestMethod(HttpConnection.POST);
                hc.setRequestProperty("CONTENT-TYPE", "application/x-www-form-urlencoded");
                hc.setRequestProperty("User-Agent", "Profile/MIDP-2.0 Configuration/CLDC-1.0");
                out = hc.openOutputStream();
                byte postmsg[] = parameter.getBytes();
                for (int i = 0; i < postmsg.length; i++) {
                    out.write(postmsg);
    out.flush();
    in = hc.openInputStream();
    int ch;
    while ((ch = in.read()) != -1) {
    b.append((char) ch);
    } catch (IOException e) {
    e.printStackTrace();
    try {
    if (in != null) {
    in.close();
    if (hc != null) {
    hc.close();
    } catch (IOException e) {
    e.printStackTrace();
    return b.toString().trim();

    yes, you can send integer value like this. But I think you have to put quotes around <%= TAMID%> i.e.
    <input type="hidden" id="HTTP_CVHTAMID"
    name="HTTP_CVHTAMID" value= "<%= TAMID%>" >

  • I want to transfer data through the serial port in the same coding that hyperterminal uses. How can i do it?

    The serial port seems to be working, and labview seems to be sending the data, but the problem is in which format does it send the data, because in hyperterminal i just input the string "JDX" and it sends it to my device, with labview it sends something but my device does not recognize it.

    nobuto wrote:
    > I want to transfer data through the serial port in the same coding
    > that hyperterminal uses. How can i do it?
    >
    > The serial port seems to be working, and labview seems to be sending
    > the data, but the problem is in which format does it send the data,
    > because in hyperterminal i just input the string "JDX" and it sends it
    > to my device, with labview it sends something but my device does not
    > recognize it.
    Hyperterminal adds the carriage return/line feed to the string which is
    generated by the return key to send out the current line. LabVIEW simply
    sends out what you tell it, so try to set the string to "Show \ Display"
    format and add a \r or \n or \r\n to the command you want to send out.
    Assumes of course that you set the right baudr
    ate/bits/parity etc in
    LabVIEW with the VISA property node, when opening the serial port.
    Rolf Kalbermatter
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

  • Receiving data through TCP Socket

    Hi all,
    I am trying to receive some data through TCP Socket from the
    server using XMLSocketClass. Ther server is responding with some
    data. But I can't access this data in my application. Pls tell me
    the reasons for not working of handler private function
    dataHandler(event:DataEvent):void .
    =============================================================================
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="
    http://www.adobe.com/2006/mxml"
    layout="absolute">
    <mx:Script>
    <![CDATA[
    import mx.controls.Alert;
    import mx.collections.ArrayCollection;
    import flash.display.Sprite;
    import flash.events.Event;
    import flash.events.DataEvent;
    import flash.events.IOErrorEvent;
    import flash.net.XMLSocket;
    private var socket:XMLSocket;
    private var nextId:int;
    private var events:ArrayCollection = new ArrayCollection();
    public static var host:String = "34.234.43.97";
    public static var port:Number = 8002;
    public var xml:XML;
    private function connectToServer():void
    socket = new XMLSocket();
    socket.addEventListener(DataEvent.DATA, dataHandler);
    configureListeners(socket);
    socket.connect(host, port);
    //This function is Not working
    private function dataHandler(event:DataEvent):void {
    Alert.show("dataHandler: " + event.data);
    xml = new XML(event.data);
    Alert.show(xml); }
    private function
    configureListeners(dispatcher:IEventDispatcher):void {
    dispatcher.addEventListener(Event.CLOSE, closeHandler);
    dispatcher.addEventListener(Event.CONNECT, connectHandler);
    dispatcher.addEventListener(DataEvent.DATA, dataHandler);
    dispatcher.addEventListener(IOErrorEvent.IO_ERROR,
    ioErrorHandler);
    dispatcher.addEventListener(ProgressEvent.PROGRESS,
    progressHandler);
    dispatcher.addEventListener(SecurityErrorEvent.SECURITY_ERROR,
    securityErrorHandler);
    private function closeHandler(event:Event):void {
    trace("closeHandler: " + event);
    private function ioErrorHandler(event:IOErrorEvent):void {
    trace("ioErrorHandler: " + event);
    private function progressHandler(event:ProgressEvent):void {
    trace("progressHandler loaded:" + event.bytesLoaded + "
    total: " + event.bytesTotal);
    private function
    securityErrorHandler(event:SecurityErrorEvent):void {
    trace("securityErrorHandler: " + event);
    /* private function dataHandler(event:DataEvent):void {
    trace("dataHandler: " + event);
    private function connectHandler(event:Event):void
    var obj:Object = new Object();
    obj.id = nextId++;
    obj.eventName="connect";
    obj.timestamp = new Date().valueOf();
    events.addItem(obj);
    private function sendData():void
    var xmlvalue:String=txtData.text.toString() ;
    var xmlfile:String =
    "<command>SndIns<parameter1>0x06</parameter1><parameter2>0x00</parameter2><parameter3>0x7 1</parameter3><parameter4>0x0F</parameter4><parameter5>0x11</parameter5><parameter6>0xFF</ parameter6></command>";
    socket.send(xmlfile);
    Alert.show(xmlfile);
    ]]>
    </mx:Script>
    <mx:HBox width="80%" horizontalAlign="center">
    <mx:TextInput id="txtData" name=""/>
    <mx:Button id="btnConnect" label="Connect"
    click="connectToServer();btnConnect.enabled = false"/>
    <mx:Button id="btnSend" label="Send Data"
    click="sendData()"/>
    <!--<mx:Button label="getData" id="btnGet"
    click="getData()"/>-->
    </mx:HBox>
    <mx:HBox x="10" y="30" width="100%">
    <mx:DataGrid width="80%" height="100%"
    dataProvider="{xml}">
    <mx:columns>
    <mx:Array>
    <mx:DataGridColumn headerText="Event Name"
    dataField="eventName"/>
    </mx:Array>
    </mx:columns>
    </mx:DataGrid>
    </mx:HBox>
    </mx:Application>

    Hi all,
    I am trying to receive some data through TCP Socket from the
    server using XMLSocketClass. Ther server is responding with some
    data. But I can't access this data in my application. Pls tell me
    the reasons for not working of handler private function
    dataHandler(event:DataEvent):void .
    =============================================================================
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="
    http://www.adobe.com/2006/mxml"
    layout="absolute">
    <mx:Script>
    <![CDATA[
    import mx.controls.Alert;
    import mx.collections.ArrayCollection;
    import flash.display.Sprite;
    import flash.events.Event;
    import flash.events.DataEvent;
    import flash.events.IOErrorEvent;
    import flash.net.XMLSocket;
    private var socket:XMLSocket;
    private var nextId:int;
    private var events:ArrayCollection = new ArrayCollection();
    public static var host:String = "34.234.43.97";
    public static var port:Number = 8002;
    public var xml:XML;
    private function connectToServer():void
    socket = new XMLSocket();
    socket.addEventListener(DataEvent.DATA, dataHandler);
    configureListeners(socket);
    socket.connect(host, port);
    //This function is Not working
    private function dataHandler(event:DataEvent):void {
    Alert.show("dataHandler: " + event.data);
    xml = new XML(event.data);
    Alert.show(xml); }
    private function
    configureListeners(dispatcher:IEventDispatcher):void {
    dispatcher.addEventListener(Event.CLOSE, closeHandler);
    dispatcher.addEventListener(Event.CONNECT, connectHandler);
    dispatcher.addEventListener(DataEvent.DATA, dataHandler);
    dispatcher.addEventListener(IOErrorEvent.IO_ERROR,
    ioErrorHandler);
    dispatcher.addEventListener(ProgressEvent.PROGRESS,
    progressHandler);
    dispatcher.addEventListener(SecurityErrorEvent.SECURITY_ERROR,
    securityErrorHandler);
    private function closeHandler(event:Event):void {
    trace("closeHandler: " + event);
    private function ioErrorHandler(event:IOErrorEvent):void {
    trace("ioErrorHandler: " + event);
    private function progressHandler(event:ProgressEvent):void {
    trace("progressHandler loaded:" + event.bytesLoaded + "
    total: " + event.bytesTotal);
    private function
    securityErrorHandler(event:SecurityErrorEvent):void {
    trace("securityErrorHandler: " + event);
    /* private function dataHandler(event:DataEvent):void {
    trace("dataHandler: " + event);
    private function connectHandler(event:Event):void
    var obj:Object = new Object();
    obj.id = nextId++;
    obj.eventName="connect";
    obj.timestamp = new Date().valueOf();
    events.addItem(obj);
    private function sendData():void
    var xmlvalue:String=txtData.text.toString() ;
    var xmlfile:String =
    "<command>SndIns<parameter1>0x06</parameter1><parameter2>0x00</parameter2><parameter3>0x7 1</parameter3><parameter4>0x0F</parameter4><parameter5>0x11</parameter5><parameter6>0xFF</ parameter6></command>";
    socket.send(xmlfile);
    Alert.show(xmlfile);
    ]]>
    </mx:Script>
    <mx:HBox width="80%" horizontalAlign="center">
    <mx:TextInput id="txtData" name=""/>
    <mx:Button id="btnConnect" label="Connect"
    click="connectToServer();btnConnect.enabled = false"/>
    <mx:Button id="btnSend" label="Send Data"
    click="sendData()"/>
    <!--<mx:Button label="getData" id="btnGet"
    click="getData()"/>-->
    </mx:HBox>
    <mx:HBox x="10" y="30" width="100%">
    <mx:DataGrid width="80%" height="100%"
    dataProvider="{xml}">
    <mx:columns>
    <mx:Array>
    <mx:DataGridColumn headerText="Event Name"
    dataField="eventName"/>
    </mx:Array>
    </mx:columns>
    </mx:DataGrid>
    </mx:HBox>
    </mx:Application>

  • Sysgen : How to read the input port data type, width and rate dynamically in a masked subsystem ?

    Hello everybody,
         I am designing a general purpose block in system generator. I pass the user parameters to the block through masking it. Some user parameters can change the block configuration. The input port data type, width and rate can also affect the block configuration.
         The problem is that these values (input port data type, width and rate) are subject to change. So I should read them dynamically, then change the block configuration through programming the "Initialization Commands" field. But unfortunately there is no straight way to read the input port information.
         There are some methods in for example the "Black Box". these are:
    input_width = this_block.port('din').width;
    input_rate = this_block.port('din').rate;
    But these methods are not applicable to a masked subsystem.
    I have tried other ways also. You can find them below. None of them worked.
    Does anybody know how can I solve this problem?
    Other ways I tried:
    1)
    design_name([],[],[],'compile')                                       
    q=get_param(gcb,'PortHandles');
    get_param(q.Inport,'CompiledPortDataType')
    get_param(q.Inport,'CompiledPortWidth')
    get_param(q.Inport,'CompiledPortDimensions')
    design_name([],[],[],'term')
    2)
    ssGetInputPortDataType
    3)
    ts = Simulink.Block.getSampleTimes([gcb '/Input'])
     

    Today we rely on Simulink to perform parameterization of your designs in two ways:
    Parameterizable Subsystems and Blocks : Parameters themselves can be MATLAB expressions that need to be evaluated for which we need the MATLAB interpreter
    The very useful Rate and Type propagation or Simulink compilation that allows us to specify types & rates in one location that gets systematically propagated to all.
    To truly make the HDL Netlist that is generated from SysGen parameterizable, we would have to implement some of this capability in the HDL netlist itself by:
    Using Generics(VHDL) or Parameters(Verilog) - We would have to capture the bit width(type) propagation through levels of hierarchies and finally parameterize the IP itself based on this value
    Since IP itself does not have this capability through generics, we would have to package a separate tcl script that updates the IP parameterization appropriately in response to top level parameters(or GUI parameters)
    Interpreting MATLAB expressions and translating them into VHDL/Verilog expressions (alternatively tcl expressions of IP). In simulink, mask parameters can be passed from one level to the next. Also parameterization of a block can be composed of Matlab expressions using variables from ancestor masks & the MATLAB interpreter – so we will need to somehow capture that as well.
     

  • How to convert digital array data into analog signal

    i want help to convert digital data array into analog signal

    shubham62 wrote:
    We are implimenting real time audio trans-receiver. We have converted input audio data(analog form) into digital data. At the receiver side we received digital data which is in the form of digital data array.But we are unable to recover back our original input data. So please help us to sort out the problem.
    Still no useful information.  How was the data converted to digital in the first place?  What conversion parameters did you use?  As was said, you just need to do the math backwards to get it back into the analog.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • Why did Fetch waveform Vi generates strange 1D array data(all elements are -5.2)?

    I just made some changes on the Getting Startted vi of tkds30xx scope driver to catch the start process of a power supply output(2Vdc). I use Initiate Acquisition vi followed by Fetch waveform vi to get the waveform on scope. I use a logical signal controlled by the Agilent 34903A switch to trigue the waveform acquisition. Then I get the 1D array output from Fetch waveform vi for calculation by another subvi. The waveform sample points are 10E+3 points(default). When running the program, the waveforms on the scope screen are right what I expect, but the 1D array data values are all -5.2V.

    Without seeing your code it would be hard to give specifics, but does -5.2V appear anywhere else in the system? One possibility is that you aren't looking at the channel you think you are.
    How much delay is there between when you tell the scope to begin acquisition and the read occurs? Could the read be getting its data before the scope actually triggers?
    What happens when you run the "Fetch Waveform" vi by itself? In other words, if you setup the system and generate the trigger manually such that the proper waveform is on the scope, does Fetch Waveform run by itself return the proper result?
    If this is not correcct there is something basically wrong with the function for reading the waveform. Again, giving specifics are hard, but open the VI and go
    through it statement by statement making sure that the settings and commands make sense for your application. Many vendors make excellent instrumentation, but I have yet to see one that could write a good driver.
    Also, could you describe what the proper waveform looks like?
    Mike...
    Certified Professional Instructor
    Certified LabVIEW Architect
    LabVIEW Champion
    "... after all, He's not a tame lion..."
    Be thinking ahead and mark your dance card for NI Week 2015 now: TS 6139 - Object Oriented First Steps

  • Sending Data Through a Output Stream...

    Hello,
    I am writing a program that works on a network...a server is running and client will connect to the server and send specific data for the server to complete transactions on.
    The transactions that are mainly seen are SQL SELECT statements and as you can imagine a statement could bring back many records.
    At present I have been able to send specific data through streams and have turned this into parameters on the server side and performed SQL. What I need help with or suggestions on is how to get the data back to the client. In some cases it may need to be displayed on screen or just used for further processing?
    Please let me know if this is not 100% clear.
    Thanks,
    P

    If you are able to send data over a network, then I assume that you know how to do network programming in Java, as well as knowing SQL.
    Java has JDBC - Java DataBase Connectivity API that supports your requirements in full.
    If you require a custom solution, then you need to be able to read data back from the server - when the server returns the ResultSet back to the client.
    A Socket object has both input and output streams. Seems that you know about the output stream, do you not know about the input stream?
    If the server is setup to send data back to the client over the same socket, then you should simply be able to read the results back from the socket's input stream.

  • Filtering of Data through Combo Box with chart drill down Option.

    Hey Guys,
    I need to ask one thing about combo box filtering option, i want to filter my data like country, agent, customer and in the end material. I have achieved this through filter component but the thing which bother me is that if i select the specific customer in filter option it directly give's input to other filter's which i don't want. So the alternate is combo box but the thing which is creating problem is that if i filter my data through combo box it doesn't give any option for the chart filtering. For more convenience i am attaching my spreadsheet data which i want to filter.  please help me in this matter.
    Thanks & Best Regards,
    Hassan Ali.
    Sample Is Below::
    Country
    Customer
    Material
    Austria
    David
       Mat 1
    Austria
    Simon
       Mat 2
    China
    XYI jo
       Mat 2
    China
    CHU pa
       Mat 4
    India
    Suresh
       Mat 1
    India
    Ramesh
       Mat 5
    Sales Quantity
    Export Sales
    300.000 FT2
    1,631,020.77 PKR
    600.000 FT2
    3,108,107.67 PKR
    600.000 FT2
    11,917,131.08 PKR
    200.000 FT2
    8,679,817.14 PKR
    760.000 FT2
    8,059,453.23 PKR
    790.000 FT2
    1,727,072.16 PKR

    Nothing to do with excel file, just the logic with combo box.

Maybe you are looking for

  • Is there a way to create a video that is 1080x1920?

    I have a project that will need to be displayed on a portrait monitor. I have elements 12.

  • Ipod Touch (3rd generation) connection to a TV

    Can anyone tell me how to connect my Ipod Touch (3rd generation) model A1318 to a TV to display YouTube and Video? The Apple Store have advised me that they don't have a cable that will do this but to use a third party one with third party software f

  • ITunes randomly linking to non-song files... a real curve-ball of an issue

    I have been having problems with songs in my iTunes library suddenly not playing. When I select "Reveal in Finder" the file that it revealed is often a driver in my library - worse still, the song is then no-where to be found using spot-light but it

  • SQL 2014 Upgrade Advisor

    Hey there, I've installed SQL 2014 Enterprise on a VM and am trying to install the Upgrade Advisor. Directions indicate that I should run SqlUA.msi but I get the following error: ======================================== Setup is missing prerequisites

  • Multi Language issue with Invoice Printing

    I have a Custom Report for Invoice. Now it has been associated to a Concurrent Program and if I submit the request through SRS, I am able to see Report output. Same report I have associated to iReceivables application and invoke it from there (using