From 11:00 PM CST Friday, Feb 14th - 6:30 PM CST Saturday, Feb 15th, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From 11:00 PM CST Friday, Feb 14th - 6:30 PM CST Saturday, Feb 15th, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
04-04-2007 05:26 AM
04-05-2007 09:34 AM
04-06-2007 06:05 AM
Hi Way,
Thanks for that info - I'd been wondering why the example on http://zone.ni.com/devzone/cda/tut/p/id/4322 had wired the error cluster that way!
I want to find the amplitude and phase of each wavelength individually, and then take averages of these values. I suppose I could do as you say, and then split up the array afterwards, but I also want to change the amplitude of the output wave if the displacement being measured is not correct and so I want to do this as often as possible i.e. every wavelength.
From my interim report regarding the program:
" At low frequencies the amplitude of the input wave is set and the hydraulic actuator will respond appropriately. However, as the frequency increases, the amount of time for the apparatus to travel from the maximum to the minimum value will decrease. By simple physics, this increases the speed that the actuator will have to move. Eventually the limit of the equipment will be reached and to keep at the higher frequencies, the amplitude will decrease.
For the testing of tyres this is not a good thing as the displacement should be kept constant throughout each test. For this reason, a displacement control loop is being programmed which examines the displacement signal from the rig and compares it to a specified target set by the user in order to keep the two as close as possible. The recommended displacement target is 2mm as this ensures that the equipment should not reach the extent of its capacity, even at the higher frequencies being tested."
Btw, is it possible for you to save the VI you posted as an earlier version - I'm running 7.1 so I can't open the file.
Also, I don't have access to the rig for the next week due to the easter break so my next response may be a bit delayed while I test a few things out.
Many thanks again for your help,
Ian
04-10-2007 07:39 AM
Hi Ian,
Here's the VI again in LV 7.1. If you need to adjust the amplitude for every wavelength, you will have to stop the generation session and change the amplitude. So you could add another for loop within the main loop for wavelength iterations like you did in your other VI (custom MX I-O v3.vi).
Let me know if you need any more help.
Way
04-12-2007 08:51 AM - edited 04-12-2007 08:51 AM
Thanks a lot Way - that's brilliant!
With a minor tweak to specify the input terminal configuration and the maximum and minimum values for the AI Voltage Create Channel it works a treat 🙂
There is a couple more things I'm struggling with - I'm trying to persevere but I'm guessing somebody on the forums might know a neat way of doing these to save me some time...
Whereas previously I was specifying 'Sampling Rate (Hz)' and 'Samples to acquire' which were fed directly into the sample clock, I actually want the user to specify the number of samples per wavelength, and number of wavelengths per frequency increment so I get the same number of samples taken for each frequency:
100 samples per wavelength * n wavelengths per second (Hz) = 100n samples per second (the sampling rate to be input to the sample clock)
100n samples per second * 10 wavelengths per frequency increment = 1000n samples per frequency increment (the number of samples to be input to the sample clock)
The trouble is that the value of n is found inside the loop (labled as 'Current Frequency') and I need to use it before the loop begins - almost a catch 22 situation! I'm sure there must be a way round it by being clever with the data flow order as the value itself is not needed before it is produced... I tried wiring directly but that produced errors. In the version I have attached I also tried using a local variable, but this takes the last value left in memory (15Hz) for the first iteration before the value of n is calculated. If anyone has any suggestions I would be most grateful.
On a separate topic, I thought of a way around the displacement loop issue: if I could design a loop (or more likely 2 nested loops) that produced the output 5 5 5 5 5 5 5 5 5 5 6 6 6 6 6 6 6 6 6 6 7 7 7 7 7 7 7 7 7 7 etc. then perhaps I could use this to control the frequency. It seemed like a really simple thing to produce but I cant seem to get my brain around it!
Many thanks as always,
Ian
Message Edited by ianhaigh on 04-12-2007 02:54 PM
04-12-2007 09:45 AM
04-12-2007 10:21 AM
Well this is what I've come up with as a possible solution to the first problem, but I havent quite executed it properly...
The trouble is that loop#1 (see lables on the block diagram) executes fully and only feeds the last value into loop#2 which then executes the specified number of times, but with 15Hz frequency every time.
How would I go about structuring it so loop#1 exectues once and feeds the current frequency (5Hz) into loop #2. Then when this has finished executing, prompt loop#1 to iterate to get 6Hz etc.
Cheers,
Ian
04-12-2007 11:04 AM
04-14-2007 02:06 PM
Hi Way,
Thanks so much for helping me out on this project - that final step you suggested was pretty simple in the end. I've attached the final VI I came up with in case you (or anyone else) is interested.
The way its been designed there are 2 ways to specify the number of wavelengths per frequency increment:
a) input 10 wavelengths once and find the average amplitude and phase for these 10 as a group
b) input 1 wavelength 10 times, find the amplitude and phase for each wavelength and take the average of these
...or alternatively you could do a combination of these i.e. the average of 5 wavelengths 5 times
Cheers again,
Ian
04-16-2007 04:45 AM
Hi Ian,
I'm glad I could help. It looks you've gotten the hang of forcing dataflow with error cluster wiring. Your code is quite neat and I like the way you add comments to different parts of your code as it makes it a lot easier to read.
There are ways to make your code even more faster/efficient in the future if you're interested. Generally, you'd like to separate your data acquisition from your data processing into different sections, especially in the case of when you need to run your acquisitions at higher speeds (ie. your next acquisition step does not have to wait for the previous data processing step to finish). An easy way to do this is to acquire all your data first, then process that data at the end by extracting the relevant data from your waveform array. A more advanced method would be to acquire and process your data concurrently, by using queues to separate your data acquisition from your data processing into different concurrently running loops. These advanced architectures are covered in our LabVIEW Intermediate course, and you can find more information here:
http://digital.ni.com/worldwide/uk.nsf/web/all/B46DC4E8B94DF74480256E4E005202BC
Good luck with your project!
Way S.