How to make repeated calls to the reader in the AcqVoltageSamples_IntClkAnalogRef code sample.

I want to make repeated calls to the reader in the AcqVoltageSamples_IntClkAnalogRef code sample.  A comment in the code says I can do simply by calling the reader. BeginReadMultiSample method of the callback function. I tried this without success using the same settings for the player. Is it possible for the callback function? If Yes, how should I call the reader? I'm programming in c#.

Thank you

John

Doug,

No problem.  I found the class to which the timeout without much property in safely.  I now have a solution to repeated calls.  The two keys were the infinite time-out setting and the elimination of all the DAQmx objects in the finally section of the callback function before calling the AcquireData() method for the next cycle of reading and processing of data.  The user sets blQuit to false and call AcquireData() by clicking on the Start button.  Repeated calls are then made to 'automatically' until the user clicks the button exit.

Thanks for your help,

John

Private Sub AcquireData()

This code creates all the objects needed to acquire and store the data of a "sweep."

{

slaveTask = new Task();  Double sampleRate = Convert.ToDouble (this.cbxSampleRate.Text);

Double minVolts = Convert.ToDouble (this.cbxMinVolts.Text);

Double maxVolts = Convert.ToDouble (this.cbxMaxVolts.Text); int samplesPerChannel = Convert.ToInt32 (this.cbxSamplesPerChannel.Text); slaveTask.AIChannels.CreateVoltageChannel ("Dev1/ai0", "", (AITerminalConfiguration)(-1), minVolts, maxVolts, AIVoltageUnits.Volts);

Set up sync Specs

slaveTask.Timing.ConfigureSampleClock ("", sampleRate, SampleClockActiveEdge.Rising, SampleQuantityMode.FiniteSamples, samplesPerChannel);

Set up the reference trigger. US fires with a level of 1 volt and will record 2 samples of trigger before (the minimum)

slaveTask.Triggers.ReferenceTrigger.ConfigureAnalogEdgeTrigger ("APFI0", AnalogEdgeReferenceTriggerSlope.Rising, 1.0, 2);

slaveTask.Stream.Timeout = - 1;

slaveTask.WaitUntilDone ();

Check the task

slaveTask.Control (TaskAction.Verify); InitializeDataTable (slaveTask.AIChannels, ref dataTable);

acquisitionDataGrid.DataSource = dataTable;

Reader = new AnalogMultiChannelReader (slaveTask.Stream); drive. SynchronizeCallbacks = true; drive. BeginReadMultiSample (Convert.ToInt32 (cbxSamplesPerChannel.Text), New AsyncCallback (slaveCallBack), null);

}

catch (System.exception DaqException)

{

MessageBox.Show (exception. (Message);

slaveTask.Dispose ();

}

}

private void slaveCallBack (IAsyncResult ar)

