Well it is a driver for the DSA1030A.
Start & Reset here I take the control of the instrument and I do a query and a reset the registers
Auto/Manual: the user decide which kind of execution have. With the manual he can choice in which range of frequency do his analysis, instead the automatic will do an analysis in all the ranges.
Config: I disable the table I see on the instrument. After that I wait for a change of values if the user has choosen manual instead the VI goes on alone if the choice has been automatic and start to set the frequency ranges of the analysis.
MaxHold&Peak table Here the user set a waiting time (that I want have the chance to stop if something is wrong) and here start the mess. In particular I do an analysis on all the values of the string coming out from the query :TRACe:MATH:PEAK?
Final Resul I do an analysis to see if the Peaks I got from the MAxHold&Peak table are under or over a threshold and to see if it is the carrier.
Close here the user can choose if do another analysis or stop the VI/comunication with the instrument
I suppose that the problem is in the close. As I told after the first iteration the elapsed time stop correctly at the time I set (for example 1) but in the second iteration it has a strange behaviour. I hope you can give me some tips to understand where the problem is.
Since I was not so sure if the problem was there or not but I know how lazy I am... I followed your way to reset but like you I clicked Used Default if Unwired... I did another try and this time I have wired everything...and... it works!!!
EDIT: now I want to understand one thing. I did the reset in my first try but I stopped myself on the first while loop, why did you create the shift register also in the second while loop?
Correct me if i'm wrong
1.The problem you want to solve is in MaxHold&Peak?
2.What you mean by "Here the user set a waiting time (that I want have the chance to stop if something is wrong) " is that the user can set a waiting time but if something goes wrong you can stop(something)?
- Regarding this point i have something for you to clarify
1. Waiting time in this case, Can you clarify how you want the program to wait and why the program need to wait?
2. If somethins is wrong? Can you give me an example of "something"(I assume it is an error)? Moreover how can you tell your program that something is occur?
3. You want to stop when something is wrong? What you want to stop? The whole program or a part of the code?
3. How can you check whether the elapsed time has a strange behaviour? Can you attached the VI that include the method you use to check (also please show me how you reset the elapsed time in this vi)?
What i suspect is that the problem still come from the Elapsed time combine with some part of your vi (as you said it still has a strange behaviour).
1- No, I want to be able to stop the VI when the user says ok I want to stop and at the same time I want to stop if some particular conditions occurs.
2-About these particular conditions I was talking about it could be for example that you set I want to wait 24hours, you launch the program but you see that you did a mistake setting, for example, the RBW or other parameters that the user can choice.
Why does the user need the waiting? well because it must wait that the spurs ( I hope that this is a correct translation..if not translate it like "errors in the signal") occur and sometimes you can see them after a long wait.
Perhaps I think that the unwired connections create some problems. That's the reason why it didn't work at the begining. Could you please explain me why did you set two shift registers?
Great to hear that it works as expect right now!!!
For the shift register in the outer while loop, apologize me for make you confuse, as i try to make it quick so it just my habit of doing this hehe.