How to write global functions?

Hello

I have some features in my application that I feel will be used in several places. Usually in HTML/Javascript that I could do:

< script type = "Javascript" src = "js/functions.js" > < / script >

In the functions.js file I could have various functions and call them from any page of the display.

How can I get a set of functions like this in Flex/ActionScript? For example, I have a few places where a user may "Add an employee" for example. I would like to call the same function.

How can I include some functions in the world so they can be called from anywhere in my application.

-Westside

I create a class and simply import the classes than any place you want to use. For utilities, you can create a class with static methods.

Tags: Flex

Similar Questions

  • How to write a function block?

    Hello

    Someone knows how to write a function block with LabVIEW?  Something like those in real time live > function blocks >.

    Thank you very much in advance?

    Assuming you are referring to these specifically...

    http://www.NI.com/white-paper/7339/en/

    .. then the answer is that it is almost impossible to make a new. However, there is really nothing special all that to their topic. They are essentially normal subVIs (which you can learn about the other links) which just happened to have some terminals connected to shared variables. I personally would not normally recommend that anyway. If you could clarify what exactly you are trying to do, it might be possible to give more specific advice.

  • How to write a function to estimate the number of rows returned SQL?

    How to write a function to estimate the number of rows returned SQL through SQL Execution Plan?
    My idea is
    Call dbms_sql.parse to create the SQL PLAN, then ask the PLAN for the number of estimated return lines.
    But how to get SQL plan through "id cursor?
    Thank you.

    You can use EXECUTE IMMEDIATE to explain plan statement. About the STATEMENT_ID generation, it could be anything. Even a SYSTIMESTAMP cast as TANK would work.

  • How to write a function (for an ex-Flash-dev)

    Hiya,

    I am coming from a Flash/AS 3.0 environment and I'm getting a bit confused trying to write functions in EA.

    I'm quite new to JS and jQuery so that something is similar to actionscript, I'm still finding things a little confusing.

    I'm working on my first project with EA 2014.1.1 and managed to get away with the built in functions to date, but I now need to do something more custom.

    For example, in Flash, I would write a function to a button and it would go in the first frame of the timeline or a class file:

    function nameOfFunction (event) {}

    do things

    };

    Then the button, we would have a script event listener calling the function:

    myButton.addEventListener (MouseEvent.CLICK, nameOfFunction);

    Can someone explain to me how it works in the EA?

    It seems easy to use for the very basic functions, but anything more requires advanced js knowledge!

    I watched a lot of tutorials but they are for older versions of the edge or that they cover only the basic stuff.

    It doesn't seem to be much out there at all.

    Thank you very much

    Hello

    Put the function in the compositionReady

    SYM. Nomfonction = function() {}

    Do all that in the service

    }

    and call it when you want it

    SYM. Nomfonction();

    I hope this helps.

  • How to write the function for bottom of logic...

    I have a picture in the picture I have a records like below
    code value
    1 20
    2 null
    3 30
    4 null
    5 40
    6 null


    The output need to have the values displayed in the fields first, followed by the NULL values as below

    code value
    1 20
    2 30
    3 40
    4 null
    5 null
    6 null

    I think the suspicion is that the values must be concatenated with the replacement of NULL values with (;).
    as
    20, 30, 40
    Get single values and insert into the table...

    for this I don't know how to write function for who can please help me on these...

    Published by: Claudia on June 22, 2011 22:45

    Published by: Claudia on June 22, 2011 22:51

    Create or replace function test_fun
    is
    cursor fun1 is the value select from table by CSA 2;-"this select query will return 20,30,40, null, null, null".
    v_out varchar2 (20);
    Start
    fun1 open cursor;
    loop
    extract the fun1 in v_out;
    dbms_output.put_line (v_out); - this is the command display output on the screen.
    output when fun1 not found %;
    end loop;
    close;
    end;

    Please try it and tell us if no query...

    Thank you
    IQ

  • How to write Save function based on the drop-down list box selection data in app mxml flex4 with as3

    Hi all

    I'm working on the application web flex4 with as3.

    I have a doubt, I've created a mxml it has two text boxes, except the button and a combo box that is has two option as a percentage and the amount.

    my needs are I gave here.

    need 1: when I choose option amount that two text boxes does not have to be editable.when I select text tat box two percentage option will be editable.

    need 2: when I select the percentage in combox option and two text boxes are empty, and then click the button Save-> I want to display warning msg

    need 3: when I select the option amount combox and the two boxes are emptu click the button Save-> I don't want any warning messages.

    How to validate it and how to write backup for this function.

    This is my sample code:

    list box ID = baseAmtPer

    ID TextBox1 = maxCommAmt.text

    ID = baseAmtPer.text text box

    If (((baseAmtPer.editable!=true) & & (maxCommAmt.editable! = true)) & & ((baseAmtPer.text=="") & &(ma xCommAmt.text=="")) |) (baseAmtPer.text == "") | (maxCommAmt.Text=="")) -> This condition not allowing while I'm selecing amount in combo box. How the TWO TEXT BOX WILL BE EMPTY for this problem

    {

    Alert.Show ("enter in all areas", "Information");

    }

    on the other

    {

    some encodings

    }

    Hello

    Please go through the following Code:

    http://ns.Adobe.com/MXML/2009.

    xmlns:s = "library://ns.adobe.com/flex/spark".

    xmlns:MX = "library://ns.adobe.com/flex/mx" minWidth = "955" = "600" minHeight >

    Import mx.collections.ArrayCollection;

    Import mx.controls.Alert;

    Import spark.events.IndexChangeEvent;

    protected function button1_clickHandler(event:MouseEvent):void

    {

    If (comboBox.selectedItem == "Percentage" & textBox1.text == "" & textBox2.text == "") {}

    Alert.Show ("enter the values");

    }

    }

    protected function comboBox_changeHandler(event:IndexChangeEvent):void

    {

    {if(ComboBox.SelectedItem=="Amount")}

    textBox1.editable = false;

    textBox2.editable = false;

    }

    else {if(comboBox.selectedItem=="Percentage")

    textBox1.editable = true;

    textBox2.editable = true;

    }

    }

    ]]>

    Amount

    Percentage

    Thank you and best regards,

    ------------------------------------------------------------------------------------------ --

    Vibhuti Gosavi . [email protected] | www.infocepts.com

    ------------------------------------------------------------------------------------------ --

  • How to write the function or procedure to function 'Round' in oracle

    Hello friends,

    Last week I went to attend the interview. I asked a function, or a procedure to achieve the functionality of the 'Round' function in oracle manually. I couldn't reach it properly. Can someone let me know how I can do this? Is a mathematical idea behind it?

    Thank you and best regards,
    SB

    Hello

    create or replace
    function my_round_fn (p_number in number, number of Round_Val)
    Return number
    is
    whole v_round;
    Start
    v_round: = P_number * Power (10, Round_Val);
    Return v_round / (Power (10, Round_Val));
    end my_round_fn;

    It works in all cases.

    Kind regards
    Praveen

  • How to write a decryption function?

    Hi! everyone ,


    I see one encryption function in my database.


    Select f_pwd_encrypt ('password') of double


    -> 12412913141313139139130121


    My question is


    How to write a decryption function?


    As:


    Select f_pwd_decrypt ('12412913141313139139130121') of double


    ->password

    CREATE OR REPLACE FUNCTION EPADM."F_PWD_ENCRYPT" ( vpwd in varchar2)
    return varchar2
    is
        vother_p   varchar2(9);
        vtr_pwd  varchar2(2048);
        i       number;
        j         number;
        vsubstr varchar2(9);
        vtemp1 varchar2(08);
        vvalue number := 0;
        vdb_pwd varchar2(100);
    
    
        function str_2_bit(vstring in varchar2)
        return varchar2
        is
           i number;
           vtemp number;
           v1 varchar(2048);
    
    
         function single_byte(vin in number)
           return varchar2
           is
             i number;
             vresult varchar2(08);
             vtemp number := vin;
           begin
             for i in 1..8 loop
               vresult := to_char(mod(vtemp,2))||vresult;
               vtemp := trunc(vtemp/2);
             end loop;
             return(vresult);
           end;
      --
        begin
          for i in 1..lengthb(vstring) loop
            select to_number(substrb(dump( vstring ,10,i,1),instr(dump( vstring ,10,i,1),' ',-1)+1))
              into vtemp
            from dual;
            v1 := v1 || single_byte(vtemp);
          end loop;
    
    
          return(v1);
        end;
    
    
    begin
      vtr_pwd := str_2_bit(vpwd);
      vtr_pwd := substrb(vtr_pwd,4)||substrb(vtr_pwd,1,3);
      vvalue := 0;
      vdb_pwd := null;
    
    
       for i in  1..(lengthb(vtr_pwd)/4)  loop
         vtemp1 := substrb(vtr_pwd,(i-1)*4+1,4);
         for j in 1..4 loop
           vvalue :=  vvalue + to_number(substrb(vtemp1,j,1)) * power(2,j-1);
           dbms_output.put_line(j||' '||vvalue);
         end loop;
              vdb_pwd := to_char(vvalue) ||vdb_pwd;
              vvalue := 0;
       end loop;
      return(vdb_pwd);
    
    
    END;
    /
    

    OK, after reviewing the, I don't think you'll be able to write a function of decryption for him.

    The first thing he does is take the ascii value of each character in the password and converts them into a binary string.  The code it uses is far too complex and can be simplified, but which is not a problem here.

    I've recreated the first step of SQL like this...

    SQL > ed

    A written file afiedt.buf

    1 with chr_val like)

    2. Select level l

    3, dump('password',10,level,1) in the dmp

    4, to_number (substrb (dump('password',10,level,1), instr (dump('password',10,level,1),' ', 1) + 1)) as chr_val

    5, ascii (substr('password',level,1)) as chr_val - equivalent of extraction of useless dump

    6 double

    7. connect by level<=>

    8        )

    9, r (l, b, ch, chr_val, result, vtemp) as

    10 (select l, 0 b, chr (chr_val), chr_val)

    11, cast (null as varchar2 (8)) as a result

    12, chr_val as vtemp

    13 of chr_val

    14 union of all the

    15 select l, b + 1, b, ch, chr_val

    16, to_char (mod(vtemp,2)) | result as a result

    17, trunc(vtemp/2) as vtemp

    18 r

    where the 19 b + 1<=>

    (20) depth search first by l, defined b seq

    21, as)

    22 select l, ch, chr_val, str_to_bit result

    23 r

    where the 24 b = 8

    25 arrested by l, seq

    26            )

    27 select listagg (ch) within the Group (order) as password

    28, listagg (chr_val, ',') within the Group (order) byte_vals

    29, listagg (str_to_bit) within the Group (order) bit_vals

    30 sec.

    SQL > /.

    PASSWORD BYTE_VALS BIT_VALS

    --------------- ---------------------------------------- ----------------------------------------------------------------------------------------------------

    password 0111000001100001011100110111001101110111011011110111001001100100 112,97,115,115,119,111,114,100

    Then he takes this string binary ("bit_vals" in my example) and does the following:

    1. take the first 3 bits of left and to transpose on the right end of the string.

    2 chops the resultant bit string upward into sections of 4 bits (which is known as a 'nibble' inside)

    3. for each bit in the nibble, he treats the bits in binary reverse to normal and gives them a value of 1,2,4 or 8 from left to right for each bit set to 1

    4. for each nibble it adds the value of 1,2,4,8 bits to give a value from 0 to 15

    To show that the use SQL...

    SQL > byte (select ' 0111000001100001011100110111001101110111011011110111001001100100' as pieces of double)

    2, swap3bit as (-take the binary string and put the first bits (high) 3 as a (low) bit of the right hand side)

    3. Select bytes.bits

    4, substr (bit 4) | substr (bits, 1, 3) as init_substr

    5 bytes

    6                   )

    7, split4 as (-chop the string of bits nibbles (half bytes - 4 bits))

    8. Select level l

    9, substr (init_substr, ((level-1) * 4) + 1, 4) as a nibble

    swap3bit 10

    11. connect by level<=>

    12                 )

    13, bitpowers (select l

    14, snack

    15, to_number (substr(nibble,1,1)) * power (2, 1-1) as bitval1

    16, to_number (substr(nibble,2,1)) * power (2, 2-1) as bitval2

    17, to_number (substr(nibble,3,1)) * power (2, 3-1) as bitval3

    18, to_number (substr(nibble,4,1)) * power (2, 4-1) as bitval4

    19, to_number (substr(nibble,1,1)) * power (2, 1-1) +.

    20 to_number (substr (nibble, 2, 1)) * power (2, 2-1) +.

    21 to_number (substr (nibble, 3, 1)) * power (2, 3-1) +.

    22 to_number (substr (nibble, 4, 1)) * power (2, 4-1) as total_val

    23 of split4

    24                   )

    25 select * from bitpowers

    26.

    L NIBB BITVAL1 BITVAL2 BITVAL3 BITVAL4 TOTAL_VAL

    ---------- ---- ---------- ---------- ---------- ---------- ----------

    1 1000          1          0          0          0          1

    2 0011          0          0          4          8         12

    3 0000          0          0          0          0          0

    4 1011          1          0          4          8         13

    5 1001          1          0          0          8          9

    6 1011          1          0          4          8         13

    7 1001          1          0          0          8          9

    8 1011          1          0          4          8         13

    9 1011          1          0          4          8         13

    10 1011          1          0          4          8         13

    11 0111          0          2          4          8         14

    12 1011          1          0          4          8         13

    13 1001          1          0          0          8          9

    14 0011          0          0          4          8         12

    15 0010          0          0          4          0          4

    16 0011          0          0          4          8         12

    16 selected lines.

    These final values are then re-combination as strings in reverse order so that you get then:

    '12' |' 4'||' 12' |' 9'||' 13'... and so on.

    In SQL...

    SQL > byte (select ' 0111000001100001011100110111001101110111011011110111001001100100' as pieces of double)

    2, swap3bit as (-take the binary string and put the first bits (high) 3 as a (low) bit of the right hand side)

    3. Select bytes.bits

    4, substr (bit 4) | substr (bits, 1, 3) as init_substr

    5 bytes

    6                   )

    7, split4 as (-chop the string of bits nibbles (half bytes - 4 bits))

    8. Select level l

    9, substr (init_substr, ((level-1) * 4) + 1, 4) as a nibble

    swap3bit 10

    11. connect by level<=>

    12                 )

    13, bitpowers (select l

    14, snack

    15, to_number (substr(nibble,1,1)) * power (2, 1-1) as bitval1

    16, to_number (substr(nibble,2,1)) * power (2, 2-1) as bitval2

    17, to_number (substr(nibble,3,1)) * power (2, 3-1) as bitval3

    18, to_number (substr(nibble,4,1)) * power (2, 4-1) as bitval4

    19, to_number (substr(nibble,1,1)) * power (2, 1-1) +.

    20 to_number (substr (nibble, 2, 1)) * power (2, 2-1) +.

    21 to_number (substr (nibble, 3, 1)) * power (2, 3-1) +.

    22 to_number (substr (nibble, 4, 1)) * power (2, 4-1) as total_val

    23 of split4

    24                   )

    25 select listagg (to_char (total_val)) the Group (order of the desc) as pwd

    26 of bitpowers

    27.

    PWD

    -------------------------------------------------------------------------------------------------------------------

    12412913141313139139130121

    Now, the problem of decryption is that these numbers are concatenated without padding for a fixed number of digits by value, so you don't know if it was

    '12' |' 4'||' 12' |' 9'||' 13'... and so forth as we did it, or whether he was

    '1'||' 2'||' 4'||' 12' |' 9'||' 1'||' 3'... and so on, or any other combination of values from 0 to 15

    There is essentially no information to allow you to divide the string upwards in the correct components to allow the whole process be reversed.

    So, you are out of luck... no chance of decrypting it.

  • Create a directory tree: how to call a global function from inside a for loop

    Hello

    I am trying to create a workflow that will create a directory tree in vCenter.

    Concept:

    Basically, I am trying to execute nested for loops for each level of the tree to the caller a global tree.

    Problem:

    The 1st loop for works and creates the file 'Dev '.  The second loop for does not work with error message:

    [19:16:16.219 2013-06-27] [I] building Dev folder
    [19:16:16.474 2013-06-27] [I] directory Built: Dev
    [19:16:16.476 2013-06-27] [I] the records building servers
    [19:16:16.480 2013-06-27] [I] TypeError: cannot find the createFolder function in dev object. (Workflow: TEST_TNG_New_Site_Folder_Structure / Scriptable task (item2) #36)

    I think it has to do with JavaScript not being not able to call a global function in a nested object (I'm not a programmer and don't know JavaScript, so don't shoot me on that :)

    Code: (will clean this up once I do work)

    var folderBase is ['Dev', 'DMZ', 'Prod', 'UAT'];.

    var folderT1 = ["servers", "Jobs"];

    var folderT2 = ['Window', 'Linux'];

    var folderT3 is ["Repo2', 'Repo3', 'Repo1', 'Repo4'];.

    var folderT4 is ["T1", "T2", "T3"];.

    Create the files folderBase level

    for (var i = 0, l = folderBase.length; i < l; i ++) {}

    var rootFolder = parentFolder;

    buildFolderTree (folderBase [i]);

    Create the files folderT1 level

    for (var j = 0, l = folderT1.length; j < l; j ++) {}

    var rootFolder = folderBase [i];

    buildFolderTree (folderT1 [j]);

    Create the files folderT2 level

    for (var k = 0, l = folderT2.length; k < l; k ++) {}

    var rootFolder = folderT1 [j];

    buildFolderTree (folderT2 [k]);

    Create the files folderT3 level

    for (var x = 0, l = folderT3.length; x < l; x ++) {}

    var rootFolder = folderT2 [k];

    buildFolderTree (folderT3 [x]);

    Create the files folderT4 level

    for (var y = 0, l = folderT4.length; y < l; y ++) {}

    var rootFolder = folderT3 [x];

    buildFolderTree(folderT4[y]);

    }

    }

    }

    }

    }

    function buildFolderTree (folderName) {}

    System.log ("Building folder" + folderName);

    rootFolder.createFolder (folderName);

    System.log ("directory of frame:" + folderName);

    }

    Any help will be appreciated.

    Thank you

    B

    Hello

    The createFolder() method returns the object VcFolder to the folder just created, for the new file to be used immediately.  Here is how I modified the code:

    Create the files folderBase level
    for (var i = 0; i)
    var newBaseFolder = buildFolderTree (parentFolder, folderBase [i]);
    Create the files folderT1 level
    for (var j = 0; j)
    var newT1Folder = buildFolderTree (newBaseFolder, folderT1 [j]);
    Create the files folderT2 level
    for (var k = 0; k)
    var newT2Folder = buildFolderTree (newT1Folder, folderT2 [k]);
    Create the files folderT3 level
    for (var x = 0; x)
    var newT3Folder = buildFolderTree (newT2Folder, folderT3 [x]);
    Create the files folderT4 level
    for (var y = 0; y)
    var newT4Folder = buildFolderTree (newT3Folder, folderT4 [y]);
    }
    }
    }
    }
    }

    function buildFolderTree (parentFolderObj, folder_name) {}
    System.log ("Building folder" + folderName);
    var newFolder = parentFolderObj.createFolder (folderName);
    System.log ("directory of frame:" + folderName);
    return NewFolder;
    }

  • How to write a generic function.

    Hello

    Can someone tell me the concept, I have to get hip to in order to write a generic function that will work on any object?

    Here is the project: I'll be show 24 graphs, (imported as Bitmaps and BitmapData jpg), and I would like to create a function where onRollover graph would be tween on twice its size, then come back to the original dimensions when the mouse is released. Pretty simple.

    I'm OK with everything about the import of jpg files and to implement the action of Tweener. And I think it's good to be a better way to write different functions of RollOver and RollOut for each graph, but I must have been absent that day.

    When I use 'this' in the function, it behaves like 'this' is planned: any change! But it's not what I'm shooting.

    I expect to write the function ONCE and apply it to all the graphics after that I have addChild-ed them, but I can't figure out how to set the variable (in the function) which refers to some object (Bitmap graphics) is set up to the course.

    I declare a public variable or something? And match to what is reversed? No need a step by step tutorial, just of me not to point in the right direction. I'll ask Shupe and Rosser. :)

    Oh, uh, Flash CS3, AS3... (I prefer to use the Flash environment because I'm still not enough good for simply create the .as files.)

    Thank you!

    Each of your JPGs load as a MovieClip/Sprite. Say mc1, mc2...
    Then set properties for all the clips as below

    MC1.buttonMode = true;
    MC1.mouseChildren = false;
    MC1.addEventListener (MouseEvent.MOUSE_OVER, onMouseOver);
    MC1.addEvenListener (MouseEvent.MOUSE_OUT, onMouseOut);

    function onMouseOver(evnt:MuseEvent)
    {
    new Tween (evnt.target, "x", Regular.easeInOut, evnt.target.x, evnt.target.x * 2, 5, true);

    new Tween (evnt.target, "y", Regular.easeInOut, evnt.target.y, evnt.target.y * 2, 5, true);
    }

    This is what helped?
    Tell me if you need something more...

  • In the target FPGA read/write control function?

    Hi people,

    I learn a lot from the sample project FPGA, including how you can easily retrieve and set controls and indicators in an FPGA using the read/write control function running in an RT target.

    However, I can't find a way to do something similar in a FPGA target.  I've been down this road before - that is, trying to move the data in/out a looping VI FPGA (void) to a (parent) FPGA VI - where my memory points to reach what I needed use.

    So I was happy to see the palette FPGA enabled me to drop the control functions to read/write on a FPGA vi target.  But alas there where tons of errors (not compatible son for target, etc.) and I guess now it's not possible.

    So, just to be sure, I'm not missing something, is there something like control functions to read/write to use in an FPGA for read/write in an another FPGA (looped)?

    In addition, why would I be able to read/write on a FPGA vi control functions if they are not supported?  (Sorry for the n00b question)

    Thank you

    Steve

    maherhome wrote:

    You're right that I don't have this knot in my palette.  However, I also do not seem to have a Refnum Occurrence in the palette is in the FPGA (see below), but I need to synchronize several loops of FPGA and added research using the textfield in the VI editor (and if compiles and runs).  So 6 months to Labview and I'm fuzzy on how the palette is restricted

    I don't know what you're trying to prove here. There is no control of refnum in search in your image. Occurrences are available in FPGA, and for control of refnum for one you just right click on a function of the instance and create a control. If you can create a valid thread of a certain type of data, then you can create a control or the indicator for it, regardless of the question to know if this type of control or indicator appears in the palettes. However, the functions that you can use in the block diagram are limited by what is available in the palettes.

    maherhome wrote:

    Regarding orders read/write for the FPGA/lights, I'm surprised that the infrastructure developed to allow read/write between RT and FPGA has not mobilized to allow read/write between FPGA and FPGA.  The elements of memory function, but they are less convenient.

    You may have noticed that you cannot compile the individual parts of an FPGA VI and combine them later; This is because when you compile an FPGA VI, all its subVIs are essentially merged to create a single block diagram (with additional logic if one not reentrant Subvi is used in multiple locations, this is why it is not recommended on FPGA). The subVIs no longer exist in the FPGA compiled; reading and writing a control on them would make no sense. If you want similar behavior, use global variables - but understand that global variables store values in FPGA logic resources. Using the elements of memory (or FIFO, which can also store in memory) leaves more fabric available FPGA logic by storing data in resources specially designed for this purpose.

  • How to write data in mode intertwined with TDMS C DLL 2.0?

    Hello

    How to write data in mode intertwined with TDMS C DLL 2.0?

    I use DAQmx features in Visual Studio C++ without Measurment Studio.

    This function returns the data in interlaced mode.

    How can I configure the functions of DLL C TDMS to store this data in the tdms files?

    I see that it is not possible with the PDM version 2.0 with 1.0.

    Thank you

    -TDM C Dll is not able to do

    -TDM header writer may be usable for this but is not able to be used for tdms files.

  • Globals functional in BT 8.5

    Hi all!

    I've been struggling with making functional overall in LabView 8.5. I am a very new programmer, my job is essentially to learn LV online and check/optimize the code left by a previous programmer. His code uses a large number of local variables, many of which feed subVIs custom, so I was thinking only globals functional can be a good way to improve the code. I read that local variables are something of a no-no, but he uses them to pass specific data between a loop of producer/consumer (with the exception of the data in the queue). However, I had difficulties to enter the functional concepts behind the globals, and when I looked for examples on the forums I found examples of old/new versions that do not work for me. I think some esserntial concept is beyond me.

    So I have three questions if you have time.

    (1) exactly how the globals functional?

    (2) are they possible in LabView 8.5? My company does not update for fear of damaging the code we have.

    (3) globals functional would be faster than local variables?

    Thank you all for your time!

    -Gobble

    You have two errors in your VI.  A in the case of writing, the other at the Terminal stop.

    The error in the case of writing is what is causing the cut wire.  You create a segment of wire with two sources (one of the shift register, a control).

  • How to write a single line instead of the entire port?

    Hello

    I followed the example for writing to the digital line as follows

    int taskHandle;

    given int [8];

    char linename [] = "" dev2/port0 / line0:7 ";"

    DAQmxErrChk (DAQmxCreateTask ("", & taskHandle));

    DAQmxErrChk (DAQmxCreateDOChan (taskHandle, linename, "", DAQmx_Val_ChanPerLine));
    DAQmxErrChk (DAQmxStartTask (taskHandle));
    DAQmxErrChk (DAQmxWriteDigitalU8 (taskHandle, 1, 1, 10.0, DAQmx_Val_GroupByChannel, data, NULL, NULL)); Here the data have 8 digits
     
    Error:
    SetWaitCursor (0);
    If (DAQmxFailed (error)) DAQmxGetExtendedErrorInfo (errBuff, 2048);
    If (taskHandle! = 0)
    {
    DAQmxStopTask (taskHandle);
    DAQmxClearTask (taskHandle);
    }
    If (DAQmxFailed (error)) MessagePopup("DAQmx Error", errBuff);

    The example above shows how to write 8 binary to 8 lines, but how to write only one line? I try the following code, but it does not work

    char linename [] = "dev2/port0/line 2;

    ...

    DAQmxErrChk (DAQmxWriteDigitalU8 (taskHandle, 1, 1, 10.0, DAQmx_Val_GroupByChannel, & data [2], NULL, NULL)); Here the data have 8 digits

    The data format for the DAQmxWriteDigitalLines() function will do exactly what you want.

    The data format for the DAQmxWriteDigitalU8() function is a full port (even if you do not have a value of a harbour full of lines in your task).

  • Global functional table uses 2 x initialized space?

    I had a thread going on the reduction of the memory allocation on our LabView RT system located here for reference http://forums.ni.com/ni/board/message?board.id=170&thread.id=413552 .

    I use a global functional / Action engine to add to a U32 table that I'll be back to our FPGA PXI via DMA reads cards.  In order to keep the determinism, for the first time this table through the AE to its maximum size (18Million).  During my debugging process, I decided to run the 'Performance and Memory '.  When I put the number of elements to initialize to 18,000,000 I expect the performance tool to show me that this VI takes over 18 000 000 * 4 bytes = 72Mbyte.  However, after this VI running by clicking on the button instant I see this VI meet twice as many 144Mbyte, extactly!

    Then I ran the tool to 'See the distributions of buffer' and with 'Tables' checked, I see a black dot on the table to initialize primitive and a black point on the passage of the leftmost register.  By clicking on the button "help" in this tool I see it say under the table section "to avoid abuse of global and local variables when working with arrays. Reading of a global or local variable causes LabVIEW to generate a copy of the data. "This must be what happens now, but how am I supposed to store these data with the flexibility of an adverse event and do not have an extra copy floating around?

    Here is the part pertient EI for your reference:

    Hello

    When you use the function "Initialize the array", you create an additional table. Use the function "Remodeler Array" reuse the already existing table. See attachment.

Maybe you are looking for

  • AppleTV

    AppleTV will display the events of cable 'live' on your iPhone and iPad4 6Plus? If not, what do need me see TV/Cable programs as they look on the iPad 4...

  • Black screen after the Bootcamp

    I just installed a Windows 10 drive to my mac pro end 2012 book. I had some problems when the bootcamp says "cannot copy files of windows (or something like that). However, finally I managed to resolve each of them, the windows of the files have been

  • Equium L20 will not start properly

    My laptop L20 primer not. A black screen appears "apologize for the inconvenience, but windows did not start successfully. Then tells me to highlight a choice of starting up, but when I choose, it moves quickly on a blue screen that I cannot read, th

  • Capture the signal micro PC line

    I am aware of LabVIEW Sound screws and I used them often. My question is that if I have a line in signal plugged into the microphone port, how can I capture. There is no mic involved, just a line of sinusoidal signal. Thanks for the help,

  • How can I activate my Windows that is out of the 30-day activation period?

    Help! problem with product activation key I had my computer fixed vista windows laptop. but when I went for my military drill two weeks that the 30-day activation window spent so I don't have full access. the only product key I have is on a sticker u