04-02-2008 11:04 AM
Is it possible to change the range of analogue output (PXI 4461) without stopping continuous generation? Does the task have to be stopped or maybe just transferred to a different state? Can anybody help me with that?
04-03-2008 07:24 AM
Hi Tomkut,
I hope you are well. Thank you for your message. It is very interesting. I have had a look at what you are trying to do with the PXI 4461 in changing the range of the analogue output whilst in continuous generation mode, but I do not think that this is possible as you have to stop the task before the range can be changed. I have tried transfering to a different state but it only works when I do an implicit state trasition to the unreserved state, but I do not think that this would be of any real benifit and it would probably be better to just stop the task.
I am sorry that I could not be more help with this but if you have any questions feel free to let me know and I will do my best to resolve them. Good luck with your application.
Kind regards,
Prashant M
Applications Engineer
NI UK & Ireland
04-03-2008 07:43 AM
Hi Prashant,
I do have some other questions, shall I continue in that topic?
Thank you
Tom04-03-2008 08:08 AM
Hi Tom,
Thanks for the message. If your questions are related to this topic then you can post them on this message, however, if you have some questions that are related to other topics, I think it would be best to post them as a new subject.
I hope this helps.
Thanks very much.
Kind regards,
Prashant M
Applications Engineer
NI UK & Ireland
04-03-2008 08:12 AM
1) I want to generate sine waveform, 50Hz, and depending on the input change it’s parameters (amplitude) not every cycle though, may happen after 2000 cycles. Shall I use regeneration mode? I though it might be a good idea, since the computer doesn’t have to generate all the time the same sine and write into… But I also read about glitching problems and long time it takes to generate changed waveform (although it seems stupid to me, cause that should be solved with buffer parameters) don’t know which way to go, usually it’s advised on NI.com to disable regeneration and produce the samples/cycle every iteration (but I don’t understand here many things as well).
2)
If you generate continuously (sine waveform, 50Hz,
non-regeneration) and want to get new cycle every loop, do I need to specially
configure buffer (either user or onboard)? I read somewhere in help that buffer
is as big as first portion of samples sent to DAQmxWrite.VI (so it’s gonna be
1000 S, one cycle in my example, is it user one or onboard). What happens if
loop iterates faster than generation, what happens with samples that haven’t
been generated yet? Does the buffer grow (are the samples in a queue)? (I don’t
want that, cause than I’ll have to wait X cycles to get changed waveform). Does
it rewrite all the time old data? (wouldn’t it be sensible to slow down the
loop, so that producing useless data doesn’t occupy computer?). What if inside my
generation loop are many other
Regeneration seems to me the smartest solution, but anywhere I was reading about continues generation, it was rather advised to turn off regeneration, why?? (glitching problems, delay in generation of updated waveform? that should be solved with buffer options I would think).
Tom04-04-2008 05:26 AM
Hi Tom,
Thanks for the message. I have had a look at this and for the first part of your message I think the best option is for you not to use regeneration as this will allow you to write to the buffer each time on the fly as you are constantly writing data to the buffer. I have attached an example VI so that you can see how this is done. From your previous message you mentioned that you wanted to change the amplitude so in this example VI I have put the amplitude inside the while loop to allow this.
If you use regeneration, then you would have to stop the task before you write back onto the buffer and it is generally used if you don’t want to change frequency or amplitude.
For the second part of your message, the drivers will actually take care of most of the things that you had concerns about so you don’t need to worry too much about it.
For the last part, where you are concerned about the effect of lots of Vi’s, processes and calculations within the loop, you are correct as lots of processes will definitely slow the loop down and what is suggest in this case is that you use the “Producer and Consumer Loop”. In the “Producer and Consumer Loop” the top loop should have all of the time critical functions and the rest should be in the bottom loop and you pass data between the loops via queues. For more information on the “Producer and Consumer Loop” I have posted a link for you below:
http://zone.ni.com/devzone/cda/tut/p/id/3023
I hope this helps with your application and let me know how you get on.
Kind regards,
Prashant M
Applications Engineer
NI UK & Ireland
04-11-2008 08:19 AM
04-22-2008 08:16 AM
09-08-2009 11:05 AM
09-08-2009 11:08 AM
BenYL, what are you having an issue with?
I find LabVIEW to be very intuitive, especially in the area of data aquisition, which is what LabVIEW dominates other languages at.
Are you having a problem with some of your code?