The streaming of data in c (PXI-5421)

Hello

I do the data streaming in C by PXI-5421 follow this instruction: http://zone.ni.com/reference/en-XX/help/370524R-01/siggenhelp/streaming/

Here's my psudo code:

1 set the amount of memory shipped to use for streaming

waveformSize = 1048576;

short * CurData [16];

checkErr (niFgen_init (resource, VI_TRUE, VI_TRUE, & vi))

checkErr (niFgen_ConfigureChannels (vi, ChannelName)); ChannelName = '0'

checkErr (niFgen_ConfigureOutputMode (vi, NIFGEN_VAL_OUTPUT_ARB));  //Arbitrary mode is used

checkErr (niFgen_ConfigureSampleRate (vi, SampleRate));   Rate of sampling = 40e6;

checkErr (niFgen_AllocateWaveform (vi, ChannelName, waveformSize, & wfmHandle));  Allocate memory for broadcast borad

2. identify the waveform streaming

checkErr (niFgen_SetAttributeViInt32 (ChannelName, NIFGEN_ATTR_STREAMING_WAVEFORM_HANDLE, vi, wfmHandle));

checkErr (niFgen_SetAttributeViReal64 (vi, VI_NULL, NIFGEN_ATTR_STREAMING_WRITE_TIMEOUT, 10.0));  Set TimeOut = 10 s

3. fill the waveform continuous initial data

for (j = 0; j<>
fread (CurData [j], sizeof (short), waveformSize/16, PlayedFile);  Read data from my saved file
checkErr (niFgen_WriteBinary16Waveform (vi, ChannelName, wfmHandle, waveformSize/16, CurData [j]));
}

4 start generating the waveform

checkErr (niFgen_ConfigureOutputEnabled (vi, ChannelName, VI_TRUE));
checkErr (niFgen_InitiateGeneration (vi));

5 write a waveform data block. (Optional) Monitor available memory that generates the waveform

{}
niFgen_GetAttributeViInt32 (vi, '0', NIFGEN_ATTR_STREAMING_SPACE_AVAILABLE_IN_WAVEFORM, & FreeSpace).

{if(FreeSpace>=waveformSize/16)}
fread (renewData, sizeof (short), waveformSize/16, PlayedFile);

checkErr (niFgen_WriteBinary16Waveform (vi, '0', wfmHandle, waveformSize/4, PlayData));
//}
} while (1);

I properly generate first 1048576 points of data. However, I'm stuck in writing new data in my space of memory onboard.

The error message space in continuous waveform has not become available within the specific period, and appears after 10 sec which is my time-out period.

If I check my available space via the property NIFGEN_ATTR_STREAMING_SPACE_AVAILABLE_IN_WAVEFORM, it never increases.  Did I miss something? Can I work in arbitrary mode for data streaming?

Any suggestion is appreciated. Thank you!

Looking at the example LabVIEW/CVI, it seems that you are on the right track.

If you remove the Do / While loop, do you still 1114112 samples? In other words, samples of 1048576 (1048576/16)?

What is the value returned by ' niFgen_GetAttributeViInt32 (vi, '0', NIFGEN_ATTR_STREAMING_SPACE_AVAILABLE_IN_WAVEFORM, & FreeSpace)? "

I have attached the CVI example in this post. It has many additional functions that change the GUI of the CVI, but ANY function calls should be the same. Is the only thing that is considerably different that they set a number of rehearsals and use unique relaxation mode. I would go ahead and change your code to be similar in order to ensure that it is no hardware problems. Then I would try to generate and disseminate a sinusoid first before trying to use your file. I hope that we can refine all the problems.

Jason L.

Tags: NI Products

