example of blocking software signal in C++

Hello

I am new to the NC and data acquisition. Just posted this question before http://forums.ni.com/t5/Signal-Conditioning/usb-6211-DAQ-frequency-question/td-p/3202422and discovered that the signal cannot be locked on a hardware level.

Can anyone provide an example in C / C++ to lock a 400 hz signal. I used the example of ContAcq - IntClk.c to read the data of a resolver (Sindh and cosine) and a reference signal. However as the signal moves to the right (in this case) it becomes difficult to determine the position of the resolver.

Thank you in advance.

Kind regards

Gerhard

Looks that I itself can solve another of my posts solitaire here in this forum... sort of...

Well, since I asked for an example of code, I'll give my solution here. This is probably by far not perfect, but it works. Suggestions for improvement are welcome.

	DAQmxErrChk (DAQmxReadAnalogF64 (taskHandle, 1000, 10.0, DAQmx_Val_GroupByChannel, data, 3000, & read, NULL));
If (read > 0) {}
< 2999;="">
{
If (data [loopa] > highestRef)
{
highestRef = data [loopa];
highestPos = loopa;
}
}
References = data [highestPos];
continue = data [highestPos-1999];
cosine = data [highestPos-999];

radians = atan2 (cosine, continue);
angle = radians * (180 / M_PI);

<>
angle += 360;

printf ("D: %f %f Ref: %f refH: %f Pos: %i angle: %f\r", continue, references, highestRef, highestPos, cosine and angle);
fflush (stdout);
}

Tags: NI Software

