OR PCI-6542: Creation of dynamic waveforms using the HSDIO library

Hello!

I have problems to understand how to create waveforms using the HSDIO library to run on a card PCI-6542. I need to create a program that activates a channel for 12.5 microseconds, waiting for a while (i.e. 100 samples) and activates another channel to 12.5 microseconds.

This program must be used in a Multielement ultrasound system.

Here the example of dynamic generation program that transforms the channels 0-2 on 1024 samples.

/************************************************************************
*
* Example program:
* DynamicGeneration.c
*
* Description:
* Generates a simple model on the specified channel.
*
* Pin connection information:
* None.
*
************************************************************************/

/ * Includes * /.


#include "niHSDIO.h".

/ * Sets * /.
#define WAVEFORM_SIZE 1024

int main (void)
{
ViRsrc deviceID = 'Dev1 ';
ViConstString channelList = "0-2";
ViReal64 sampleClockRate = 50.0e6;
DataWidth ViInt32 = 4;

ViUInt32 waveformDataU32 [WAVEFORM_SIZE];
ViConstString waveformName = "myWfm";
ViInt32 timeout = 10000; / * milliseconds * /.

ViSession vi = VI_NULL;
Error ViStatus = VI_SUCCESS;
Bruno errDesc [1024];
ViInt32 i;

/ * Initialize generation session * /.
checkErr (niHSDIO_InitGenerationSession)
Deviceid, VI_FALSE, VI_FALSE, VI_NULL, &vi));

/ * Assign channels for dynamic generation * /.
checkErr (niHSDIO_AssignDynamicChannels (vi, channelList));

/ * Set up the clock sample parameters * /.
checkErr (niHSDIO_ConfigureSampleClock)
VI, NIHSDIO_VAL_ON_BOARD_CLOCK_STR, sampleClockRate));

/ * Query the data Width attribute * /.
checkErr (niHSDIO_GetAttributeViInt32)
VI, VI_NULL, NIHSDIO_ATTR_DATA_WIDTH, & dataWidth));

/ * Fill the waveform with ramp data * /.
< waveform_size;="">
{
waveformDataU32 [i] = i;
}

checkErr (niHSDIO_WriteNamedWaveformU32)
VI, waveformName, WAVEFORM_SIZE, waveformDataU32));

/ * Start the generation * /.
checkErr (niHSDIO_Initiate (vi));

/ * Wait for all the generation * /.
checkErr (niHSDIO_WaitUntilDone (vi, timeout));

Error:

If (error is VI_SUCCESS)
{
/ * Print result * /.
printf ("made without error. \n") ;
}
on the other
{
/ * Get the description of the error and print * /.
niHSDIO_GetError (vi, & error, sizeof (errDesc) /sizeof (petitioner), errDesc);

printf ("\nError encountered\n===\n%s\n", errDesc);
}

/ * log * /.
niHSDIO_close (vi);

/ * prompt to go out (for the popup console windows) * /.
to continue...\n");
GetChar ();

error return;
}

Issues related to the:

How can I change the values in waveformDataU32 to create market reports (instead of just always on)?

How to select the channel waveformDataU32 is applied to the?

Thank you!

Zachary Geier

The waveformDataU32 table is an array of 32-bit integers. Each bit corresponds to a line on the device.  On the first clock cycle, this program outputs:

0000 0000 0000 0000 0000 0000 0000 0000

Then it displays the following, changing at each clock Pulse:

0000 0000 0000 0000 0000 0000 0000 0001,

0000 0000 0000 0000 0000 0000 0000 0010,

...

and so on all the way up to 1023:

0000 0000 0000 0000 00000011 1111 1111

In the example that you include at the bottom, you set the least significant bit (LSB) to zero and one, actually only change one line on the output. To change all the lines, you must instead use 4 294 967 295 or 0xFFFFFFFF:

< waveform_size;="">
< 200){="" if="" sample="" number="" is="" less="" than="">
waveformDataU32 [i] = 0; Disable channels 0-2
}
else {}
waveformDataU32 [i] = 4 294 967 295; Otherwise turn on all channels to 800 samples
}
}

