06-03-2014 04:15 AM
Hello,
I have an VI how is able to read some inputs with a DAQ USB-6356 and I use a "Agilent 33522A" Waveform Generator. I want to Generate and Acquire with the DAQ.
Actually it work but not well, the frequency is not very stable and the 2nd loop didn't stop with the 1st (2nd is Generator , 1st is Acquire).
Thanks in advance 😉
P.S my VI isn't an true state machine because I need to control it for the moment.
Solved! Go to Solution.
06-03-2014 04:26 AM - last edited on 08-13-2024 12:32 PM by Content Cleaner
Hi MaxLamb,
In order to stop two loop at the same time, you can try using local variable.
You can right click at the stop button of one loop and choose create -> local variable. Use this variable to stop another loop.
More information of local variable can be found via this link : https://www.ni.com/docs/en-US/bundle/labview/page/using-local-and-global-variables-carefully.html
I'm not sure what do you mean by "not very stable". It would be better if you could explain more on this. If possible please also explain how you connect your hardware.
Best regards,
Tuitui
06-03-2014 04:47 AM
Hello TuiTui,
By not very stable I mean that I set my generator to 100Hz and I acquire 101.012 Hz.
When I use the Agilent, I set at 100Hz and I acquire 100.004Hz.
For the local variable, I can't create one without create a button somewhere ?
Thanks you
06-03-2014 05:44 AM
Hi MaxLamb,
This amount of inaccuracy might caused by various reason. Could you tell me how you read the value of the signal? By using, simulate signal, what is the configuration inside?
By using local variable, you need an object in front panel to create one. If you don't want to create an object in front panel, you might want to look at global variable.
Or if you only don't want it to be seen in the front panel, you can hide the control or indicator.
There is a youtube tutorial on global variable which can be found below
http://www.youtube.com/watch?v=PquslTj69f4
Best regards,
TuiTui
06-03-2014 09:12 AM
Hello TuiTui,
So, for the Generator :
I use 2 "Simulate Signal" wired to a "DAQ analog output". Frequency, amplitude and phase are set by 3 control.
Setting of both "Simulate Signal" : Samples per second = 3M , Number of samples = 100k , Run as fast as possible
Setting of DAQ Output : Continuous Samples , Samples to write = 100k, Rate = 3M
For the Acquire :
I use one DAQ analog input.
Setting is : Continuous , Samples to read = 20k (Control in front panel), Rate = 1.25M (Max value)
Thanks
06-03-2014 09:34 AM
OK so you are writing at 3Ms/sec and reading at 1.25Ms/sec and you wonder why there is a bit of discrepancy in the resolved frequency? Ideally you would want the read and write to share a sample clock but at least selecting the same clock frequency (or one that is a multiple of the other) would go a long way to fixing that source of your error.
Second source of Error: You are generating a contineous waveform. unless you select "integer number of cycles" there is a discontinuity when the end is reached at an arbitrary phase and the phase is reset at the begining of the waveform. The Write DAQ assistant can "Use Waveform timing" to adapt its timing parameters to the waveform dt and number of samples.
06-04-2014 02:33 AM
Hi Jeff,
Yes that was that. But I don't know why I had +10% of frequency when the settings are 1.25MS/s and 3MS/s ..
06-04-2014 10:28 AM - edited 06-04-2014 10:30 AM
@MaxLamb wrote:
Hi Jeff,
Yes that was that. But I don't know why I had +10% of frequency when the settings are 1.25MS/s and 3MS/s ..
I'll leave solving the math to you but I'm almost positive you could justify the aliasing you saw by applying the Nyquist-Shannon theorm
@and from a previious post the error was @1%
06-04-2014 10:46 AM
Quick answer : my fault ! the error was 1% .. I just haven't write the number correctly
It works really fine now !
Thank you Jeff
06-04-2014 08:33 PM
Thanks Jeff
A really helpful information
TuiTui