Sine table undeclared in FindMinMax in Sample1.c

I try to work through the tutorial getting started for Labwindows and in Chapter 5, and I like to add

int CVICALLBACK (int, int int event, Sub control panel FindMaxMin

* callbackData, int eventData1, int eventData2)

{

int min_index;

Double min;

int max_index;

Double max;

switch (event)

{

case EVENT_COMMIT:

MaxMin1D (sine, 100, & max, max_index, & min, & min_index);

SetCtrlVal (panelHandle, PANEL_MAX, max);

SetCtrlVal (panelHandle, PANEL_MIN, min);

break;

case EVENT_RIGHT_CLICK:

break;

}

return 0;

}

but the compiler complains

120, 23 identifier undeclared "sine".

The sinus is used internally to the AcquireData function.

How to make accessible to other functions?

What I missed in the instructions in the tutorial?

Thank you

Brad

Brad:

In Chapter 3, section generate a table of data, steps 10 and 11, you added a declaration of an array of 100 elements called sinus to the top of the sample1.c file.  Since it was added to the upper part of the file outside any function, the sinus is a global variable that is accessible by any function.  In step 11, if you have selected to add to block current reporting... instead of select Add statement at the top of the target file, then you would have created a local rather than a global variable variable, so FindMaxMin would not be able to access.

Find your file of sinus see where it is declared, if it is.  If you find inside a function, move it to the top of the file, outside any function, after all #include instructions.  If not, repeat the section Chapter 3 generate a table of data.

Tags: NI Software

