LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Modification of Sample "Getting Started" Programme to Acquire Data for Multiple Frequencies

Solved!
Go to solution

Dear Forum Members,

 

I am very new to the LabVIEW and have been working (mainly through help of Google) to modify one of the sample programmes included in LabVIEW 2010 to fit my purpose.


Essentially, the "Getting Started" programme that ships with the LabVIEW 2008 works in the following fashion

 

  1. User runs the programme
  2. User sets the Frequency to whatever is required
  3. User presses "Trigger" button on the front panel which gives the values in two boxes on the front panel
  4. Programme exits automatically

I have modified it in the following fashion

 

  1. I input the "Frequency Interval" and the "Maximum Frequency" into an Array to calculate the number of iterations
  2. I then pass the required frequency into the "Constant" through unbundling it (where I was initially manually setting the frequency)
  3. From there onwards, the programme runs exactly as before
  4. I have enveloped the whole existing block diagram in a "For" loop to repeat the readings several times, with a different frequency each time
  5. I then finally write the measurements to a spreadsheet in addition to displaying on the "Front Panel" 

The problem that I'm facing is that the frequency is not being updated in the programme. For example, if the last frequency used on the Analyser was 20 Hz, the programme will take repeatedly take measurements against the same 20 Hz rather than against the correct frequencies.

So, in the spreadsheet that I am creating, I get 1 kHz, 2 kHz, ... 10 kHz but the values Impedance values recorded against them were in effect all taken against 20 Hz (or whatever frequency I last used using the un-modified programme).

 

I suspect that the frequency gets updated whenever the user presses "Trigger" button but since I have taken that out, for purposes of automation and replaced it with a static constant of "True", it might be causing problems. I'm not sure if this is definitely the problem but even if it is, I am unable to figure out a way around it.

 

Any help would be greatly appreciated since this is providing a bottleneck in my project.

 

Thank You

 

Attachments:

VI for Original Programme

VI for Modified Programme

Zipped Files (for Dependency Support)

Download All
0 Kudos
Message 1 of 4
(2,370 Views)

Dear Zainykhas,

 

Thank you for posting this to the discussion forums and for uploading some sample code.  I took a lok at the issue you have been having, and it is unclear to me as to why you have placed two for loops around the original while loop.  My understanding is that you want to use the original Sample.vi and want to execute this N times where N is the Max Freq divided by Interval so that you can scan for a range of frequencies.

 

Why not just put Sample.vi around one for loop and use the increment counter scaled by the interval to count up towards Max Freq and insert the desired Frequency into the cluster using Bundle By Name?

 

Kind Regards,

Robert Ward
Applications Engineer, NI
0 Kudos
Message 2 of 4
(2,328 Views)

Dear Zainykhas,

 

Have you been able to resolve the issue now?

 

Kind Regards,

Robert Ward
Applications Engineer, NI
0 Kudos
Message 3 of 4
(2,306 Views)
Solution
Accepted by topic author Zainykhas

Dear Robert,

 

I am using LabVIEW 2010 so wasn't able to run the code that you provided. However, I have managed to get one of my friends to write me the code which I have attached, to help anyone who has the same problem in the future.


Thanks for your time and effort.

0 Kudos
Message 4 of 4
(2,296 Views)