Similar Questions

  • block wireless signals

    Hi all,

    Is it possible that a WLC or a WCS can block the signal of a network that is not one we have to a subscriber's wireless, for example, an Ad - Hoc between two computers or signal wireless to a building that is next to mine?

    Thanks in advance.

    Cisco has removed the feature due to legal problems. I don't see in the GUI more or the other.

    http://www.Cisco.com/en/us/Tech/tk722/tk809/technologies_white_paper09186a0080722d8c.shtml#conclusion

    "Detection of rogue is not bound by the rules and no legal respect is necessary for its operation. However, rogue containment generally introduced the legal issues that can put the provider in an awkward position if let to operate automatically. »

    I've never used it, but it was an option at one point.

  • How to block your signal? neighbors connect to my computer.

    When I connect I get a message saying that he didn't there was others connected, and sign if I turn off my computer. is there a way to block my signal?

    Carol

    The best way to get away from users (if they are indeed on) is to use a password to log in to the router.

    You may receive an error message or some processes cannot close

  • POPUP BLOCK SOFTWARE

    Im trying to take a course online, but when I try to log in I am told to disable the popup block software. Should I or how can I do that I can do my course?

    If you use Internet Explorer, go to tools > Internet Options > privacy.

    You can completely disable the blocker or 'Settings' button to specify the Web sites you want to the blocker to be turned off.

  • Impossible to use ITV Player since MS last updated: "ad-blocking software.

    Original title: ad-blocking software

    Since my last update of Microsoft, I am unable to use ITV Player because it is "ad-blocking software" on my PC.  I don't see this in my list of programs. Where I would be able to see it and how I remove/disable it?

    try a system restore. or go to Panel, programs and features, see the
    installed updates and sort by date and uninstall the update.
     
    The game, August 26, 2010 07:33:15 + 0000, Steven Bown says:
     
    >
    >
    > Since my last update of Microsoft, I am unable to use ITV Player because there are 'ad-blocking software' on my PC.  I don't see this in my list of programs. Where I would be able to see it and how I remove/disable it?
     

    Barb Bowman

    http://www.digitalmediaphile.com

  • Know how OR example 'select the dialogue signal' its dialog box

    Hi, guys!

    It should be a very simple problem. I was looking for examples OR to learn how to create a dialog box to set the parameters. "Select the signal dialog box" is nice, but I can't understand how it works through code in the block diagram (it seems too easy!). and I copy all the entire schema in an another white vi, may not work (does not display the dialog box)... can someone tell me where is the trick? THX!

    Hello

    I don't know what your question.

    Want to know how a VI is made to work like a dialog box? You said that you have copied the block diagram for a new vi. I guess her you missed on the properties of VI. Try the following:

    1 Select the properties of the VI VI, on the file Menu, go to the window appearance properties in the menu dropdown.

    2. Select "Dialogue" as the appearance option and click on 'Ok '.

    3. save your vi and Run.

    If this is not what you are looking for, please explain once again.

  • UNC path in default export file blocking software

    So I gave it my all to find a solution to change the default location for my first Pro output when exporting. I know how to do it, but by clicking on the name of output to change it blocks to the solution. My guess is that it is because my default is located on my file server.

    This happens in PP and SOUL. And if I run the export to the default location I get an unknown error.

    How can I get this resolved, the software now is pretty useless.

    Pro first, CC, final version, of course, on a machine Windows 10 Enterprice, latest upgrades of course. The material is Lenovo Yoga 12.

    Advice would be much apreciated.

    Unless your storage network is a San, export to a local drive and the displacement of the exported file and then share.

  • update to iTunes blocking software updates

    Execution of mid-2013 MBA with OSX 10.11.6

    iTunes updated a couple of weeks 12.4.3.

    What is happening now is that the same version is "Installation - calculation...". "except that nothing happens. In addition, Security Update 2016 - 001 10.11.6 won´t download as it looks like the update to iTunes blocks other updates.

    Is there a way to stop/cancel/remove the current iTunes update?

    Did you try restarting your Mac?

  • I'm currently stuck using a Web site because it says that my browser is blocking advertising software. Can someone tell me what steps I take to this address?

    The site that I have problems with is itv.com. Currently, I use this site to catch the return of SOAP episodes I have watch. However his now stopped access me to these programs until I have unlock the ad blocking software, so if someone can tell me how to do this I would appreciate it please. Thank you.

    Hi primalb, to see if blocking is caused by one of your extensions, you could try the site Firefox Safe Mode? It is a standard diagnostic tool in order to avoid interference by extensions (and some custom settings). More info: questions to troubleshoot Firefox in Safe Mode.

    You can restart Firefox in Mode safe help

    Help > restart with disabled modules (multimedia readers should still work)

    In the dialog box, click on 'Start mode safe' (not Reset)

    Any difference?

  • (MacBook Pro (15-inch, late 2011, 2.2 GHz Intel Core i7, computer laptop my MacPro started yesterday to enter contimuous dashes or hyphens in any available window (search engines, software, for example.))) MS word .docx) the only way to stop it is to rest

    MacBook Pro (15-inch, late 2011, 2.2 GHz Intel Core i7, 4 GB memory at 1333 MHz, DDR3).  10.11.3 OSX

    Yesterday, the machine started to insert continous dashes/hyphens into any available window (e.g. window search engine, for example open source software, MS Word, docx). Is the only way to stop this as soon as it starts to reboot, that usually stop at least temporarily.  As soon as he starts this, I tried to close all the applications open without effect.

    -Try to reset memory NVRAM/PRAM and SMC

    MacIntel: Reset of the controller (SMC) system management

    Subject of memory NVRAM and PRAM

    -Try to start safe mode

    OS x: what is Safe Boot, Safe Mode?

    -Start to recovery and repair the startup disk

    OS X: on OS X Recovery - Apple Support

    If inserting the characters in recovery, which indicates a hardware problem.

    have you spilled something on the Ko?

    If your battery is replaceable by the user take it out and look for a swollen battery

    -If it is repairable reinstall the OSX

    How to reinstall OS X on your Mac - Apple Support

    -If you do not have a backup using disk utility to restore the internal drive to an external drive, so that you can try to recover the data.

    Format the boot disk and then do a fresh install of Mac OS x

    This is the Office Mac Pro forum. I asked that your post be moved to the MacBook Pro laptop forum.

  • Windows has blocked this software because it cannot verify the Publisher

    Original title: error playerPT.cab

    I encounter errors when executing my linksys WVC200 camera, during the installation of Active X, it says that Windows has blocked this software because it cannot verify

    the publication server.

    error PlayerPT.cab and I am using Windows Vista.

    Hello

    Did you do changes on the computer before the show?

    (1) what web browser do you use?

    (2) what applications you are trying to download?

    Follow the steps indicated by the ITknowledge24, from the link as dated February 8, 2010.

    http://answers.Microsoft.com/en-us/Windows/Forum/Windows_7-security/how-to-open-a-program-which-Windows-has-blocked/1c8d6c67-569e-4429-9b1c-b732df626958

    For reference:

    http://answers.Microsoft.com/en-us/Windows/Forum/windows_vista-windows_programs/Windows-blocked-software-because-it-cant-verify/aa248f02-Abe3-4f11-b838-609e7ef1a457

  • Automatic Orientation of blocking signal

    Hello!

    I've developed an application, that is opposable by other applications. At the call of my application, it is launched in a map (at least I guess). Is it possible to block the signal of automatic orientation or lock the screen in portrait mode?

    This is what I tried in QML, and which does not:

    onCreationCompleted: {
          OrientationSupport.supportedDisplayOrientation =
          SupportedDisplayOrientation.DisplayPortrait;
    }
    

    Any help is appreciated!

    Thanks in advance :-)

    in the cards, you have to manage the change of orientation.

  • Cannot access a HID device get code 5 error please let me know how to access a HID device, I need an example of code to access a HID device in windows 7.Thanks.R.M. Kiran

    /*******************************************************
    Simplification of Windows HID

    Alan Ott
    Software signal 11

    22/08/2009

    Copyright 2009, all rights reserved.
     
    The contents of this file can be used by anyone
    for any other reason without conditions and can be
    used as a starting point for your own applications
    that appeal to HIDAPI.
    ********************************************************/

    #include
    #include
    #include
    #include
    #include "hidapi.h".

    The headers needed to sleep.
    #ifdef _WIN32
    #include
    #else
    #include
    #endif

    int main (int argc, char * argv)
    {
    int RES;
    unsigned char buf [256];
    #define MAX_STR 255
    WSTR wchar_t [MAX_STR];
    hid_device * handle;
    int i;

    WIN32 #ifdef
    UNREFERENCED_PARAMETER (ARGC);
    UNREFERENCED_PARAMETER (argv);
    #endif

    struct hid_device_info * devs, * cur_dev;
       
    devs = hid_enumerate (0x0, 0x0);
    printf ("id=%d\tsproduct id = %d\n",devs-> vendor_id provider, devs-> product_id ");
    cur_dev = devs;
    so that {(cur_dev)
    printf ("detecte\n device type: % 04hx %04hx\n path: %s\n Serial_number: %ls", cur_dev-> vendor_id, cur_dev-> cur_dev-> path, product_id, cur_dev-> Serial_number);
    printf ("\n");
    printf ("manufacturer: %ls\n", cur_dev-> manufacturer_string ");
    printf ("product: %ls\n", cur_dev-> product_string ");
    printf ("output: %hx\n", cur_dev-> release_number ");
    printf ("Interface: %d\n", cur_dev-> interface_number);
    printf ("\n");
    cur_dev = cur_dev-> next;
    }
    hid_free_enumeration (devs);

    To implement the command buffer.
    Memset (buf, 0x00, sizeof (BUF));
    buf [0] = 0x01;
    buf [1] = 0x81;

    Open the unit by using the VID, PID,
    and possibly the serial number.
    handle = hid_open (0x4d8, 0x3f, L "12345");
    handle = hid_open (0 x 0461, 0x4d81, NULL);
    If (! handle) {}
    printf ("cannot open device\n");
    Return 1;
    }

    Read the manufacturer string
    WSTR [0] = 0x0000;
    RES = hid_get_manufacturer_string (handle, wstr, MAX_STR);
    If (res<>
    printf ("could not read the manufacturer string\n");
    printf ("string of the manufacturer: %ls\n", wstr ");

    Read the product chain
    WSTR [0] = 0x0000;
    RES = hid_get_product_string (handle, wstr, MAX_STR);
    If (res<>
    printf ("cannot read string\n product");
    printf ("string of product: %ls\n", wstr ");

    Read the serial number string
    WSTR [0] = 0x0000;
    RES = hid_get_serial_number_string (handle, wstr, MAX_STR);
    If (res<>
    printf ("could not read the serial number string\n");
    printf ("string of serial number: (%d) %ls', wstr [0], wstr");
    printf ("\n");

    Read the indexed string 1
    WSTR [0] = 0x0000;
    RES = hid_get_indexed_string (handle, 1, wstr, MAX_STR);
    If (res<>
    printf ("could not read the string indexed 1\n");
    printf ("indexed 1 string: %ls\n", wstr);

    Define the function hid_read() as non-blocking.
    hid_set_nonblocking (handle, 1);
       
    Try reading from the device. It is and must be without
    given here, but enforcement should not block.
    RES = hid_read (handle, buf, 17);

    Send a report on the device
    buf [0] = 0x2;
    buf [1] = 0xa0;
    buf [2] = 0x0a;
    buf [3] = 0x00;
    buf [4] = 0x00;
    RES = hid_send_feature_report (handle, buf, 17);
    If (res< 0)="">
    printf ("cannot send a feature report. \n") ;
    }

    Memset (buf, 0, sizeof (BUF));

    Read a report of the device
    buf [0] = 0x2;
    RES = hid_get_feature_report (handle, buf, sizeof (buf));
    If (res< 0)="">
    printf ("failed to get a feature report. \n") ;
    printf ("%ls", hid_error (handle));
    }
    else {}
    Print the buffer returned.
    printf ("function Report\n");
    for (i = 0; i< res;="">
    printf ("% 02hhx", buf [i]);
    printf ("\n");
    }

    Memset (buf, 0, sizeof (BUF));

    LED toggle (cmd 0x80). The first byte is the report number (0 x 1).
    buf [0] = 0x1;
    buf [1] = 0x80;
    RES = hid_write (handle, buf, 17);
    If (res< 0)="">
    printf ("could not write () \n");
    printf ("error: %ls\n", hid_error (handle));
    }

    Status request (cmd 0x81). The first byte is the report number (0 x 1).
    buf [0] = 0x1;
    buf [1] = 0x81;
    hid_write (handle, buf, 17);
    If (res<>
    printf ("impossible to write() (2) \n" ");

    Read the requested State. hid_read() has been set to be
    non-blocking by the call to hid_set_nonblocking() above.
    This loop shows the non-blocking of hid_read() nature.
    Res = 0;
    While (res == 0) {}
    RES = hid_read (handle, buf, sizeof (buf));
    If (res == 0)
    printf("waiting...\n");
    If (res<>
    printf ("could not read () \n");
    WIN32 #ifdef
    Sleep (500);
    #else
    usleep(500*1000);
    #endif
    }

    printf ("read data: \n");
    Print the buffer returned.
    for (i = 0; i< res;="">
    printf ("% 02hhx", buf [i]);
    printf ("\n");

    hid_close (handle);

    / * Free of static objects of HIDAPI. */
    hid_exit();

    WIN32 #ifdef
    System ("pause");
    #endif

    return 0;
    }

    Hi KIRAN RM,.

    Given that you need example code to access a HID device in windows 7, the question you have posted is better suited for the MSDN Forums. Please post your query in the link next to the support of the MSDN forum for further assistance.

    Windows hardware development

  • Size of the queue for Signal form write XNET

    Hello

    I am using the XNET library to play a preset on an output signal waveform. I work with LabVIEW 2014 SP1, 14.5 XNET on a W7 Pro 32-bit operating system. I use an NI PCI-8512 map. This is my first app using the xnet library.

    In my test application, I give the user the ability to set the waveform to play. The total duration and the sampling frequency can be set. The output MAY report is cyclical, with a cycle time of 0.01 s (10 Hz). I chose to use the same frequency for example my wave form and writing of the CAN.

    I have difficulty working with the size of the queue. In this example, it's good but I did not really why. I tested different values in the size of the queue and 100000 seems to be good up to 60 seconds. But for the longest (about 5 minutes), this method is not good...

    What is the right way to work in this mode and how use efficiently the property size queue? Information and example of using software and hardware OR XNET are not very convincing...

    Thank you in advance!

    You can add several items at the end of the queue until the queue is empty.  So if you want to write 10,000 points, and your buffer is only 1000 points, then wait and monitor the number of messages remaining in the buffer, and once it is less than 100 say adds an another 900.

    I used this method for flashing on CAN and LIN.  I needed a way to watch specific at specified times images, and a single point of frame link would not repeat (which could write the same byte twice what would be bad) I could have made the rivers and used avoiding, but a better solution was to use queue and add more pictures at the end of the queue to try to keep it as complete as possible.

  • Purpose of the "Signal Reset" bulk "Simulate Signal"

    Hello

    What purpose of the "Signal Reset" in the block "Simulate Signal".

    I searched, which once activated, it affects the default value, which is 0 in the output of the block "simulate Signal".

    But it seems that the functionality of the 'reset' Signal is different.

    On figure 1 - Schematic of my installation with pushbutton "Reset Generator" below on the left.

    On Fig. 2 and Fig. 3 - the output of the 'Simulate Signal' block and some derivatives of signal with 'Reset Generator" OFF and WE accordingly.

    As you indicate, in the case WE , the output is not 0.

    Thanks in advance for the clarification

    Pavel

    Fig. 1

    Fig. 2

    Fig. 3

    The reset is used to "reset" the phase of the signal to its default value when the value 'True '.  If you leave the value of "reset" to "false" and you run the Simulator signal in a loop, you will get a contineous waveform, even when your signal Simulator does not generate a whole number of cycle (combination of signal frequency, sampling frequency and number of samples).  If you set the "reset" to "true" the waveform will be interrupted (the stage will be set to its default value in each iteration).

    Here is an example:

    "RESET" = FALSE, see chart below:

    'RESET' = TRUE, see the chart below:

Maybe you are looking for