SignalExpress

cancel
Showing results for 
Search instead for 
Did you mean: 

Phase calculation in conditional loop

I collect data from 2 channels on an Agilest oscilloscope (DSO-X-2004A) using the IVI Scope Acquire block. After acquiring those signals, I want to know the phase difference, which I calculate in the following manner: Tone Extraction CH1, Tone Extraction CH2, Formula (detect phase1 - detect phase 2). 

 

I want to run this in a loop, and store the phase difference each loop. For that I have a conditional loop (set to 10 iterations for now), and after each phase difference calculation I save the new data point to a txt file. Is there another way of storing/saving the phase difference calculation from each loop, besides saving it to file?

 

The next problem I have is that after all the loops are finished, I want to look at the phase difference data and plot it vs iteration number. This is a problem because I get the error: "The selected file does not contains any Signals that could be imported" when trying to load the data at the end. I have the load ascii block outside the conditional loop that generates the data file, so I don't know why the load ascii is trying to excecute before the loop is done. I tried splitting everything into Sequence conditions with execution delays, but that hasn't worked either.

 

Is there a better way to save the calculation from each loop, or how do I appropriately load by text file after creating it in the same signal express project?

 

Thanks,

John Oxaal

0 Kudos
Message 1 of 5
(5,841 Views)

John,

 

Just to clarify, are you using LabVIEW, Signal Express, or both to accomplish this?  Could you also post your LabVIEW code or SignalExpress project to this forum.

 

To answer your first question, you should be able to store each phase shift data point to an array using the Insert Into Array function with a while loop that has a shift register.  Once your array is complete, you should be able to plot the phase shift values vs the index of your array (you will need to add 1 to the index when passing into plot).

 

Cameron T
Applications Engineer
National Instruments
0 Kudos
Message 2 of 5
(5,822 Views)

Cameron,

 

For now I am trying to accomplish this with Signal Express. I've only begun learning NI code for little over a week, and I found Signal Express easier to work with. However, since my goals are a little complicated, LabVIEW alone is probably the way to go. 

 

Take a look at my attached Signal Express project. I could add LabVIEW VIs to it, or try rewriting it in LabVIEW... whichever you think would be best.

 

Thanks,

John

0 Kudos
Message 3 of 5
(5,792 Views)

Thanks for sending the the project.  For now if you would like to easily integrate the setup that you have in SignalExpress into LabVIEW you can actually convert the project into LabVIEW code.  As long as the LabVIEW version is as late or later than your SignalExpress version, you can do this.  Please refer to document below on how to convert signal express project into a LabVIEW VI.

 

How Can I Generate a LabVIEW VI From My SignalExpress Project?:

http://digital.ni.com/public.nsf/allkb/96C01D2680084AAA86256F33007D98FA

 

 

 

 Once you figure out how to take in your data in LabVIEW, you can start placing your data in the array that I mentioned from which you can process the data.

Cameron T
Applications Engineer
National Instruments
0 Kudos
Message 4 of 5
(5,781 Views)

Thanks for sending the the project.  For now if you would like to easily integrate the setup that you have in SignalExpress into LabVIEW you can actually convert the project into LabVIEW code.  As long as the LabVIEW version is as late or later than your SignalExpress version, you can do this.  Please refer to document below on how to convert signal express project into a LabVIEW VI.

 

How Can I Generate a LabVIEW VI From My SignalExpress Project?:

http://digital.ni.com/public.nsf/allkb/96C01D2680084AAA86256F33007D98FA

 

 

 

 Once you figure out how to take in your data in LabVIEW, you can start placing your data in the array that I mentioned from which you can process the data.

Cameron T
Applications Engineer
National Instruments
0 Kudos
Message 5 of 5
(5,781 Views)