Similar Questions

  • Switch between triggered and untriggered AO: must clear the task each time?

    Hello

    I use August to produce a range of sine values sent several times to help to allow regeneration, with samples finished, that is launched by a trigger. Call it a group.

    One trial involves hundreds of groups. But there are gaps between them where other devices do things. In this gap, I also change the values of the sine table and then restart (awaiting release). I would use just the task Stop and Start Task live for it.

    The complication is that I want the area of OCCUPANCY to a specific value in the gap between the groups, which might not be the last value in the array. I want a way to say: once you have completed the task, do the AO to X sit until you press the trigger to start next. Since I'm on regeneration, I can't just set on the end of the matrix of normal results.

    Is there a way to do this without erasing the task is triggered, creation of a new task untriggered, set the value of the then delete again, creating a new task triggered, ect., hundreds of times she's going around the loop?

    Thank you

    Isaac

    In case anyone else wants to try something similar, you can't actually transition between two tasks, with the same (lines) means using VI DAQmx stop task simply because resources are always reserved.

    Instead, I replaced the task to stop the VI DAQmx control task with action defined as "Cancel". Can I cancel a task, and then start another and so come and go without the need to erase or create tasks every time (the same idea could be used for any number of tasks in the same sense, if I only have two).

    I tested by meassuring the analog output and it seems to work, no error is reported in the code.

  • Problem with Simulink model dll running on target RT

    Hello!

    At the beginning I specify software and hardware that I use:

    LabVIEW 8.5

    Simulation Interface Toolkit 4.0.0

    Microsoft Visual C++ 6.0

    MATLAB 7.4.0 (R2007a)

    NEITHER cRIO-9014

    At first, I did a simple Simulink model (Sine generator, gain and an outdoor sink), then I started with vi empty and abandoned command digital for the gain and the waveform for the sine table. I grabbed SIT Connection Manager and that you have chosen Simulation Environment case. Then I loaded a template file, the mapped controls and indicators. Everything worked like a charm. Problems started when I tried to turn on an RT target. Maybe I'll explain step by step what I did and after the error at the end.

    1. I created a dll from a MATLAB simulink model file. I selected in time real workshop one C language and target to "nidll.tlc". The I compiled without error.

    2. I entered LabVIEW SIT Connection Manager and changed the host execution target in real time. File browser has popped up and I selected the dll already made my template file.

    3. in Add target devices on window, I chose 'existing or peripheral target' and I chose in the other menu in time real CompactRIO. There was my compactrio system, I chose it and LabVIEW began to search for devices.

    4. after that, I clicked the "Ok" button in the SIT connection manager.

    5. I clicked the run button before my vi file panel and LabVIEW began deployment.

    And here the deployment failed with the following error message:

    Deployment of 192.168.1.2 (parameters target successfully deployed)
    Deployment compatOpenFileOperation.vi (5.35 K)
    Deployment of SIT copies values from Replay on Inports.vi (10,96 K)
    Deployment of SIT expand newspapers Signal Names.vi (4.99 K)
    Deployment of SIT PostOutputs.vi
    Could not download SIT PostOutputs.vi
    LabVIEW: Unable to load the shared library SITs.outostOutputs:E on the target RT device.

    I tried to do everything once again and got a little different error message:

    Deployment of 192.168.1.2 (parameters target successfully deployed)
    Deployment of common access to specific Path.vi (22.25 K) path
    Deployment of SIT runtime DLL query.vi
    Could not download SIT runtime DLL query.vi
    LabVIEW: Unable to load the shared library SITs.out:TaskRunTimeInfo:E on the device target RT.

    What I am doing wrong? Any ideas? I will be extremely grateful for the ideas!

    Best regards

    Pawel

    SIT 4.0 does not support VxWorks targets as your cRIO. SIT 5.0 was the first version to have any level of support for this.

    I would recommend contacting support to discuss a possible workaround solution. If they have questions, you can reference this post on the forum and they can contact me. I hope this helps.

  • How to generate a sine wave of table of values?

    I have an array of points (values) around 1000. I want to draw them in different types of waveforms - triangle, sine, cosine, etc..

    How ca I do that? For the waveform of triangle, I was able to split my table into 2 halves equal and draw the first half and the separately half second to generate a waveform of the triangle. But how to sine, cosine, Sawtooth etc.? It is a matter of urgency. Prompt response will be appreciated. Thank you

    Hello

    The VI in math palette is a polymorphic, it accepts the input also array.

    attached a VI for your reference.

    VI generates 1000 randon numbers and trace the sine and cosine wave.

  • Is not Table-level logging a sine qua non for replication?

    GG version 11.2.1.0.3
    RDBMS Version: 11.2.0.3 (Source and target are the 11.2.0.3 version)
    OS: RHEL 5.4


    After the first load using expdp, experimental using GoldenGate we are replicating the LMD of 5 tables (Uni-directonal) from the source to the target.

    DB level additional logging is enabled in the source.
    SQL> select SUPPLEMENTAL_LOG_DATA_MIN from v_$database;
    
    SUPPLEME
    --------
    YES
    We have not activated level table for these tables using the ADD TRANDATA command as
    GGSCI > add trandata SCOTT.EMP
    He checked by running
    GGSCI (cbrdf2) 2> info trandata SCOTT.*
    
    
    Logging of supplemental redo log data is disabled for table SCOTT.EMP.
    
    Logging of supplemental redo log data is disabled for table SCOTT.XXX.
    
    .
    .
    But replication works without any problem. Then, is not table-level logging a sine qua non for replication?

    Only one of the logging method above is sufficient?

    Database-level logging is minimal logging necessary to capture updates to PK columns. For your INSERTIONS and deletions will get replicated, even if at the level of the array logging is not enabled.
    However, updates of non-PK columns will not be get replicated if the level table record is not enabled.

  • How to display different sine waves in a table and do a fft of these and display them in a chart?

    How can I cannect my mathscript output SIgnal of VI entry spectral measures. I have a problem since the release of the mathscript "D" file is 2D DBL. I don't know how to convert such data in order to be logged at the entrance of the signal of the VI of spectral measures. I also want that the waveform graph connected to the output of the VI measures spectral, display the FFT of three sine waves in a chart.

    Do not connect. Just go to Forloop.

  • Make a right click table

    Hello

    I am trying to set up a "right-click menu" on a table with menu items associated with the cell (or at least the line) where the right click was hit.

    For example, two of the menu items will be 'Add a new line after' and 'add new line before '.

    For this reason, I have to get the cell (or at least the line) x and are position numbers where the click is affirmed. I tried to change the example that can be found here: http://sine.ni.com/apps/we/niepd_web_display.display_epd4?p_guid=B45EACE3E8FF56A4E034080020E74861&p _...

    without success. It works very well with the left click, but not with the law.

    Please also note that I got how to hide the built in menu items right associated with a control table and how to insert mines with the respective functions. What Miss me is just how retrieve the cell coordinates in the table after a right click on it.

    Thanks a lot for your suggestions.

    Marco

    Ah, I see!

    Well, the ID to pass to RunPopupMenu is the combination of the prefix constant bar menu and the name of constant menu highlighted in the editor Panel:

    So in this case you pass Menu_smp the function to programmatically display the menu.

    I'm not laughing because I had some problems to identify the correct id to use when I started to use this feature.

    Greetings

  • the table control

    Buenos dias,

    Estoy utilizando datos event Structure en UN para put a control array. In the case of the mouse towards the low selecciono fila in the that wants to start a write y borro los datos can fila to esa en haber, despues voy introduciendo data in case key down? y convirtiendolos uppercase. Paso una fila a otra mediante the tecla return.

    En problema esta en una vez escrita TR the table return a revisar los datos, fila seleccionada con el raton is borra como debe hacer. Pasar al has the following fila don't return con los datos than habia is only became pero al write again no be borran y me appears los antiguos mas los nuevos datos.

    How puedo hacer what borren los datos al volver a write sin tener as suprimir each of characters?

    A greeting

    Hello

    I can solve my problem using Listbox.

    Here is an example of how you can do.

    Thanks for the help

  • Calculate the maximum value of the sub-table when creating using a structure of case and records the shift

    I have two 1 d arrays that contain cyclical information (a bit like a sine wave).  One that contains information about the position in degrees and another that contains the couple.  I would like to calculate the value of maximum torque whenever the station is within a certain range (for example, 30 to 80 degrees).  The beaches are repeated - that is why it is cyclical.   I use the function "in the range", a structure of the case and the shift records to build a new table with the values that are included in the beach I said - that was easy part (see attached VI).  I'm struggling with a way to calculate a maximum value for each sub-table formed when the values are 'in range '.   Your help is very appreciated.

    vt92 solution worked!  I agree that there should be a simpler solution, but your to works fine.  Thank you very much.

  • How to convert a 1 d string in a table?

    The string is in binary format and I want to convert it to a table so I can convert it to a digital waveform any... but using the string to byte array vi is not possible since it is in 1-d and destination is sink. How can I fix it? Thank you!

    Hi mother,.

    is there a specific reason to use MathScript to create a sine wave and convert it into a waveform "digitized"?

    Why not use simple functions of Signal Processing functions palette?

    To answer your question:

  • How to build a table of TDMS file open

    Hello

    Examples NI TDMS - Express write data .vi (time domain), I can build a PDM file with 2 channels (sine and square waveforms) data, which are stored as test.tdms.

    Using Express read .vi data (time domain), 2 channels of waveform data are read. How to build a table later? How to separate the 2 channels of data in the tables 1-2 and manipulate the data using table functions?

    For example,.

    I want to collect 100 from index100 between channel 0 and their average. I want to take 50 samples from the channel 50 1 index and double each element.

    Thank you for your help.

    Bing@NCL

    Hey Bing.

    You can perform operations on different channels in the 2D table using the table to index. This will allow you to choose the channel to operate on, then you can perform the operation inside a loop on each element. In the included code snippet, I used a shift register to find the total cumulative values in channel 0 and then divided by the number of samples.

    I recommend you read some tutorials LabVIEW and bases of knowledge on topics that are related to yours. These could help a lot.

    I hope that my suggestions help,

    Chris

  • storage of output in a table problem

    Hello

    I am trying to store the analog data in a table and then save it as a csv file. But for some reason, I get only 1 value in my saved file. Please look at attached picture of the block diagram. I can't move all save loop as process (0.05 seconds) writing slows the rate of acquisition of file block. I'm trying to store all the values output from a large table and at the end to save all values in a single file. But the table seems to be adding

    Sine

    Sorry, but I didn't look carefully at what you were doing. You still need a registry change so that a new result will be added to a previous result.

  • Table 3646 power supply problem

    Hello

    I can't get power table 3646A to update the voltage continuously with output trigger toggle, I looked at the Vi provided by this site but, the program works as a time control. My goal is to hang the PS with a PID loop at a temperature controlled heating, so I need to vary the tension of a sensor-based and updated updated according to the needs. Is there a way to bypass the output to toggle control or is it a separate labview program that can change settings on the fly rather than the start and stop.

    http://sine.NI.com/apps/UTF8/niid_web_display.download_page?p_id_guid=A40AB1DAFDB64F6CE0440021287E6A...

    Thank you very much!!

    The reason that he died, it is that you tell it to do.  Look at what your program does: it initializes the power.  Initialization sends a command 82 h with the data value 02. This sets the power to command with the output OFF remotely! Then activate you the output.  Then, you set the voltage to the desired value.  Immediately after, the while loop iterates and the power comes back again.

    1. do not place a while loop to run forever.  Do not use the button abandon in the toolbar to stop your VI.  It's an escape for use during development hatch, where a program does not run correctly.  Put a stop button on your façade and also use stop the loop.

    2. do not use seqeuence structures if not necessary.  Your program will work exactly in the same without it.  LabVIEW uses data streams to determine which part of the program will then run.

    3. you should learn about state machines.  They give you a lot of flexibility to do this kind of things you are trying to do.

    4. until you learned how to use a state machine, move the initialization and activate spuuly screws outside the loop.  They should only run once.  Put configure VI it inside the loop.  Also put a wait function (ms) inside the loop.  The loop doesn't have to try to run hundreds or thousands of times per second.  (A better approach would be to use a structure of the event and send new data to power thepwer when the value of the voltage level is changed).

    5. once the set loop a Power Supply VI activate with defined entry to disable the output, followed by a close VI.  This is similar to the sample program.

    Lynn

  • Intertwining of the tables on FPGA

    Hello

    I am trying to interleave 1 3 tables for writing a FIFO DMA on an FPGA, but I can't make it work properly. When I try 2 1 tables it of ok, but with 3 elements are not properly interlaced and the result is that all 1 3 bays are mixed up.

    I tried to use the interleave with 3 entrances and gives the mixed result, and I also tried to striping and striping 2 tables then the 3rd in this table. It works better that at least I get 2 tables properly interlaced, but the 3rd one is missing. For the test I used 3 sine waves each of a different magnitude, but the same frequency, using the input function 3 the result is a sine wave in a sine wave. 2, interlacing and then the 3rd in this table are reflected in three waveforms good but table 2 and 3 are identical.

    According to the help, it is possible to use the interleave on an FPGA at the entrance and the results are tables 1 d, which combines 3 1 the tables should be, I think...?

    I tested the service in a standard vi and it worked fine so the question is of course to the fact it's on an FPGA, but this is because of the FIFO, the function interleave or something else?

    The material is a 7856R if that makes a difference.

    See you soon,.

    Darren.


  • Table of 600 elementos

    Hola a todos,

    Tengo una duda that he dedicated mucho tiempo sin dar con the respond. OS dejo por if someone can lanzxarme UN cabo.

    Debo fill an array of 600 trade para luego sacar determinadas features and statistics. Dado is 600 values he defined por un array from UN bucle building is for. Esto works if values than tomo estan DENTRO del bucle for (example 1). Well, mi caso (ejemplo2), los datos provienen una Comunicación series y mi bucle FOR table con el cumplimenta el primer valor that entered el bucle for. In other words, al final genero 600 UN valor unico tables.

    Where el fallo tengo? Using Shift Register pero HE pensado en is seisciento... values is debe haber otra respond.

    GRACIAS PHOTOS


Maybe you are looking for

  • 16.0.2 does not correctly load due to the AVG script error

    I upgraded 16.0.2 about half an hour ago (had no internet access for 3 weeks, so end update of Firefox) and found I get a script error: "a script on this page error is busy..." Chrome://AVG/content/js:532'). I guess that this refers to the installati

  • Upgrade RAM Equium L20-264

    Hi all I want to upgrade my memory to portable computers, do you know what ram is suitable for it and where can I buy it? Thx a lot Gabor

  • A60 does not not at optimum

    Hey guys,. When I right click on my computer, it shows that I have a processor 3.06GHz with 512 MB RAM DDR... but he also says that the processor is clocked to only 1.84 GHz and is only 448 MB of RAM is used. My friend has the same situation with his

  • "Error code 0x800106ba" when you try to run Windows Defender

    Original title: the defender of my ordenator portably windows have an error 0x800106ba and stop the program. What should I do? The defender of my ordenator portably windows have an error 0x800106ba and stop the program. What should I do?

  • BlackBerry BB Passport

    Big problem with my new BB passport.just got an incoming call and after that the phone is not singing, no vibrations, no ringtones. Phone is not cut and parameters are set to a normal Volume is in place, even tried to set the alarm, but no sound in a