Structures containing the array of unspecified size...

Never seen it in any C compiler, I had the following code:

#define NAICHAN     7
#define NAOCHAN     4
#define NPID        NAOCHAN

typedef struct _AppData  AppData;
typedef struct _PidData  PidData;
typedef struct _AiChData AiChData;
typedef struct _AoChData AoChData;

struct _AppData {
    int thr_id_plot;
    int thr_id_log;
    int thr_id_pid[NPID];
    int thr_id_timer;
    FILE *log;
    AiChData ai_chans[NAICHAN];
    AoChData ao_chans[NAOCHAN];
    PidData pid[NPID];
};

and for some reason any when I try to compile I get the following error (last line is the line 57)

Hi coanda,.

I don't know if it is a bug in the compiler or an expected behavior but I could solve the problem by reorganizing your code as follows:

I inserted definitions of struct dummy for AiChData, AoChData and PidData.

You can replace them with their correct definitions.

Tags: NI Software

Similar Questions

  • Printing of documents that contain the letter and legal-size pages - Laserjet 600 M602

    We have a printer Laserjet 600 M602, that does not automatically select a tray to print every time someone tries to print a document that contains the letter so many pages of legal size.  The default printer for the Tray 1 (Manual power) and the user will have to walk over to the printer and the printer to select the correct tray.  I went in the printers settings via the web interface and I set the tray settings to the following: Tray 1 - any Type of Size/Any, bin 2 - letter/plain, plateau 3 - legal/Plain and it still does not print correctly.  Unfortunately for the printer settings, it was on that I'm comfortable doing.  I read the print driver may have changed, but we use the driver included with the disc and I guess that it would be sufficient that this driver.  Does anyone know of some setting that I might be able to change the printer or if it is indeed a print driver problem?  Any comments would be appreciated.

    Thank you

    I was able to receive help this morning from HP support.  He turns out, there were two things that I needed to change.  The first is that when printing from a pdf file, there is an option in the print area for "Choose paper according to the size of PDF page source" and the second thing, it was with the printer printing preferences.  In the printing preferences, under the "Printing shortcuts" tab, the paper Type has been set to Prepunched.  We changed this Unspecified.  After making these two changes, the user is able to print correctly in the printer.

  • Get the array of unknown size of the CVI code module

    I'm creating a type custom for my client, and I've encountered a problem that I'm not sure how to solve.

    Here's the situation:

    We have a custom step in which the main code is executed within a step after step. The code acquires samples of an instrument, but it is unclear how many samples will be returned. The CVI function has a table, the size of this table and an output parameter that indicates how many samples have been returned as parameters.

    void AcquireSamples (double* samples, int samplesBufferSize, int *numSamplesRetrieved)
    

    The goal is to have the array returned by the size of the number of samples taken.

    I tried several ways, none of which works completely. The problem is that, as described here, TestStand creates a temporary table to move to the code module. but it does not resize the TestStand array property. So I need to manually resize the properties of the table, and I did not understand an elegant way to do it.

    It would be easy if I had to create just a not, because I could use expressions after. I'm creating a type but I don't have that luxury (my code should allow the customer to enter expressions of post, but I run the risk of my client, removing any expression after default I get home).

    First question:

    I noticed when I was creating a stage with a CVI code module, that additional results allowed me to specify logging in both settings [in] and [out]. This I extrapolated that the parameter expression was evaluated before calling the function both again after the call to the function. I did some tests, and it doesn't seem to work that way.

    (1) this is expected behavior? I don't see it documented anywhere, if can I rely on it remains the same in future versions of TestStand?

    I used this behavior to my advantage to create an expression that does what I need an an step code module. But it does not work for a module of code to a later stage.

    I did a small test DLL file and sequence illustrates my problem. I tried to document the file in sequence to show where I'm stuck. You will need to put the DLL in one of your directories to search for the type of custom work.

    Any help would be greatly appreciated!

    I think the problem is that the C programming language does not provide enough information for a caller to know the size of an output table in any kind of standard. I recommend again, you pass a CAObjHandle which is the variable of array instead and set the table directly using CA_Array1DToSafeArray() to create a safearray and SetValVariant on the propertyobject which is the property of the table to set the table. Don't forget to free the array (using CA_SafeArrayDestroy()) that you created with CA_Array1DToSafeArray after that SetValVariant call to avoid leaks.

    Hope this helps,

    -Doug

  • the associative arrays containing the record type, cannot be used first

    I am having trouble with the declaration of an associative array containing the Types of records and iteration using FIRST and NEXT functions.
    This problem of mine is only appear when I use that types of records, the FIRST and FOLLOWING operators work very well when you use the regular NUMBER.

    Trying to get the first element of the array, I get: ORA-06550: line 22, column 40: PLS 00382: expression is of the wrong type

    See the code snippet below. Anyone know if this can be done in PL/SQL?

    -----------------------------------------------------------------------------------------
    DECLARE


    -Set the record structure that will contain information on a post
    TYPE PostRec IS (RECORD
    post_type VARCHAR2 (4) - maybe DEB/CRED
    );

    lr_charge_back_post PostRec;

    TYPE post_table IS TABLE OF PostRec NOT NULL
    INDEX BY VARCHAR2 (4);

    assoc_posts post_table;

    BEGIN


    -lr_charge_back_post.post_type: = "asd";
    assoc_posts('1').post_type: = '1';

    lr_charge_back_post: = assoc_posts.first;

    END;
    /

    Returns the index, not the file FIRST:

    SQL> declare
      2  TYPE PostRec IS RECORD (
      3  post_type VARCHAR2(4) -- Can be DEB/CRED
      4  );
      5
      6  lr_charge_back_post  varchar2(20);
      7  TYPE post_table IS TABLE OF PostRec NOT NULL
      8  INDEX BY VARCHAR2(4);
      9
     10
     11  assoc_posts post_table;
     12
     13  BEGIN
     14
     15
     16  --lr_charge_back_post.post_type := 'asd';
     17  assoc_posts('1').post_type := '1';
     18
     19  lr_charge_back_post := assoc_posts.first;
     20  dbms_output.put_line('idx='||lr_charge_back_post);
     21  END;
     22  /
    idx=1
    
    PL/SQL procedure successfully completed.
    
    SQL> declare
      2  TYPE PostRec IS RECORD (
      3  post_type VARCHAR2(4) -- Can be DEB/CRED
      4  );
      5
      6  lr_charge_back_post  varchar2(20);
      7  TYPE post_table IS TABLE OF PostRec NOT NULL
      8  INDEX BY VARCHAR2(4);
      9
     10
     11  assoc_posts post_table;
     12
     13  BEGIN
     14
     15
     16  --lr_charge_back_post.post_type := 'asd';
     17  assoc_posts('idx').post_type := '1';
     18  lr_charge_back_post := assoc_posts.first;
     19  dbms_output.put_line('idx='||lr_charge_back_post);
     20  END;
     21  /
    idx=idx
    
    PL/SQL procedure successfully completed.
    

    Max
    http://oracleitalia.WordPress.com

  • Questions about to determine the size of the array of data storage with flexibility

    I try to use the CVI function below to load data from .csv file to the table that I was intending to use later:

    filereturnvalue = FileSelectPopup ("c:\\Users\\Desktop\\FileDirectory", "*.csv", "", 'Select the data file', VAL_LOAD_BUTTON, 0, 0, 1, 0, LoadFilePath);

    FileToArray (DATAArray, VAL_CHAR, LoadFilePath, MaxDataSize, 1, VAL_GROUPS_TOGETHER, VAL_GROUPS_AS_COLUMNS, VAL_ASCII);

    For the data table "predetermined", it is quite straightforward, because the size of the table is already set.  However, I wonder if there is anyway I could use CVI directly import data and determine the size of the array on the fly?  Which means that the user need not know the length of the data, and it could be determined then to import the file.

    Hello

    for ASCII files, you can do so in any first read the file and counting the newline characters, something like:

    int file_handle;
    int index;
    int size = 0;
    char line_buffer [80];

    If (OpenFile (...) > 0)
    {
    While (ReadLine (...) > 0)
    {
    size ++;
    }
    }
    CloseFile(f) (file_handle);

    This way you can determine the number of rows you have, but you must have an idea of how long a line may be, one number per line or 32000 because you must specify the size of your line_buffer.

    In the next step you analyserions monotube for occurrence of your column separator (say a ;) to determine the number of columns (separators found + 1).

  • How to read the size of the array, eliminating empty values

    I have an array of size 2 X 10. In the first column, the elements are 10 and in the second column, the elements are only 6. If I use the size of the array and the size of the second column of the index, the value given is 10 which is supposed to be 6. I noticed that it creates null or empty values in the column for the other four. How can I eliminate empty values, and only get the real sze of the column?

    The column in the index and use search 1 D table for an empty string.  The result should be the number of non-empty strings.  If the result is - 1, use the actual size of table.

  • Difficulty the front Dimension of the array, but allow the user to change the size of the array

    Hello

    I know there are a few other posts on table and scroll bars but mine is a little different. I want to have the physical size of the fixed table control and allow the user to change the size of the array as required and a scroll bar if the number of elements exceeds the specified physical dimension. I wouldn't mind if, at the end of the scroll bar, the user sees an uninitialized element.

    Thank you very much

    Hello

    The problem I have with the property Num Row node is it seems to replace the scroll bar. Whenever I try to change the line number, the table automatically resizes its physical size on the front and the scroll bar has no effect.

    However, I solved the problem by taking row completely digital. I just said if the table size is > to a constant value (i.e. 3), add a scroll bar and my front panel dashboard to be a size larger than what the value of this constant is size. Once I begin to add values in sequential order and I get to the fourth value, the scroll bar is added and the scroll bar has a feature where it adds an element of null for you, so if I fill this null element I just increased the size of the table and another null element appears underneath.

    Thanks for the help

  • Puzzled by changing the size of the array of Bell Curve (or made gaussien)

    I use an instrument which entered a table 1 d signal. When you draw the it, it looks a lot like a Gaussian function (it looks very good too).

    What I want to do is to change the size of the array of this input function (basically I want to increase the size of table).

    For example, when you look at the picture attached, you will see that the size of the curve in the picture on the left, which is the GROSS ENTRY, 70 =.

    What I want to do is to change this size to a number of interest (for example, let's say 80)...

    So basically I want to insert 10 new numbers in the table (in random places), but I want these 10 numbers to fit on the best-fit-the signal line (like you see in the image to the right).

    So I tried to use Gaussian worthy, and cubic spline worthy... etc but none of these features allow me to change the size of the table of the output to adapt.

    Any of them do not give you the equation of the line of best - fit either... so I can't solve Y for a known X.

    It is very important for me to continue my project.

    Thank you very much

    Look at the palette under Interpolation in the math palette.  You can find something that will work for you.  It will not add points on the equation, but should allow you to get more points along your curve.

    Lynn

  • default value for the size of the array

    GDay,

    I have a cluster with some values and an array of Boolean. I use the cluster in different screws, so I recorded it with a typedef.

    I would like to add a required table for my table size 2-dimensional Boolean. How can I afford?

    Thank you very much

    bemvo

    Store default values or using the table to really reshape does not execute the action to force a mandatory array size. You can't really set a size of array binding 'automatically '. A programmer can plop down your typedef on the block diagram and change the number of lines/columns in any way they want, regardless of whether it has default values. This way, your program must check each time the cluster is used. If you choose to generate a mistake is yours, depending on which means that data.

    On a broader note, LVOOP (or similar) can be used for this sort of thing. By example, if you had an accessor function to set the table this accessor function can check that the size of the array.

    You may also be able to do with XControls, but I don't know since I have very little familiarity with the people.

  • Doubling of the size of the array of Boolean 2D

    Hello.

    I have an array of Boolean 2D 20 x 20 and you need to convert that into a Boolean 2D table 40 x 40. If the first element of the array 20 x 20 is a 1, the first two elements of the first and the second line of the table 40 x 40 must be a 1 as well.

    Thanks in advance!

    Or similar to the other thread:

    I made it smaller, but the code remains the same...

  • Array containing the details of the session log

    Hi gurus,

    Is there a table/view that contains the details of the session for applications such as V$ SESSION in the database?

    Nestor

    Please see these documents.

    Script: How to identify the user apps using the PID of the o/s for form users in 11i [ID 185762.1]
    How count the Total number of users connected to ORACLE Application [ID 295206.1]
    How to solve the problem of time-out for forms in the Oracle Applications 11i [ID 269884.1]

    Thank you
    Hussein

  • Passing a unique structure through the functions of customer/ServerTCPRead/write and making sure that all data is transferred

    I use the CVI TCP media kit at my request and I am curious about the following code:

    ClientTCPRead

    char * buffer;
    int messageSize;
    int bytesToRead;
    int
    bytesRead;

    / * Find messageSize and allocate a buffer properly... * /.

    bytesToRead = messageSize;

    While (bytesToRead > 0)

    {

    bytesRead = ClientTCPRead (connection handle,
    (& buffer [messageSize - bytesToRead], bytesToRead, 0);

    bytesToRead = bytesRead;

    }

    OK, this works if you tank elements of the array, but what happens if you pass a structure of arbitrary size?  If you read/write the bytes read or written and that you get all the data that you have asked, what do you do at this point to get the rest of subsequent data?  For example, replace the "buffer" of type char with a structure of a type defined by the user with a size of 100 bytes or something to that extent.  You make a request for read/write and read/wrote less than 100 bytes.  How do you get the rest of the data?  ICB doing something in the background?  I could use this code with several structures, but then again, a particular Member of a structure is not the size of a byte as a tank.

    Much appreciated,

    Chris

    The solution is to use a pointer to char sunk to allocate the data transmitted.  The only problem is that this buffer must be a pointer to the data type of the structure before a tank troop can be used for a successful program compilation. Thank you for your help.

    Chris

  • What is READ the array returned by the DAQmx meter? How can I know the two functions DAQmx READ data stream in the same WHILE loop?

    I have a question about the order of execution.  In the WHILE loop, I have two things to measure, period and tension using the DAQmx READ functions for voltage and the meter.  In the end, I want to collect these data as points almost simultaneously as possible, as a pair and then send them together to another piece of code (not shown here) which them will result in some sort of command for an engine.  It would be run, and then I want to perceive the tension and the period at a time later and do the same thing.

    (1.) I'm a little confused on what the meter of the READ function is back because it's a table.  What is a picture of?  I thought that it was up to the value of the individual periods between rising edges.  The output of the counter 1 DBL d's a table. How many elements in this table, and what determines the size of this table?  Are the elements of the array the individual delays between the edges?  How many values are stored in the array by executing?   We take the AVERAGE of the last 15 items, but do not know if we are throwing some of the data or what.  How to understand the composition of this painting?  How can I change the composition of this painting?  Is it possible to measure only one period at a time, for example the time between TWO edges?

    2.) Will this WHILE loop execute as it gathers tension and a "period table ' (remains to be understood by me) by TIME running in a loop?  In particular, we want that the value of the tension associated with the value of the AVERAGE of the period "array", so we can use two data items to create orders of next control every time that the two values are reported.  The structure for the delivery of vi will be attached data in pairs like this?  I understand that one of the READING functions run not before the other function of READING in the WHILE loop.  I want that the period "means" and "strain (Volt) collected at the same pace. This vi will he?

    Thank you

    Dave

    Hi David,

    I suggest including the DAQmx Start Task function. If it does not start before the loop, it starts the loop and work very well, but it is not as fast and efficient. In the model of task status, task wiill go to run the checked each iteration of the loop and then back the time checked running when it restarts.

    The status of the task model: http://zone.ni.com/reference/en-XX/help/370466V-01/mxcncpts/taskstatemodel/

    Kind regards

    Jason D

    Technical sales engineer

    National Instruments

  • Adding items to an array of unknown size several times

    Hey,.

    I had an application that communicates with a device (a generator of microwave) via the Protocol modbus RS-232. It is within a state machine. The VI running generator initialization first and then move to the State 'pending', where I have a structure of the event to follow any value change of control. In the structure of the event, a timeout of 300 ms is implemented, because communication to the generator must be active at least every second (if not a defect is reported). In the case of timeout I read all record and display values.

    Within this time-out I would record a value of the indicator ('measure Pfwd') several times in a 1 d table (the table size is unknown!). However, I would like for the variable to record only when the indicator 'MW?' is 'TRUE '. And "MW?" goes from 'FALSE' to 'TRUE' every time, I would like to start writing on a table from the beginning.

    I tried several options, including the table to remodel, but I can't make it work. Or it works in a separate VI, but when I use it within the structure of the event and state machine, nothing works.

    If someone has an idea, it would be welcome...

    Thank you

    Concerning

    Create an another shift register which is initialized with an empty array of the correct data type and use the node Build table add data to it when you want that he added.

    In BT, the size of a table doesn't have to be declared in advance.

    Mike...

    PS: other tunnels must be wired throughout.

  • is it possible to display the number of elements in the array before you run?

    Hello

    At runtime, I can use the size of array function to check the number of items in a table. But it is possible to display the size of the array in edit mode (i.e. before turn the vi)? Thank you.

    dragondriver wrote:

    The table contains for some culster complicated. Yes, you are right, to help to see the last item will give an idea. But what I want is that anyway to show an indicator on the Panel before showing the dimension when the user changes the size on the fly.

    You can implement the whole thing (indicator of control and the size of array) as a X-control. They are fully operational in edit mode.

    I still don't quite see what you're trying to do? Why would it matter what happens in edit mode? A finalized VI must always be runnning during use. Use a state machine architecture.

Maybe you are looking for

  • I do not see my addresses in the address book

    Hello I just reinstalled Windows 7 Pro (I had to) and I managed to reinstall Thunderbird, then point it to my existing profile as my email now displays correctly. The problem is that my address book seems to be empty now. I checked and my abook.mab a

  • 5.6.1 pages simultaneous display of mutiple docs

    Sorry new here thought that simple question would be - forgive me I am 100% frustrated. I have several questions- I help people who are mostly terminal for free because they have for the most part too zero dollars and increased stress. I try to write

  • How to convert the Cluster chain

    Here's a VI to convert all the data to a string, and the VI to convert the string to a Variant.  The variant of the data function will convert to your data type.  I use LV 8.2, please rate if this helped you. Thank you. -Branson

  • re1000 Extender while in the hotel... etc.,.

    Hello The re1000 works very well with e4200 in my house. Is it possible to use re1000 only as Expander or wifi reouter on a trip outside. You know some hotels provide internet cable only in your room and some service with wireless but weak signal, my

  • HP Probook 4520 s running extremely slow

    Hello recently my laptop have been slow (almost at a standstill). I suspected at first, it was a virus, but a test of the virus found nothing. So, I formatted my OS partition and installed Windows 7 Professional and that the essential software that I