Setting S-curve Values in LabWindows​/CVI

I am using a 7344 motion card in an embedded system without the benefit of MAX, so it is being initialised by adapting the InitialiseFM.c template provided by NI. This works OK until I come to adjusting the S-curve times, but putting different smoothing times into the flex_load_scurve_time function makes no difference at all. Am I missing something? I attach a segment of the initialisation file that calls flex_load_scurve_time. This loads and runs without error but even nonsensical values (as in the attachment) make no difference to the motion behaviour.
Attachments:
initFMsegment.txt ‏1 KB

Attached to this response I am sending you a pseudocode for a simple one axis straight line move with s-curve. I have seen it work on my side without any issues. Please code this afte your initialize routine and let me know if the s-cruve is still not being executed.
In the NI-Motion API, Vector Spaces are numbered starting with 17, or hex 11. Therefore in this pseudocode, when "Vector Space 1 (17)" is referenced, the number in parenthesis is the actual value of the Vector Space Resource.
Information about the NI-Motion functions or VIs can be found in the Software Reference Manual or the VI Online Help.
Reset the position to 0 on all 4 Axes on Board ID 1.
The NI-Motion function that should be used is:
Reset Position
The following code applies to Boar
d ID 1.
Move Constraints
To load the move constraints, set the acceleration to 100000 counts/sec/sec, the deceleration to 100000 counts/sec/sec, the velocity to 10000 counts/sec, and the s-curve time to 32767 sample periods.
The NI-Motion functions that should be used are:
Load Acceleration/Deceleration
Load Velocity
Load S-Curve Time
1D Straight Line Move - "Straight Line Move"
Set the operation mode for axis 1 to Absolute Position mode. Set the target position to 10000 counts/steps. Start motion on the axis.
The NI-Motion functions that should be used are:
Set Operation Mode
Load Target Position
Start Motion
Repeat the following until move is complete on the axis, following error is exceeded, the motor is off, or there is a function error:
Wait 100 ms.
Read Axis Status.
The NI-Motion function that should be used is:
Read Axis Status
Check for function and modal errors on Board ID 1.
The NI-Motion function that should be
used is:
Motion Error Handler