Tags: NI Hardware

Similar Questions

  • Using the bookmark Library, I can locate specific bookmarks, but there is no way of knowing which of my cases, it is in. Is it possible to do this?

    Using the bookmark Library, I can locate specific bookmarks, but there is no way of knowing which of my cases, it is in. Is it possible to do this? I have about 15 cases of bookmarks with a total of about 150 bookmarks. The research of the Library bookmark gives good results insofar as find the specific bookmark, but I IN. WANT to KNOW WHO MY RECORDS THE SPECIFIC BOOKMARK IS how can I do this?

    Take a look on these modules:

    https://addons.Mozilla.org/en-us/Firefox/addon/7372/
    https://addons.Mozilla.org/en-us/Firefox/addon/7377/

  • I use the MODBUS library and can receive data, but I can send it very well?

    Hello

    I use the Modbus Library to communicate with a VFD to control a fan. I use the master write and read vi. I can write data to the drive mechanism and get the fan to do what I want. The VFD is supposed to send a package of confirmation after I told him to do something and I can also read its records. When debugging the VI it shows that the problem is that the buffer always reads zero and the VI timesout. If I look at the USB adapter lights to RS 485, I use to interface with the drive mechanism, I see that the flashes of light RX immediately after I send a message. So I should have something in the buffer. Does anyone have any suggestions?

    Aaron

    OK, here's what has happened to those who have this problem. In the series Receive.vi MB The bytes to the Port of property node has been reading 0 even if there was something in the buffer. Executing the program was then stuck in a loop until it expired and never went to read anything of serial port buffer. I didn't spend too much time wondering why that VI has not worked and created my own. Within a period appropriate after writing to the serial port, I used the same bytes to the Port property node and was able to get the exact number of bytes to the stream and then VISA vi the number of bytes to read. I received the message of the right answer and everything seemed good. But of course that NO! Then I experimented with different speeds of writing to the drive mechanism to get the fan to operate at different speeds. I found a small range of speeds where I get no response to the VFD, either in operation or by sending me a response packet. After a while, I found that there is a mistake in the LRC-8 code in the MODBUS library OR. It does not prescribe that the LRC will be a two-character value. So if your LRC is proving to be a single character such as F value (which should be 0F) you get an incomplete MODBUS message. This has been easily corrected in the vi LRC8 saying "number in hexadecimal string" vi to produce output with a minimum width of two. Then everything worked fine. Moral of the story, it's the MODBUS library is awkward.

  • Native extension using the shared library

    Hello

    IAM trying to create an extension which will be used in cordova, well the work of foundations... but what I have to do is add a shared library from another company for my project.

    They have a folder with all the files of all and a .so file, how can I add to my project and use it in the extension?

    Thank you.

    You start with the model BB10-Cordova?

    https://github.com/BlackBerry/WebWorks-community-APIs/tree/master/BB10-Cordova/template

    You should be able to add the library to the project using the Add Library Wizard in project-> generation properties C / C++-> the settings-> the tool parameters

    Note: It is recommended that you back up your project first.

  • Problem using the gesture library

    Hello people, I am new on the platform of the Playbook. I read the source code for the most basic of apps sample available on the internet. I am facing some issues now that I am using the gestures library.

    I get an error saying undefined reference to gestures_set_alloc and swipe_gesture_alloc of the IDE, even if I have included the relevant header (gestures/set.h, gestures/swipe.h) files. After this i went ahead and downloaded the GestureSample from github (https://github.com/blackberry/NDK-Samples/blob/master/GestureSample/main.c) and tried to compile it, but I couldn't.

    Can someone help me understand what I am doing wrong?

    Looks like you don't have the library of action specified in your list of libraries.

    If you download the entire GestureSample on github, it has a configuration of a Makefile project which relies completely.  If you want to fix your current project, look at https://github.com/blackberry/NDK-Samples/blob/master/GestureSample/common.mk and make sure that all equivalent settings in your project are defined.

  • How to extract information from tree logical structure using the PDF Library?

    How to extract information from tree logical structure using the PDF Library?

    Adobe's PDF Library has PDSEdit APIs to extract information of the logical structure of a tagged PDF file.

    But I couldn't find any example code to demonstrate the C API on PDSEdit layer.

    I google search using different keywords, find none.

    I contact datalogics (which gives me the evaluation of adobe PDF library copy), no code sample on APIs PDSEdit yet.

    Everyone knows any code example can demonstrate extract structure logic tree information PDSEdit APIs (in C/C++ or Java)

    from a tagged PDF file? And is there any sample to demonstrate that connects a tagged logical tree contained in the content stream?

    I thank very you much in advance!

    logicaltree

    Did you look at the code snippets in the SDK?  There are a bunch of samples to work with PDSEdit and structure/marking.

  • OEM12c: creation of dynamic group using emcli

    Hello Sir,

    I'm new to OEM12c.

    I know how to create dynamic groups via the graphical console OEM.

    Can someone tell me how to create using EMCLI command line utility?

    I searched on the net but I got information about the creation of simple group by using the command emcli create_group, but not dynamic group.

    I have to do because I got error to call oracle support when creating it through gui.

    so please, help me.

    Thanks in advance.

    Hello

    This is not possible, we do not have this feature.

    But already a request for development totalled for that:

    BUG 17361227 - CREATE a GROUP DYNAMICS IN OEM VIA EMCLI

    Will be considered in the feasibility-based versions of the feature.

    Thank you
    Vincent

  • Assignment of VLAN dynamic by using the WC7520 controller

    Hello

    I use a few AP WNDAP360 for awhile and consider adding a WC7520 controller.

    However, I would use an assignment VLAN dynamic using a RADIUS server.

    Whereas it is possible with the 360 in stand-alone mode, it is clear to me if this can be done by using the WC7520 controller.

    The (obsolete?) reference manual said not a Word to this topic...

    Is there someone to share experiences with the 7520 and this type of configuration?

    Hello

    Thanks for your help!

    After reading the articles you suggested, I was still unable to find a definitive answer, so I asked pre-sales support and quickly received the following response from Tech Support level 2:

    There was a feature request to ask to implement, but it looks like it will not be implemented for the WC7520. Also, there is a feature request for the WC7600 which looks more promising, but still not possible currently and is not guaranteed to be implemented.

    In short: no, it is not possible, will not be on the WC7520 and could become so on the WC7600.

    Too bad, and it makes the much less interesting WC7520 for me, but at least it clearly quickly.

  • Display static and dynamic photo using the Structure of the event

    Hello everyone,

    I need to display a static image with an event and then using another event, I need to keep displaying the second photo, while the first is still displayed. Simply speaking, in the attached example, I would like to have the color circle black fixed while I dynamically change the red circle.

    My attempt is shown in the attached VI with the first approach using the shift register and the second using the property node (value). Both do not work. Does not erase the previous red circle, or the black circle also gets deleted.

    I'd appreciate any help in this regard.

    Thank you

    From what I see here, you must have two shift registers, one for each circle you try to draw.  You just update those who need update inside the corresponding event.  Use then Cancatinate string to combine the two images.

    Other things to note:

    Put the terminals of your controls in their case of discipline.  This ensures that you are using the most recent data instead of the outdated data.

    The Stop button event take the changed value.  Yet once, put the terminal inside the event.  This will allow the latch to work its magic.

    Them would like to see photo subVIs RADIUS be I16 instead of DBL.  I recommend that you change your cursors to use representation I16.

  • Creation of XML report using the PL/SQL stored procedure

    Hi friends,

    I'm working on a report xml with the xml source as a PL/SQL stored procedure.

    I mean the fiscal year indicated in the following link to understand the process:

    http://orclapp.blogspot.com/2012/02/developing-xml-publisher-report-using.html

    In the example shown in the link above, I did not understand the following:

    (1) in the following procedure, setting out "retcode" is not used at all.

    What is the importance of this parameter.

    REPORT PROCEDURE (errbuf OUT VARCHAR2, retcode OUT VARCHAR2, p_product_id in NUMBERS)

    (2) after the xml data are prepared and updates 'l_result' variable Clob, what follows

    Loop is executed. I am not able to understand why the following loop is required.

    LOOP

    EXIT WHEN l_length = l_retrieved;

    IF (l_length - l_retrieved) < 32000

    THEN

    SELECT SUBSTR (l_result, l_retrieved + 1) IN l_xmlstr FROM DUAL;

    l_retrieved: = l_length;

    fnd_file.put_line (fnd_file.output, l_xmlstr);

    ON THE OTHER

    SELECT SUBSTR (l_result, l_retrieved + 1, l_offset)

    IN l_xmlstr

    FROM DUAL;

    l_retrieved: = l_retrieved + l_offset.

    fnd_file.put_line (fnd_file.output, l_xmlstr);

    END IF;

    END LOOP;

    (3) in the example it is not explained how the concurrent program gets the xml data?

    I guess that it is written to a file by using the following line of code:

    fnd_file.put_line (fnd_file.output, l_xmlstr);

    I would be grateful if someone can shed some light in my questions above so that I can well understand the process.

    Thanks and greetings

    Hawker

    Hi 32000 in the code is a 'safe' than 32767 available max mesh, loops is intended to get around the entire thing into pieces that can be managed within the limits of the data type.

    BTW; If you are in the following Oracle e-business, you can also use the Oracle reports very simply to create the XML output.

    If you have reports developer all you need to do is put raw sql (create XML without any "Fireworks") in the SQL report and then set reporting in XML format in the definition of program in Oracle e-business.

    Best regards

    Robert.

  • Cannot deform stuck HAVE dynamic object using the free transform vector in PS CS6

    Hello

    I stuck a vector object in PS CS6 (13.0.1 x 32) today directly from Illustrator CS6 (16.0.1 x 32) and select 'Paste as smart object' (Windows XP Pro SP3).

    I then tried to distort the object glued using the free transform tool by dragging one of the handles to angle with hold CTRL (Windows).

    General warps\distorts the object, but instead, it launched an operation to bias .

    If I paste as Pixels or shape layer and then apply free Transform, < Ctrl + corner handle slide > performs a warp\distort operation.

    Also, if I have rasterized glued it opposed and then convert them to a smart object, I can warp\distort.

    Is it not possible to paste a vector Illustrator in as a smart object, then warp\distort directly using this technique?

    Thanks for your help.

    Richard

    Your right because on a stuck vehicle a smart cannot deform, false or perform perspective transformations.

    One solution would be to right click on the vector smart object layer in the layers panel and

    Choose Convert to smart object.

    It depends on what is your object, you would probably better quality of a pasted shape or path, but then you will not be able to open the object

    back in illustrator from photoshop.

  • Compilation error when you use the NDK library

    Hello

    I am developing an application of cascades that uses a static library NDK to communicate with a bluetooth device. The NDK library compiles without problems, but when I then compile the application stunts I get errors with all bluetooth NDK functions:

    myBB10Lib.a(BluetoothDevice.o): In function `MyBB10Lib::BluetoothDevice::getAddress()':
    \src\Driver/BluetoothDevice.cpp:33: undefined reference to `bt_rdev_get_address'
    
    myBB10Lib.a(BluetoothDevice.o): In function `MyBB10Lib::BluetoothDevice::getName()':
    \src\Driver/BluetoothDevice.cpp:53: undefined reference to `bt_rdev_get_friendly_name'
    
    make[2]: *** [o.le-v7-g/MyCascadesProject] Error 1
    make[1]: *** [debug] Error 2
    make: *** [Device-Debug] Error 2
    

    (I create a static library as it will act as a driver for the bluetooth device in other applications of stunts in the future).

    I have good include (#include ) in the BluetoothDevice .cpp file, but the application of Cascades always gives me this error. It is one of the functions in question:

    /*!
     * Returns the MAC address of the remote device, terminated by a null character (\0).
     */
    char* BluetoothDevice::getAddress() {
    
        // Holder for results
        char address[18];
    
        // Perform the check
        int res = bt_rdev_get_address(mDevice, address);
        if(res != 0) {
    
            //TODO  Query failed, pass up error
        }
    
        return address;
    }
    

    Any suggestions?

    Hello!
    I suspect that the NDK functions can be linked only dynamically. Only the .so files are available.

    Try adding
    LIBS +=-lbtapi
    the file .pro of application using the library.

  • Error to fix permissions if I use the backup library

    I have the library on an external hard drive and I starts the backup on a second external hard drive. When I opened the backup of my library in second external hard drive with a photo, it is reported an error to fix permissions. What can I do to use the backup from my library on the first hard drive failure?

    Is what kind of backup?  A Time Machine backup?  A copy of the library? Photos cannot open the library if it is on a volume of TimeMachine.

    And what type of backup drive?  If you want to open a copy of the photo library on an external drive, it's safer, if the file system is Mac OS extended (journaled) and the drive is mounted locally.

    Turn on the indicator "Ignore ownership on this volume" for the external drive the errors of authorization.

    When you select the drive in the Finder and open the Info Panel to the reader by entering ⌘I it should look like this in the "Général" section and in the section "permissions & ownership «:»»

  • Qosmio G30-163: bad reception TV using the media library

    Very fuzzy TV reception gives my Qosmio G30-163. I use the Saudi Arabia country setting in the media library. I tried to connect to another air outlet that I know my TV works with the classic but that was still fuzzy, so is not the antenna for sure Jack. Any help appreciated.
    Thank you and best regards.

    Have you chosen the right settings to PAL/NTSC?
    Please check this box.

    For the most part these incorrect settings are responsible for bad reception of the TV signal.

    One question;
    Have you tried to update the TV tuner driver? Should do!

  • Deploy and use the shared library in VeriStand for several VCD

    Hello world

    I'm using LabVIEW 2011 SP1 and VeriStand 2011 SP1.

    We have developed many custom features that use a shared code (C++ and LabVIEW code).

    For now, there is a copy of the C++ shared in each custom device dll.

    The problem is when we change the C++ dll and we forget to copy a new one to each custom devices, the oldest one that can be used by each custom devices.

    We would like to do is not to have only a single dll shared in a specific folder.

    My questions are how we can deploy this dll to a specific shared folder in VeriStand?

    Is there a specific folder that we can use to do this?

    Is it possible to deploy using the measurement and Automation Explorer?

    If someone has an idea, you are welcome!

    Best regards

    CFOE

    You can display this question in another forum that I don't think there's anything directly to do with NI VeriStand.

Maybe you are looking for

  • ATV 4 Home sharing not showing upward after 10.11.14 / iTunes 12.3.3

    I don't know which update borked... my home iTunes 12.3.3 or El Cap 10.11.14 sharing capabilities. House share used to work before each update. I've tried everything. Does not appear in iTunes, my ATV4 or one of my iDevices. Sharing used to be an opt

  • string of decimal float

    Hello I am an intern and I have a problem with my system. I send information between a PCB to my computer. I send in my frame, a float to a string format and I would like to do the conversion in LabView to show the correct value. For example, there i

  • Administrator account? Windows 7

    my game (The Witcher) says that I must be administrator to run itI tried to change my username to it but it says there is aready an accountwith this name, but I'm the only user on my laptop BRAND NEWI NEED HELP

  • How to report a bug in Windows Explorer?

    I have a data file that includes unnecessary data!  And I went through it and removed all the unwanted data then saved (in a new file). The original file has 3 700 KB of data (length of each line of text + 2 to allow the carriage return and newline).

  • See user accounts to switch user screen

    I'm the administrator account on my pc.  I created a user account for my kids with parental controls. How it will appear when you make the option "change user"?  All I get is my account and comments.  I deleted from the thinking client who can leave