08-14-2017 12:05 AM
Hello all,
I am new with labview and have few simple questions I need to be sure with them. I am using Crio-9076 with input card NI9234 and output card NI9263.
I have simple program where I generate chirp signal 100 sample/second. The chirp signal is continued to output channel in output car. At same time I measuring acceleration with 3 sensors via NI 9234. All this are in timed loop which is synchronized to scan mode.
Thanks in advance
08-14-2017 01:21 AM
Hi WatFin,
1. Yes. Scan period = 1ms means a sample rate of 1kS/s…
2. The publishing will be done each 10ms, but you can write faster into the network stream. (I suppose you use a network stream!?)
3. As long as the code in the loop will be executed within this 1ms the loop will iterate at 1kHz…
4. Why should the be synchronized? Did you program this in any way? Also keep in mind: those two modules use different sampling techniques as the NI9234 is using a delta-sigma ADC. They cannot be synchronized in a simple way…
08-14-2017 01:50 AM
Lets continue!
Thankyou
08-14-2017 02:02 AM
Hi WatFin,
1. Yes. That's what you can configure within the ScanEngine…
2. To measure to loop rate you could use time functions. Counting iterations within a know period of time is ok too. Getting "rubbish" data means: you need to look into details here. Why would you doubt those 121 iterations within 10s?
3. To measure simultanously you need a module with separate ADC per channel (as your NI9234 module). Other modules only use one ADC with a MUX in front, here you will get a (known!) delay between samples of different channels.
08-14-2017 03:22 AM
08-14-2017 03:51 AM - edited 08-14-2017 03:52 AM
Hi WatFin,
Does this mean, that if I have phenomena with 160 Hz and I am using 1 ms scan period it is not going to aliasing it BUT when I save samples for analyzing those are aliased?
When sampling a signal with 1kHz you are able to examine a 160Hz content in the signal.
Why should the data get aliased when you save it? Nobody says you need to reduce sampling frequency when saving…
I have used elapsed time function which run my loop for 10s then it stops. I am using 1 kHz sampling time, the loop is synchronized so in 10 s the counter should give 10*1000 = 10000, am I wrong ?
When sampling at 1kHz for 10s you should get 10k samples. Simple math - as long as your loop really spins at 1kHz…
Can you check ALL iteration times for this 10s period?
There should be also about 10000 sample per acc?
Yes, it should be like this.
Is there any example how I can save every sample after every loop in array including time?
Put the samples into a waveform - when they are evenly spaced in time.
Otherwise collect timestamps and samples in two arrays…
The main problem is: we don't know your VI(s) and so we can only guess what you are doing…
08-14-2017 04:17 AM
I have attached my VI. It is a little bit tumbled, because I have tried different things. Well I wonder that the things in the graphs and sample I get are actually not truth because it is published fewer than loop is running, I am not sure about that? I this right or not?
My goals are simple:
I am really sorry. Labview is very new for me.
thanks
08-14-2017 04:50 AM
Hi WatFin,
Labview is very new for me.
Then please take all those free beginner tutorials which are offered in the header of the LabVIEW board!
Your VI is far from "optimized"…
- Cleanup! (More often!) Nobody wants to debug a VI which misses any kind of structure and "cleanliness"…
- Get rid of ExpressVIs when you want to create fast and reliable code!
- Don't even think about mixing usual datatypes (like DBL) with those thick blue DDT wires!
- Don't create arrays in a RT environment like you do! RT environments don't like to call the memory management in thight loops!
- Don't use charts/graphs in tight loops. Don't use them at all in RT targets…
- Consider a clean consumer-producer scheme to optimize loop iteration rates!
- Remove any unneeded code (like subtracting zero)…
08-14-2017 05:12 AM
Thanks for your exhaustive answer. will never use labview again.
08-14-2017 05:31 AM