Similar Messages

  • How to set a DMA transfer type for PXIe-6536 in LabWindows/CVI?

    I have a PXI chassis PXIe-1078 with a controller PXIe-8115 running under Windows 7. The digital output board is PXIe-6536.
    I use a function DAQmxSetChanAttribute to set a property DAQmx_DO_DataXferMech to a value DAQmx_Val_DMA, since I want to use a direct memory access data transfer. This wokred well with a PCI-6534 board using the same LabWindows/CVI code before migrating it to the PXIe system.
    Unfortunately, running this code on the PXIe system reports a DAQmx error -200452: "Specified property is not supported by the device or is not applicable to the task".
    The task is created in the following simple way (the board name in MAX is 'Dev1'):
       DAQmxCreateTask ("digTask", &digitalTask);
       DAQmxCreateDOChan (digitalTask, "Dev1/port0:3", "DIG_CHANNELS", DAQmx_Val_ChanForAllLines);
       DAQmxSetChanAttribute (digitalTask, "", DAQmx_DO_DataXferMech, DAQmx_Val_DMA, 15);
    How can I solve this problem? How is it possible to choose between different transfer types?
    Thank you in advance for any hint!

    Hi CavityQED,
    The PCI-6534 is a "Digital I/O" board while the PXIe-6536 is a "High Speed Digital I/O" board, that's why they don't have the same properties.
    By the way you can use DMA transfer with this method :
    http://zone.ni.com/reference/en-XX/help/370520J-01/hsdio/direct_dma/
    Let me know if it helps you.
    Regards.
    Mathieu_T
    Certified LabVIEW Developer
    Certified TestStand Developer
    National Instruments France
    #adMrkt{text-align: center;font-size:11px; font-weight: bold;} #adMrkt a {text-decoration: none;} #adMrkt a:hover{font-size: 9px;} #adMrkt a span{display: none;} #adMrkt a:hover span{display: block;}
    LabVIEW Tour
    Journées Techniques dans 10 villes en France, du 4 au 20 novembre 2014

  • Holding values as default in LabWindows/CVI application

    Hello -
    I am writing a LabWindows/CVI application, which controls an USB Digital I/O Board.  I have set an user interface to a default value.  However, when a user runs the application, he/she may need to change the default value.  How can I hold the value the user entered for the next time the user runs the application?
    Best,
    Matthew

    You better post this in the LabWindows/CVI board instead of the LabVIEW board
    Ton
    Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
    Nederlandse LabVIEW user groep www.lvug.nl
    My LabVIEW Ideas
    LabVIEW, programming like it should be!

  • Entering numeric values with suffixes in Labwindows CVI (e.g 100 kHz instead of 100e3 or 100000 )

    is there any practical way of entering numeric values with suffixes in Labwindows CVI in order to prevent user from struggling with '0' es. 

    In LabVIEW there is another Display Format called "SI Notation" that is exactly what you're looking for.
    Maybe you can add a feature request in CVI Idea Exchange Forum and ask NI to add this Display Format in CVI too.
    Vix
    In claris non fit interpretatio
    Using LV 2013 SP1 on Win 7 64bit
    Using LV 8.2.1 on WinXP SP3
    Using CVI 2012 SP1 on Win 7 64bit, WinXP and WinXP Embedded
    Using CVI 6.0 on Win2k, WinXP and WinXP Embedded

  • Always getting errors when trying to control YOKOGAWA 7651 power supply on Labwindows/CVI

    Hi,
    I'm trying to set the voltage on the YOKOGAWA 7651 power supply through labwindows/cvi. I've set up a numeric slide on my userinterface with callback function "yoko7651dcvolts" and constant name "YOKO7651DCVOLTS".
    I always get this error when I run my program:
    "FATAL RUN-TIME ERROR: "DcSource.c", line 53, col 65, thread id 0x00001F3C: Invalid argument type: found 'pointer to double', expected 'pointer to int'."
    This error points to the third argument of the GetCtrlVal function below. The program/compiler wants me pass the variable "yoko1volts" as integer, but I want to (and should) be able to set voltages as floating numbers.
    Plus, even when I declare "yoko1volts" as integer, it stills doesn't work. All I get is zero, zero, and zero...on the power supply meter everytime I press the numeric slide.
    This is the section of the C code that is problemic:
    int CVICALLBACK yoko7651dcvolts (int panel, int control, int event,
    void *callbackData, int eventData1, int eventData2)
    double yoko1volts;
    switch (event)
    case EVENT_COMMIT:
    GetCtrlVal (yoko76511Panel, YOKO7651_1_YOKO7651DCVOLTS, &yoko1volts); // to read the values entered on the numerical meter on the user interface
    yk7651_set_volts (yoko76511Panel, yoko1volts); // set the entered values as voltage on the instrument
    break;
    return 0;
    This is the related h-file:
    #define YOKO7651_1 4
    #define YOKO7651_1_YOKO7651SWITCH 2 /* control type: binary, callback function: yoko7651switch */
    #define YOKO7651_1_YOKO7651DCVOLTS 3 /* control type: scale, callback function: yoko7651dcvolts */
    Please help, how can I fix this issue?
    All the drivers (including the YOKOGAWA 7651 power supply) are properly installed and mounted. As a matter of fact, I can successfully turn the power supply on and off with the code below:
    int CVICALLBACK yoko7651switch (int panel, int control, int event,
    void *callbackData, int eventData1, int eventData2)
    int yoko7651switchstate;
    switch (event)
    case EVENT_COMMIT:
    GetCtrlVal (yoko76511Panel, YOKO7651_1_YOKO7651SWITCH, &yoko7651switchstate);
    SetCtrlVal (yoko76511Panel, YOKO7651_1_YOKO7651SWITCH, !yoko7651switchstate);
    yk7651_output (yoko76511Panel, !yoko7651switchstate);
    break;
    return 0;
    It's just setting the voltage on the power supply that is very problematic. Any help is appreciated...Thanks.
    Solved!
    Go to Solution.

    I second Al opinion of a disconnection between the UIR and the variable that holds the panel handle.
    As a side note, I noted that the problematic line is reading the value of the controll whose callback is executed:
    #define YOKO7651_1_YOKO7651DCVOLTS 3 /* control type: scale, callback function: yoko7651dcvolts */
    int CVICALLBACK yoko7651dcvolts (int panel, int control, int event,
    void *callbackData, int eventData1, int eventData2)
    double yoko1volts;
    switch (event)
    case EVENT_COMMIT:
    GetCtrlVal (yoko76511Panel, YOKO7651_1_YOKO7651DCVOLTS, &yoko1volts); // to read the values entered on the numerical meter on the user interface
    yk7651_set_volts (yoko76511Panel, yoko1volts); // set the entered values as voltage on the instrument
    break;
    return 0;
    In a situation like this, I would try using GetCtrlVal (panel, control, &yoko1volts); instead, that should get rid of all problems in panel handle / control ID.
    Despite this solution is working, in any case I would deep into the problem as an incorrect panel handle can lead to erratical behaviour in other places of the program.
    Proud to use LW/CVI from 3.1 on.
    My contributions to the Developer Zone Community
    If I have helped you, why not giving me a kudos?

  • Using the SVDEx function in LabWindows​CVI

    Hello,
    I am writing an application in LabWindows CVI to display and analize data that we obtain in an optical experiment.  The data is a matrix where the subsequent rows represent spectra collected a different times. There are about 200 columns and 100 rows in each matrix. I want to use singular value decomposition using the  SVDEx function. I get an error every time i try to execute the code in debugguing mode:
    FATAL RUN-TIME ERROR:    The program has caused a 'General Protection' fault at 0x0342BC16.
    I believe that I am passing the incorrect arrays to SVDEx. I  was wondering if there is any example code available, so I can learn how tro do do this.
    Here is a fragment of the code where I call the function SVDEx:
    //declare the arrays to hold S U V
    double *U,*S,*V;
    int isizeS=Y_DATA_POINTS;
    int i;
    int AnalisisError=0;
    if (X_DATA_POINTS<Y_DATA_POINTS) {isizeS=X_DATA_POINTS;}
    //Allocate arrays
    U=malloc(Y_DATA_POINTS*X_DATA_POINTS*sizeof(double​));
    S=malloc(2*isizeS*sizeof(double));
    V=malloc(Y_DATA_POINTS*X_DATA_POINTS*sizeof(double​));
    AnalisisError = SVDEx (adAbsMap, Y_DATA_POINTS, X_DATA_POINTS, FULL_SIZE, U, S+isizeS, V);
    FATAL RUN-TIME ERROR:   "Visualize_12.c", line 2451, col 17, thread id 0x00000E18:   The program has caused a 'General Protection' fault at 0x0342BC16.
    Any help will be very much appreciated.
    J. Hodak

    Hi,
    Thanks for trying to find an answer. I just realized now where the probem was. My mistake was when i allocated the arrays for holding the matrices. Because i was assking SVDEx to carry out FUL SIZE decomposition I must declare the arrays U and V to be , Y_DATA_POINTS*, Y_DATA_POINTS doubles and X_DATA_POINTS*, X_DATA_POINTS doubles respectively. My code was wrong, I was declaring the sizes to be smaller than necessary and  "Visualize_12.c", line 2451, was the call to SVDEx, and col 17 was pointing t that mistake. It took me a while to realize this because the error message did not exlicitly specify that the size or the array passed was too small. Now it is working well. But I believe that it will help to have an example to get started with this.
    Thanks again,
    Fundadero.

  • Dynamic memory is corrupt (Labwindows/cvi 2010)

    I have a multi threaded application....where I have a buffers allocated ineternally in the threads,,...A user interface is present to abort the therad execution.
    Here is the code in one of the threads (NOTE: status is set by a user button to EXIT the program):
    int EthernetDataStructureThread (void *functionData)
        CmtSetCurrentThreadPriority (2);
        EthernetData GetData={0}, *data=NULL;
        data = &GetData;
        /* Use a buffer to read the data from the queue which is coming from TCP read with fresh data */
        const void *BufferEth;
        int BytesRead=0;
        int BytesWritten=0;
        char ReadErrorMessage[256];
        BOOL bitset = FALSE;
        if ( (BufferEth = (EthernetData*)malloc(EthernetDataSize)) != NULL)
            while ( !status )
                BytesRead = CmtReadTSQData (Queue_TCPRead_EthernetData, BufferEth, EthernetDataSize, TSQ_INFINITE_TIMEOUT, 0);
                memcpy (data, BufferEth, EthernetDataSize);
                /* Empty the queue so that we don't have data in next time. */
                CmtFlushTSQ (Queue_TCPRead_EthernetData, TSQ_FLUSH_ALL, NULL);
                //Pass on the data to the Main thread
                BytesWritten = CmtWriteTSQData (Queue_EthernetData_Main, BufferEth , EthernetDataSize, 1, NULL);
                if ( BytesWritten != EthernetDataSize)
                     free(BufferEth);
                    BufferEth = NULL;
                    exit(0);
                Delay(0.02);
            if (status && !bitset)
                free(BufferEth);
                BufferEth = NULL;
                bitset = TRUE;
        return 0;
    My problem is: free(BuffEth) always says Dynamic Memory is corrupt......When I put a breakpoint and keep seeing the resource tracking window, I can see it getting executed fine as the resource tracking window greys out the memory block....but then suddenly free wants to exceute again...and causes the "dynamic memory is corrupt" error.
    I am using LABWINDOWS /CVI 2010 SP1 in WinXP.
    Please help me ASAP....very much appreciated.
    Regards
    NITIN
    -Nharish

    Thank you for your reply Jackie.
    I am calling Free only once...there is an If condition there.
    See the attched video for my problem...Free frees the memory block (see the greyed out portion in resource tracking window but still the statement controls remains there and free executes again, throwing error).
    Do you  think it is some sort of bug in LABWINDOWS.
    See the attached video.
    -Nharish
    Attachments:
    FreeproblemLabwindows.avi ‏4781 KB

  • Configure PXI-2567 to Trigger on Rising Edge using LabWindows​/CVI

    I need some help configuring the trigger edge for a PXI-2567 using Labwindows/CVI.  I have been able to successfully create and execute a scan list using both the ni-switch and daqmx APIs.  However, currently the PXI-2567 triggers on the falling edge of an input trigger.  I need to configure it to trigger on the rising edge of an input trigger.  Every function I could find in the daqmx API for configuring the trigger edge gave a non-fatal runtime error, and I could find no such functions in the ni-switch API.
    Any help configuring the input trigger edge on the PXI-2567 using Labwindows/CVI would be appreciated.
    Thanks

    Hi JonRice,
    You can configure the scan list to execute on the rising edge of an input trigger.  Here are the Labwindows/CVI and LabVIEW functions you would want to use to retrieve, specify or verify the edge of a digital signal that advances to the next entry in a scan list.
    NI-DAQmx C Property: More >> Advance >> Digital Edge >> Edge
    You can get/set/reset this property using:
    DAQmxGetDigEdgeAdvTrigEdge
    DAQmxSetDigEdgeAdvTrigEdge
    DAQmxResetDigEdgeAdvTrigEdge
    NI-SWITCH C Attribute: NISWITCH_ATTR_TRIGGER_INPUT_POLARITY
    You can get/set/check this attribute using:
    niSwitch_GetAttributeViInt32
    niSwitch_SetAttributeViInt32
    niSwitch_CheckAttributeViInt32
    NI-DAQmx LabVIEW Property: More:Advanceigital Edge:Edge
    DAQmx Trigger Property Node
    Short Name: Adv.DigEdge.Edge
    NI-SWITCH LabVIEW Property: Trigger Input Polarity
    niSwitch Property Node
    Short Name: Trigger Input Polarity
    Hope this helps!  Let me know if you have further questions.
    Chad Erickson
    Switch Product Support Engineer
    NI - USA

  • Drive VXI-MIO-64E-1 in LabWindows/CVI

    I'm integrating a VXI system based NI's VXI-1394 controller in which VXI-MIO-64E-1
    was used. My develop envirenment is LabWindows/CVI 5.01. When I use the MIO
    card to sample a waveform, the only length of the waveform I can sample is
    2048Sa. Then, I insert 2 SIMM with size of 8MB to the MIO card, but it is
    useless.
    How can I configure and use the onboard Mem of VXI-MIO-64E-1? Could you give
    a sample program in CVI?
    Thank you very much!

    Hello Vishnu,
    Unfortunately, the VXI-DAQ cards are no longer supported, but you can find information about using them in the manual.  The VXI-MIO Series User Manual  has details about setting the input range in Chapter 3 on page 3-4.
    Good luck with your application!
    Meghan
    Applications Engineer

  • LabWindows/CVI accessing C# program

    I suppose this is a common problem.
    What I want to achieve is this:
    I want to do my User Interface design in C# WPF, instead of the LabWindows/CVI (*.uir), which is cumbersome and not user-friendly.
    say a simple slider in C# WPF, how can a LabWindows/CVI program able to access and set those variables in C# WPF slider?
    do we need to create some sort of wrapper for it? Is the .NET Library useful for this purpose?
    can we have some demo to test it out?
    thanks.

    Hi,
        I am not too familiar with C# and CVI cooperation but maybe it is better idea to to separate C#UI and CVI code to different project.
        What i mean is.Compile one of them to library(DLL or something in C#) and then use one from other by some well defined API.
        I think this is better idea than mix lot of functions call from two different runtimes(C# and CVI)
        There is sample already shipped/instaled with CVI, some of this is about call .net function from CVI.
        You can also create your own wraper library from CVI menu Tools>Create .Net controler.Check the help file.
    P.S. personaly, i like the CVI UI, and UI editor too.

  • .exe Build from LabWindow/CVI 7.1 run exception under RTE 8.0.1

    Below is the source file  of test1.exe, which was built using LabWindow/CVI 7.1 environment, OS is Windows XP SP3
    Due to some reason(install TestStand, or LabView, or ...), the Runtime  Engine  cvirte.dll, cvirt.dll (exists in c:\windows\system32\ )is 8.0.1
    Executing this file, the GenericMessagePopup() will generate window's exception.  But if executing GenericMessagePopup() before LoadLibrary(), it will be ok.
    By the way, "cp3245mt.dll" is Borland's DLL. If load other DLL, everything is OK.
    Is there any suggestion to solve the conflict between NI and Borland? Thanks!
    // test1.c  sourcefile
    #include <windows.h> 
    #include <userint.h>
    #include <stdio.h>
    main()
    // If execute the below line first. it will be ok.
    //    GenericMessagePopup("Info", "Test","Yes","No",0,0,0,0, 
    //   VAL_GENERIC_POPUP_BTN1,VAL_GENERIC_POPUP_NO_CTRL,VAL_GENERIC_POPUP_BTN2);
       LoadLibrary("cp3245mt.dll"); 
       GenericMessagePopup("Info", "Test","Yes","No",0,0,0,0, VAL_GENERIC_POPUP_BTN1,VAL_GENERIC_POPUP_NO_CTRL,VAL_GENERIC_POPUP_BTN2);

    Did you ever figure this out. I've set classpaths, the APPCPATH variable several
    times with many variations and its not working for me, though the jsp thing is working.

  • Measurment studio will not recognize LabWindows/CVI installation?

    It order for me to use the Driver factory program to make a DLL, the program requires that LabWindows/CVI version 5.0 or greater be installed. Version 5.5 was installed first and Measurment studio does not recognize it. After installing the DAQ software, MAX does recognize both LabWindows/CVI and Measurment studio. Help!
    Steve

    Hi Steve,
    What the IDF does, is
    (1) Look for the installation of CVI in the registry under HKLM/Software/NationalInstruments/CVI/xxx. "xxx" being the version number.
    (2) If there are multiple CVIs on the machine, IDF uses the highest version number of CVI located i.e.if you have
    HKLM/Software/NationalInstruments/CVI/5.0
    and HKLM/Software/NationalInstruments/CVI/5.5 it will pick 5.5.
    (3) IDF will then look up the installDir key under this folder.
    If either of (2) or (3) fails, you get the message you've been seeing.
    So what do you see under that registry location ? Is the registry version folder, or the installDir key missing?
    It is possible that the machine had installed a higher version of CVI , then uninstalled, but the folder a
    nd key is still there, so you have a key with a higher version of CVI, with the installdir key pointing to a "" value, instead of a valid path....
    If things do appear fine in the registry, then please reconfirm the software you have installed, as i under stand it, you have CVI 5.5, then installed MesurementStudio 6.0 ? I can try to then reproduce this.
    I sincerely apologize for all the trouble that you have been having...I hope this makes things little clearer and hopefully we can get you started soon..
    With regards to the other thread that you pointed to , it's possible that the evaluation CD did not install all the registry keys or installed them to a different location, or the user, did not install CVI at all...
    Best Regards,
    Nandan
    Nandan Dharwadker
    Staff Software Engineer
    Measurement Studio Hardware Team

  • Trying to use a Microsoft C/C++ Header in LabWindows/CVI, will not work?

    Is there a way to get Microsoft based Header(s) files to compile in LabWIndows/CVI.  It appears that LabWindows/CVI does not like the words "BOOLEAN" or "HANDLE" in the header file for an example?
    Is there a switch that I need to set in LabWindows ENVR to accept this MS C/C++ Header files?

    Please see "Will Microsoft C/C++ Header file(s) work in LabWindows/CVI?" thread in the LabWindows/CVI forum.
    Best Regards,
    Software Engineer
    Jett R

  • Windows XP supports Labwindows/CVI Test Executive 2.01?

    Is Windows XP supports Labwindows/CVI Test Executive 2.01? If no, any patch SW available to make work it on Win XP?

    We have run cvi Test executive on Win 2000 and XP  we used CVI 7 to build the exe.
    not sure if an existing exe  compiled for an earlier version of  windows will work.
    Note  with the later versions of OS come  multiprocessor support we have had some issues with programs written for single processor operating systems crashing after a few hours when running on a multiprocessor system. This was fixed by setting the processor affinity  to restrict the application to a single processor  ( under task manager go to process  right click and select set affinity then only tick one of the processors.) 
    Colin

  • Is LabWindows/CVI suitable to me more than Labview?

    I know some of the LabVIEW gurus might have some insightful words to share on this thread (formerly posted on the CVI forum).
    Is LabWindows/CVI suitable to me more than Labview?
    Wendyk

    There were some excellent response there. I would, however, like to make a few addtional comments.
    First, LabVIEW is a compiler. The "source" code is compiled when the run button on the toolbar is pressed. The creation of an exe is done with the application builder that has been available for much longer than version 6. But, since the development environment is also a compiler, you will not see a signicificant improvement in execution speed when building an exe.
    I originally started my NI programming with LabWindows v1.0. Back then, despite it's name, it was only available for DOS. I transitioned to LabVIEW when it was released  for Windows 3.0. I had no great difficulties in making the transition. In fact, I had a great deal of fun in learning it and loved being able to "write" a program using only a mouse. Given some time and training, I think any text based programmer can do the same if he or she is willing to do so. Like anything else, there is a learning curve to LabVIEW but I don't think it's as steep as someone first starting to program C++ or VB.
    I still do some occassional LabWindows programming but in my instrument control and DAQ applications, I simply find LabVIEW allows me to get the job done faster. If you have some specific imaging or motion application in mind, look over the tools available for each in LabVIEW and LabWindows and check over in those forums to see what they are using.

Maybe you are looking for