09-06-2016 05:52 PM
Hi all,
I have a X-series DAQ and have done many analog input and output tasks. My question is that can an analog output buffer be accessed or changed while the task is running? I have a retriggerable analog output task and I want to replace the buffer after one trigger is done before next trigger coming in. Is it possible? Or put it in general, how can we access the buffer without re-creating the task?
Any feedback is welcomed. Thank you.
Solved! Go to Solution.
09-07-2016 08:36 AM - last edited on 04-19-2024 02:42 PM by Content Cleaner
Hi skuo1008, just a few questions:
Documentation on VISA Flush I/O Buffer function:
https://www.ni.com/docs/en-US/bundle/labview-api-ref/page/functions/visa-flush-i-o-buffer.html
09-07-2016 09:39 AM - edited 09-07-2016 09:40 AM
Hi,
Thanks for reply. I am using PCIe-6363 X-series DAQ, and I am plaining to access the on-board buffer. When we create a finite analog output task and pass PC buffer to board by "DAQmxWriteAnalogF64" function call. I would like to change or replace the on-board buffer with a different PC buffer after the on-board buffer has been outputted. I was wondering if there is a way in DAQmx to do this dynamic on-board buffer I/O without using LabView functions.
09-08-2016 04:43 PM
I would like to change or replace the on-board buffer with a different PC buffer after the on-board buffer has been outputted.
Could you explain this a little more? As far as I know, you cannot replace the on-board buffer with a PC buffer as they necessarily feed into each other and are completely separate hardware-wise.
Unless you're talking about changing which PC buffer the on-board buffer interacts with, which is generally handled by your OS. DAQmx has property nodes which you can use to set the size of the PC and onboard buffers, but there doesn't seem to be a way to change/replace/select different PC buffers.
The PC buffer allocation is something that your OS generally takes care of, and isn't something that DAQmx doesn't seem to have control over.
09-12-2016 09:10 AM
What I am trying to do is to prepare a circular PC buffer and set a finite analog output task with retriggerable on a PFI line. When the task is triggered, it will write the first part of circular buffer. Once it's done, it will take the second part of circular buffer and be waiting for the next trigger. When it reach the last part of circular buffer, it will go back to the first part of circular buffer. The task will be running contineously until user terminates that. I know it can be done by re-creating the analog output task at cycle done event, but I was hoping there is a better way of doing that. From the datasheet, it states "periodic waveform regeneration from host buffer including dynamic update" on AO waveform modes. I just don't understand how to do "dynamic update" part.
09-13-2016 06:06 PM
Try looking at this example VI:
In LabVIEW, go to Help > Find Examples... > Hardware Input and Output > DAQmx > Analog Output > Voltage - Finite Output.vi
I know this is LabVIEW code, but all of the DAQmx functions in LabVIEW have analogs in text-based DAQmx that you can use to get the same behavior. I'm trying to work on this VI to see if there's a way to cause the program to wait on the next trigger.
I'll get back to you as soon as I can come up with something, but it might be helpful if you could take a look at it too and see if we can't come up with something between the two of us. I think what you're suggesting should be possible, we just have to find a way how to do it.
09-14-2016 12:17 PM
For your signal output, are you trying to output a finite signal or a continuous signal? You said that you are creating a finite analog output task, but you want the task to run continuously. So for the end behavior, do you want your device to output a finite or a continuous analog signal?
09-14-2016 04:00 PM - edited 09-14-2016 04:03 PM
I am creating a finite analog output task but I want it to be retriggerable by an external digital trigger. Based on what I learned from NI DAQ, the task will act like an open-ended behavior, whenever there is a new trigger coming in, it will output the finite length of analog signal. I am not sure if we can say it output a contineous analog signal for the end behavior.
As I described before, I want to make changes on the finite length of analog signal in between the two consecutive external triggers. A side question, can we set the number of times of the retriggerable task to be triggered? It would be nice to have it to be able to be self-terminated.
Thank you for your help.
09-15-2016 12:16 PM - last edited on 04-19-2024 02:43 PM by Content Cleaner
Hi Skuo1008,
What development environment are you using to write this code? You mentioned a text-based DAQmx function earlier in this post. Are you using LabWindows/CVI or ANSI C?
Take a look at these examples:
Analog waveform generation with output buffer update with DAQmx
http://www.ni.com/example/25039/en/
I've also attached them to this reply
09-15-2016 01:18 PM
Thank you Jorr-El, I will try your methods, and I have it marked as solution.
Do you have any idea on the other post (Terminal count is reached for counter Input task) that I put on about setting terminal count in counter input task? First of all, I don't know how to set terminal count value in CI task, and it doesn't behave as I expected when it overflows. Really appreciate your help.