Similar Questions

  • PXI-5421 generating an arbitrary signals on the fly

    I have a card PXI-5421. I need to generate an arbitrary waveform with different frequencies. I need to have a trigger to switch between Forms of waves of different frequencies. I use the script to do this. I'm not able to update the frequency of the next wave on the fly without stopping the program. In other words, can I download signals in real time? The code is attached.

    Hey Kakrott,

    You should be able to achieve this with your PXI-5421. The example of 'switch between the waveforms FGEN"in the examples of LabVIEW makes something similar to what you're trying to do. As explained in the documentation: "this example shows how to switch between two different wave forms while generating, using updated data every time." This example uses a trigger to change what waveform is generated.

  • Unable to read the security descriptors data stream

    Whenever I start my computer runs CHKDSK - it says checking file system on E: and then he said that it should be checked for consistency. It works until stage 3 when he says 'impossible to read the security descriptors data stream' how to fix this?

    I tried chkdsk e:/r and it runs before step 3 when I get the "unable to read the security descriptors data stream" and it goes no further.

    I also tried fsutil dirty query e:- but it says something about a parameter incorrect and not if the volume is dirty or clean.

    Then I tried chkdsk e:/f/x - that always gives me the same mistake about it being an incorrect setting.

    As far as I know there is absolutely nothing on E:, I didn't even know that there was an additional drive. Right now I have it turned off so that I can use my computer. It seems to work fine without it. I read an article that said that if I can't fix e: with chkdsk which I have to do a low-level format of the reader? What's my next step? And I can do without the XP disc?

    The syntax

    fsutil dirty query e:

    is correct (except, of course, you try to use from the Recovery Console, where the fsutil command is not available).  Are you logged on as a user with administrative rights when you use fsutil?

    Similarly, the switches /f and/x are not available for chkdsk in the Recovery Console.

    See Recovery Console controls.

    Click on desktop then right-click on E: drive icon and select Properties.  What is indicated for:

    • File system
    • Space used
    • Free space
    • Capacity

    Now double click the icon for E: are shown files?  If not, click Tools > Folder Options > view and select the radio button "Show hidden files and folders" and uncheck "Hide protected files (recommended) operating system.  Now that you see all the files?

    Everything you read 'low level of shaped' is nonsense.  Any modern PC drive cannot be low level formatted by end users.  You can read this, but there is really no necessary even to "zero fill" your drive E: http://seagate.custkb.com/seagate/crm/selfservice/search.jsp?DocId=203931 (I have not checked to see if the WD tools rescuer has similar characteristics to SeaTools for DOS).

    If you are convinced that there is nothing of value on E (for example, installation of backup or restore), you can either format by right-clicking on the drive icon in my computer and selecting "format" or you can start disk management as described previously and use either in electronic format or delete the partition completely.  If you delete the partition, space becomes "unallocated".

    Because I guess C is your system drive (where Windows is), you may be able to use the diskpart tool to extend the partition F to use the unallocated space left if you decide to remove E well it's much easier (and safer) to do with disk management third-party tools such as Easeus Partition Manager free : http://www.partition-tool.com/personal.htm

  • How to configure the options of oracle community such as, I see the answers to the questions posted by myself in a separate stream of data/place?

    Hello

    Thank you for your initiative on the oracle community.

    I love the community and wants to play an active role.

    However, I see the discussions initiated by me in a separate stream of data/place rather than mix them in all the other debates.

    is it possible to search all discussions posted by me only in one place?

    Is it possible to configure the options so that only the answers to my questions will be displayed in the Inbox?

    It used to work before, however, I subscribed to a few communities and my Inbox is bombarded with all the discussions. I read and try to answer on the other discussions, but it is difficult to keep track of discussion initiated by me?

    Help, please.

    Its there in your profile

    user10163762

  • PXI-5441 vs PXI-5421

    Anyone know if the PXI-5441 module can be ordered with the LVDS output option?

    In the data sheet is indicated, that a similar, more simple PXI-5421 can generate low-voltage-diff-signal, too (not only the complete analog single).

    Hello

    All NI PXI-5441 modules come with the connector of the SDC, and for later reference, all options of memory except the 8MB for the NI PXI-5422/21 option will come with the SDC as well. A PIN for the CSD can be found here http://zone.ni.com/reference/en-XX/help/370524M-01/siggenhelp/5441_ni_5421_digital_connector/

  • PXI-5421 Signal routing to PFI4 and PFI5

    Hello

    I am trying to route bits 0 and 1 of a waveform I generated using a PXI-5421 AWG group work PFI5 and PFI4 respectively for the ports. What seems to happen, this is the first installation is written the second set so that only one PFI port is set up. I've attached a screenshot of a section of the configuration of the VI. Can two bits of a waveform being routed to two ports separated the IFP at the same time?

    Thank you

    Steve

    Hi Steve,.

    Yes.  There is data on the PXI-5421 4 markers, and each can be configured with unique values for each of the attributes of data marker.  To set up the markers of data independently, you must specify a 'Active Channel' for the polarity of marker data and number of bits attributes.  So in your example, you would just need to add an entry "Active Channel" on your property node above the attributes of marker of both data and wiring in the "datamarker0" to set up the first brand of data and the "datamarker1" for the second.  "NiFgen waveform Arb marker" shows how to do this.  Do not wire the active channel range cause really all markers 4 data to configure when the value of each attribute of data marker.

    Hope that helps.

  • Generation of pulses using NOR-PXI-5421 FGen

    Hello Sir/Madam,

    Question:

    We use the Funktiongenerator NOR-PXI-5421 and just want to generate a pulse, because it can be done in almost all cheap Funktiongenerator.

    Unfortunately, I can't find a way to tell the Funktiongenerator to generate a pulse. I can generate Singals as I like, but don't know how to generate a single pulse.

    Perhaps you have a program that gives me this opportunity.

    Thank you for your support.

    Hi Jens,

    You can try to use the Council 5421 scripts. The following examples of LabVIEW: "Fgen Arb Script.vi" or 'Fgen switch between Waveforms.vi' use of script to generate signals, you can create a script that generates a single DC pulse of high level in the same way.

    I hope this information helps you.

    Best regards

    Blase

  • Why do write can not be performed because the number of data channels does not match number of channels in the task.

    Possible reasons:

    Scripture cannot be performed because the number of data channels does not match number of channels in the task.

    When writing, provide data for all channels in the task. You can also change the task so that it contains the same number of channels as the written data.

    Number of job channels: 8
    Number of data channels: 1

    Lama says:

    The DAQmx vi writing gives me the error. If I run a single channel, isn't a problem. Multichannel gives me error.

    You are funny! Why tie yourself to work VI (single channel) instead of one that gives you errors (multichannel)?

    (If your car does not work, you bring car your wives to the mechanic, right!)

    What is the exact text in the multichannel 'physical channels' when you do the AO control?

    Lama says:

    I did a sequence to ensure that each function has been run in the correct order. Wouldn't a race condition.

    All you have to do is wire the 'start of task' error at the entrance of error of the DAQ assistant and then back to 'stop task' and things will run in order. Guaranteed! Think the stream! Everything else can run in parallel or the order is irrelevant.

    First convert the sequence stacked to a sequence of plate, remove the flat sequence and add the mentioned son. Now, do a "cleaning pattern.

    A when stacked with the inhabitants of the sequence is one of the worst construction you can possibly do. It makes the code difficult to follow, impossible to maintain, difficult to debug.

  • How to change the value of string clustered, to implement using the node value of property instead of writing directly on the flow of data or using the variable

    new to labview :-) and I have a problem when I want to change the value of a string in bunches, and I want to implement this using the node value of property instead of writing directly to the stream or by using the variable, enclosed is the picture.   No matter, I have change in cluster (control) or value of Popery out (indicator) cluster, the value (sensor 7) dataflow keeps unchanged even I gave the new value by value of property node. Thank you to give me some advice about this.

    Hi GerdW

    Thanks a lot for your answer. The reason I'm stubbornly tring to break the flow of DATA is: we have a test system that have about 100 screws, they have a few connected flow, some of them will be unbundling a cluster dataflow chain to check the value in order to make the different cases.  Now I want to insert user event by changing the control and influential cases during run time.

    As I initially uses a global variable (to control cases) instead of unbundle string data flow, it works well.  But then, I found there are a lot of screws that are using the string unbundle.  One of the 'lazy' means, I tried is to change the value via the property node (because that way, I did not need to find all the places where using the unbundle string and replace them with the global variable), then I noticed a problem with "dataflow", the value in the stream of cluster in fact will not be changed by changing the value of the property node.

    I did a test with VI simple (like the picture in last post), and after reading your advice, I tell myself that I need to understand the concept of "DATAFLOW" in labview, it seems that my "lazy" way can not work in this scenario.

    I have attached the criterion VI here, have you furthur suggestions on what I can do in this case?

    Mant thanks!

    Minyi

  • Visa name cluster resource to the stream network writer causes error 42.

    If I try and pass this heap of 'data engine' with a VISA embedded resource name:

    for a Writer of stream network in this way:

    Then I get this error of the VI "write only to flow."

    If I change the data engines TypDef cluster so that a chain control is used instead of the VISA reference, the error disappears and data crosses the stream network without problem.

    This is expected behavior?

    I thought that the 'data' (type = "POLY"?) as one located on the VI 'Write one element to flow' was supposed to take just about anything...

    Hi Rolf and WNM,

    After further investigation, I was able to reproduce the problem and agree that it is a bug. This was reported to R & D (#395047) for further investigations. As mentioned previously, a possible workaround is using the address of the cluster instead of the resource VISA VISA. Thanks for the comments!

    Doug W

  • is there a vi for inputs/outputs using AWG (PXI-5421) and DIG (PXI-5122)?

    Hi, I'm looking for a vi that applies to an input through the AWG (PXI-5421) signal and measures the output through the SEARCH (PXI-5122). In particular, I'm trying to apply an entry by a multiplexer, then close this channel of the multiplexer through which the entry came and then measure the output using the SEARCH signal.

    Any help will be greatly appreciated.

    Thank you.

    Hello Deepjunior,

    I understand that you wanted to find an application that will be output on an AWG device and acquire a table digitizer at the same time. While there are many methods to achieve this, the easiest starting point would be to just take a simple example of niFgen and a simple example of niScope and run them together or combine them. According to exactly what your application requires, you may need to implement additional features, but it is a good starting point.

    In particular, you can find an example of this from the example of area developer program: OR-TCLK synchronize AWG and digitizer high speed. Basically, this example combines niFgen and niScope examples and using the API OR-TCLK to synchronize devices. I recommend watching the program and trying to start from there. Hope this helps,

  • We are in the streams we want to use the tools of replication of database of 3rd party for Oracle freeware. Pls suggest

    We are in the streams we want to use the tools of replication of database of 3rd party for Oracle freeware. Pls suggest

    Hello

    GoldenGate and shareplex are large databases for heteregenous platforms oracle replication tools.

    Shareplex replicates data between heteregenous platforms for example source on Linux and Windows.Shareplex target come from queues so that when we define it a few tables in the configuration of the source files, it will get automatically reproduced in the target database.

    SharePlex 8.6.2 technical documentation

    Concerning

    Rami

  • Data merge do not pick up all the fields of data

    Hello

    I had a problem, posted here: http://forums.adobe.com/thread/1217090

    Essentially, I used the "CSV2Tables" script to pre-populate arrays of simple column 2 with information from a CSV data source.

    The tables consist of a title and a block on this specific topic. Many of the blocks of information that I am importing also contain the tag (< < DataTag > >) data

    The plan is to use CSV2Tables to populate the tables, then change the data source and run an ID data merge to replace all < < flags > > normal in the tables with the information from a second source of CSV data.

    The problem is, CSV2Tables is important data and tables very well pre-load, but data tags that are found in each body text are picked up in plain text (as Peter Spier has pointed out, they are being requested by a plain text stream rather than drag since the merger Panel and direct mail) so when I try to run direct mail ID , none of the fields are in my document.

    My question is - is there a method, or a script available out there that can essentially do a find/replace in a document and replace the text that appears as the < < PlainText > > with a data that is recognized by ID, label that will allow me to run a data merge?

    Told me to check out some of the available commercial plugins out there, but registration and establishment of demo would force me to contact our it supplier for each, and it would be a comprehensive process.

    Any help is very appreciated.

    Hello

    As far as I know it actually takes a script to replace "plain text" with dataMergeTextPlaceholders.

    a small example;

    Array.prototype.find = function (string) {
        for (var s = 0; s < this.length; s++)
            if (this[s] == string) return s;
            return -1;
        }
    
    var mFile, mDoc, mFields, mFieldsNames, mStory, mPlainTxt, mNameToCompare, mField_ID;
    
    // edit this with proper .csv path
    mFile = File(Folder.myDocuments + "/" + "Merge.csv");
    mDoc = app.activeDocument;
    mDoc.dataMergeProperties.selectDataSource(mFile);
    mFields = mDoc.dataMergeProperties.dataMergeFields;
    mFieldsNames = mFields.everyItem().fieldName;
    
    // script assumes a text box with "plain texts" to replace is selected
    mStory = app.selection[0].parentStory;
    app.findGrepPreferences = null;
    app.findGrepPreferences.findWhat = "<<.+?>>";
    mPlainTxt = mStory.findGrep(true);
    for (var k = 0; k < mPlainTxt.length; k++) {
        mNameToCompare = mPlainTxt[k].contents.slice(2,-2);
        mField_ID = mFieldsNames.find(mNameToCompare);
        if (mField_ID > -1) {
              mField = mFields[mField_ID];
            mDoc.dataMergeTextPlaceholders.add (
                mStory,
                mPlainTxt[k].insertionPoints[0],
                mField
                )
        mPlainTxt[k].remove();
         }
        }
    

    At this point, you can run a "normal data merge.

    This should work for related managers (the one selected) or a table inside the selected image

    I hope it could be useful for more complex tasks

    Rgds

    Jarek

    Post edited by: Jump_Over ==> added media because if last statement

  • I can see the broadcast live on the site, but other people cannot see the stream!

    I downloaded on my Web site HTML incorporate code (by Flash Media Server full) by Flash Media Playback ! I checked the Server and found that it works! I can see the live broadcast on the site, but no other people can see the stream! What happens? I see the data flow but other people are not see. Use Flash Media Server (full) and Flash Media Live Encoder 3.2! I inserted the html cod in the body of my site in the index! I have prewieved (COD. html), I checked and its works, I can see on my website ! Thank you!

    The crossdomain.xml file must be placed in the folder is rootinstall/webroot and not the apache2 folder. 2/conf. There is no change required in the httpd.conf file. Please read "Setting crossdomain.xml file HTTP streaming in Flash Media Server" section in the link provided above carefully.

    Thank you

    Apurva

  • The Stream.play () method does not work why?

    I want to create an application to switch streams and republish them under continuous flow unique to the remote server.

    In the first step, I tested "Livestream code" of the "Multipoint publishing example" p. 184 of "FLASHMEDIA SERVER 4.5 Developer's Guide ADOBE®" If ns.publish method is used. He managed.

    I try stream.play method now.

    I wrote main.asc code as in the Stream.play example (p. 162) of the 'the ACTIONSCRIPT Language Reference® to ADOBE® FLASH® MEDIASERVER 4.5 server-side", but I have a certain problem despite this.

    I try to spread on my local server (Uri - "localhost/studia") by two customers - OUT and my request for "Livestream" accordingly (with stream name "livestream2") and retraslate it to a remote server by using my "studia" on a local application.

    The connection between two servers (with application "on-line") appears in the Remote Server Admin Consol, but the flow of my local server do not come to her.

    Here's my main.asc script:

    application.myRemoteConn = new NetConnection();

    application.myRemoteConn.onStatus = {function (info)}

    trace ("Connect" + info.code + "\n");

    Respond to all customers

    for (var i = 0; i < application.clients.length; i ++) {}

    application.clients [i]. Call ("onServerStatus", null, info.code, info.description);

    }

    };

    Connect use NetConnection object remote server (the remote server works with other application wery well)

    application.myRemoteConn.connect ("rtmp://RemoteServer/live");

    Estimate of the server data flow

    application.myStream = Stream.get ("livestream");

    application.myStream = Stream.get ("livestream");

    If {(application.myStream)

    application.myStream.play ("livestream2", 0, -1, true, application.myRemoteConn);

    }

    The Stream.play () method does not work why?

    What I've done wrong?

    In this case, I recommend a mixture of solution...

    Something like that will be interesting to check:

    var tempSwitchingStream = Stream.get ("myswitchingstream"); create a stream live temp on the server local app...

    tempSwitchingStream.play (livestream1, 0, -1);      Subscribe to tempSwitching to livestream1... That is to say get the content of livestream1 in there... I can also switch to different streams inside... tempSwitchingStream will get the contents of the stream of //switched

    If (tempSwitchingStream) / / if there is

    {

    NS. Attach (tempSwitchingStream);  Subscribe to my net workflow to receive data from tempSwitchingStream

    NS. Publish (livestream, "live");  now flows net is get data from tempSwitchingStream, so publishing those data with the name "livestream" on the connection to the network... NET already know its NetConnection... See above

    }

    Did you get the point? I created a temporary stream that can pass the stream in its method of game and then I push this temporary stream to a remote server...

    However, it is tricky... Majorly, in most cases similar to yours, people write applications on the application of remote server to get the stream and he spend the pull in play method as described in the first method discussed...

Maybe you are looking for

  • Dynadock does not show second monitor

    Just got my dynadock and cannot get my 2nd monitor for clone my laptop. It only shows my screensaver. Any suggestions?

  • iTunes crashes on start up with Windows Vista

    For the last week or so iTunes crashed during startup to the top in Windows Vista. I have the 32-bit version. I tried to uninstall and reinstall. This doesn't seem to help. When it plant, I get a blue screen with a lot of text that does not stay up l

  • English version of Knoppix?

    I have been recommended in this forum to use and use, Knoppix when I had difficulties to access my hard drive.  I downloaded the file .iso to a cd and booted from the CD, but it was extremely difficult to use because it was in German.  Fortunately my

  • Store does not connect to internet

    I just got a replacement surface rt, I had problems activating windows, but do it now. I have full connection to the wifi but when I go to open the store it says that it is not connected to the internet.And whenever I try to use a Web site through in

  • Other homegroup users cannot see the pictures on Windows Photo 8.1 app

    We have a new desktop computer with Windows 8.1 and have trouble getting both me (Administrator) and my husband (another user PC) see all photos in all photo sharing folders. I read all the other assignments. I've restored the library of images with