{

Try

{

read data from the channel

data = reader. EndReadMultiSample (ar);

dataToDataTable (data, Ref dataTable);

plot the data here, if blKeep also write it to file

}

catch (System.exception DaqException)

{

MessageBox.Show (exception. (Message);

}

Finally

{

This. Refresh();

slaveTask.Dispose ();

If (! blQuit)

{

AcquireData();

}

}

}

Tags: NI Software

Similar Questions

  • I'm trying to connect on Apple TV.  It keeps generating a 6-digit verification code, sent to another device.  I need a 4 digit or need to know how to make a space on the verification code entry screen

    I'm trying to connect on Apple TV.  It keeps generating a 6-digit verification code, sent to another device.  I need a 4 digit or need to know how to make a space on the verification code entry screen

    Read this noting the last two paragraphs:

    For Apple ID - Apple Support two-factor authentication

    You can try to add on your suggested such password or disable the service and then connect.

  • How to make a call using the ip address

    Hello! I'm very new to telepresence system and wanted to know about calls of one endpoint (Te MX300) to another (Fe SX20) using their IP addresses (public or private). I saw in the configuration guide they make calls through IDs or URIS, and they need to guard/SIP proxy for that, but how can we establish the connection through their ip addresses without additional devices, of the right endpoints?

    Thank you

    Hi Zhomart,

    I assume you want to directly (without using the gatekeeper) call the other end points using the IP addresses.

    It's very simple.

    Use the remote control and punch in the IP address that you want to dial, make sure you only select as a H323 Protocol.

    The composed IP address should also be accessible.

    Kind regards
    Sagar

  • How to make windows media player to read rar files

    How to make windows media player to read rar files

    Windows Media Player cannot play RAR files.

    RAR files are not video/audio files, they are compressed files. If there is video/audio files in the RAR file, you must first open and extract from RAR file.

    You can use 7 - Zip to create/open/unpack RAR files and other compressed files.

    7-zip:
    http://7-zip.org/

  • SBH52 don't make phone calls after the installation of Marshmallow

    Hello

    I upgraded my Z3C Marshmallow Android and since then, the SBH52 does not allow me to make phone calls from the call log.

    I had similar behavior original lollipop but discovered "Call Log Smart Extras" had to be installed and the problem solved.

    However, after upgrading to the marshmallow and noting that I couldn't dial from the SBH52, I uninstalled and reinstalled Smart Connect, SBH52 app and Call Log Smart Extras but everything remains the same. I also tried disconnection and reconnection of the headset to the phone, both via NFC and Bluetooth.

    The headset works. I can 'throw' music, audio, videos and maintain telephone conversations. I can also access the call log and read SMS.

    If I want to hang up, I can still do it by pressing the big round button on the front of the helmet, so my problem is not this one:

    http://talk.sonymobile.com/T5/wireless-accessories/SBH-52-on-Android-6/m-p/1051004#M7193

    Everyone found this problem too? Is there a solution?

    Thank you.

    I wonder there was an update for applications, but resumed making phonecalls through SBH52

  • How to make a call from CPO to vCO (vcenter orchestrator)?

    How to make a call from CPO to vCO (vcenter orchestrator)?

    Hello

    I am trying to create a workflow that would connect to a vCO.

    I was Expecting

    1. how to create targets for the vCO and

    2. how acess that target.

    Concerning

    Shiva

    1) there is no target for the vCO. We have a target/connection to Virtual Center (vCenter)

    (2) If you want to make vCO calls you could do, it all depends on how the API is structured. You can make calls via web services or CLI, etc.

    If you give your use case it is perhaps more to discuss. If you need an ENH or put something in, you can open a case with the TAC.

  • How to make navigation that pushes the page to the side while revealing the links?

    How to make navigation that pushes the page to the side while revealing the links?

    There is currently no way to call JS in reflow, or add some CSS Transitions. You can export the code

    and then open it in a code editor of your choice and add the script necessary to do this. An example is available here: wide canvas Show Menu for Bootstrap model

  • How to make a folder shows the number of files in there?

    How to make a folder shows the number of files in there?

    You have not indicated what OS you are using.

    Yosemite

    Action > View Options: Select to display the item of information

  • How to make an arch on the topic title?

    How to make an arch on the topic title?

    You can do the following entirely in any version of Pages because the text on a path is not supported. The News Gothic 'gate' in one area of text Pages. The arc of text was done in HTML5 Canvas with Javascript, then saved as a .png image, which was dragged/dropped into Pages v5.6.1. Normal means to create text curvilinear (CRA) is done by an application chart non-Apple.

  • How to make a lock off the internet so I can have another WiFi computer using the internet

    How to make a lock off the internet so I can have another WiFi computer using the internet

    you do not take the lock itself.

    Instead, you configure another computer with security information to access the connection Wireless secure.

    Unfortunately, we cannot help you with this, because we cannot tell if you are the owner of the wireless connection or someone trying to hack it via another computer.

    However, what you can try is to contact technical support that provides your internet service.  they will be well to validate your identity and then provide help or more detailed instructions.

  • the friends hyii UA HUD need help how to make a backup of the files from his deleted with (shift + delete) memory card

    the friends hyii UA HUD need help how to make a backup of the files from his deleted with (shift + delete) memory card

    Hello

    It seems that you want to restore the files removed from the memory card.

    I will definitely help you with this.

    I would say you can search the Internet for data recovery software by using your favorite search engine.

    Warning: Using third-party software, including hardware drivers can cause serious problems that may prevent your computer from starting properly. Microsoft cannot guarantee that problems resulting from the use of third-party software can be solved. Software using third party is at your own risk.

    It will be useful. If you have any other questions, feel free to let us know. We will be happy to help you.

    Thank you.

  • How to make a backup of the system files?

    I want to just back up the filesystem in the case where.

    Hello

    You can save your own personal files (documents, photos, etc.) or do a complete PC backup that contains the system files.

    If you want to make a complete PC Backup or a backup file only, buy an external hard drive.

    Only Vista professional, comprehensive and company have the opportunity to make complete backups of PC.

    All editions of Vista can do backups of files.

    Here's how to back up and restore your files:

    "How to back up your data.

    http://www.wintuts.com/how-to-backup-your-data

    http://www.home-PC-help.com/windowsvistabackup.html

    "How to restore your files.

    http://www.wintuts.com/how-to-restore-files

    This is how to do a full backup of the computer and how to restore it (for Vista Business, Ultimate and Enterprise only):

    «How to make a backup of the computer in Vista»

    http://www.bleepingcomputer.com/tutorials/how-to-use-Vista-complete-PC-Backup/

    "How to restore a full backup of the computer.

    http://www.bleepingcomputer.com/tutorials/Windows-Vista-complete-PC-Restore/

    FAQ from Microsoft about backup and restore:

    "Back up and restore: frequently asked questions.

    http://Windows.Microsoft.com/en-us/Windows-Vista/back-up-and-restore-frequently-asked-questions

    @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

    There are a number of 3rd party programs available for a full backup of the computer; others, you must pay for, some are free.

    This program must be purchased:

    "Acronis True Image".

    http://www.Acronis.com/homecomputing/products/TrueImage/index_gwo.html?utm_expid=4274314-6

    These are free programs for the protection of the computer:

    "EaseUS Todo Backup free"

    http://www.TODO-backup.com/products/home/free-backup-software.htm

    "Download Backup & Recovery 2012 free FREE!

    http://www.Paragon-Software.com/home/BR-free/download.html

    «Macrium Reflect FREE Edition»

    http://www.Macrium.com/reflectfree.aspx

    ___________________________________________________

    And if you do not score a manufacturer of recovery on your hard drive, you should be able to make your own recovery discs that are system files in order to reinstall the operating system.

    Go to programs > name of the manufacturer of your computer > then their system or recovery tools software topics for them, depending on how it is formulated.

    If you can't find any reference to it, contact the manufacturer for advice on how to make these recovery disks.

    See you soon.

  • How to make a backup of the Windows BACKUP DELL?

    I have a Dell 0ptiplex 3010 with windows 7 pro 32 bit 10 units.
    How to make a backup of the Windows BACKUP DELL?
    Please help, I'm still confused with BACKUP DELL.

    Hi rahar_satriyo,

    Only the version complete Dell backup and restore will give you an option to backup computer image which is a paid version. The default Basic that comes with the system version will have only the restore factory in image.

  • How to make a CC off the power of a laptop so I can put it on a second desktop computer

    How to make a CC off the power of a laptop so I can put it on a second desktop computer

    You can simply disconnect from the Adobe Creative cloud to disable subscription:

    https://helpx.Adobe.com/creative-cloud/help/sign-in-out-activate-apps.html

    No need to uninstall to disable CC apps on a particular computer, but if you want you can uninstall it.

  • How to make someone to sign the document within my documents in the tasks that I specify?

    How to make someone to sign the document within my documents in the tasks that I specify?

    Hello form signature,.

    Yes, you can place the signature to a particular position field in the document as follows:

    1. connect to EchoSign account.

    2. Enter the e-mail address of the recipient.

    3. download the document.

    4. check "Preview, the Signatures of Position or add form fields" and click Next.

    5. in the preview page, drag and drop the signature and other fields of the form if necessary in the document.

    6. once the fields are placed, press Send.

    Here is the link:

    http://helpx.Adobe.com/EchoSign/KB/hub7.html

    Let me know if you need more information.

    Kind regards

    -Usman

Maybe you are looking for