12-31-2016 03:16 AM
Hello all, I am pretty new to labview coding, and still learning. I keep getting this error (Error 1 occurred at Scan From String (arg 1)). I have no idea why I am getting it, I checked the connections to the Vector network analyzer and they are all fine, my goal is to read frequency data from the analyzer. The code stops at the scan from string node.
Looking forward to hearing from you!
aas552
Solved! Go to Solution.
12-31-2016 06:59 AM
Hi aas,
I am pretty new to labview coding, and still learning.
Yes, as can be seen be the use of that huge stacked sequence structure.
Once you THINK DATAFLOW you will not be using the SSS anymore… 😄
(Hint: take the free learning resources!)
And why did you rename the subVI before uploading it to the forum???
Cleanup your VI to make it look like this:
I didn't remove the sequence completely as there is one subVI missing and so I couldn't expect DATAFLOW to handle everything in correct execution order…
The code stops at the scan from string node.
Which one? There is more than just one, in my image there are 4 ScanFromString functions visible…
Also: what is the string data you want to parse?
Please do some debugging using probes and highlight mode!
12-31-2016 07:28 AM - edited 12-31-2016 07:30 AM
Many many thanks! I am will be working on it. I am totally new to this as you see, right now I am doing the free online course and trying to fix the code.
Happy new year!
01-01-2017 03:16 AM
The error happens at the Start Frequency string node, I am tidying up the code already, but I am doing this in steps so I ran the first 3 sub VI's and there is no errors once I reach the last sub VI before start freq node I get the error (-1073807339 ) which I described earlier. Initially I thought my visa source was not matching between the last sub VI and the string node but its not. I can't tell what other reasons could be behind this. I will continue with tidying up the code, please let me know if there is any thing I can do. The last VI is attached that would be the end of the last part.
My goal is to get this code to run continously and for me to save the data of frequency vs time for my analysis. Many thanks again!
01-01-2017 09:13 AM
I don't have the manual for that instrument on my desk. Of course, you didn't link to it either.
What is FORMat4?
01-01-2017 12:56 PM - edited 01-01-2017 01:00 PM
@aas552 wrote:
The last VI is attached that would be the end of the last part.
This VI will not work as expected because of race conditions due to the blatant overuse of local variables. For example the local variable of R will get read way before the other part of the code has a chance to update the indicator, thus you get stale data and the outcome is unpredictable. Same for xtrunc and ytrunc. Get rid of the local variable and use wires to ensure correct execution order.
I have not looked at your other code, but I assume that there are similar glaring race conditions, so fix all these first.
Also, why do you think you need to divide 360 by 2pi 360 times (!) in a loop? Wouldn't once be enough?
01-03-2017 04:42 AM
Many thanks altenbach, the fit circle code is fine, its the main VI that is giving me the error.
I have tidied up my VI and now it looks more clear, I always have the error in the subVI NAreadwrite, and it carries on to the scan from string node Start Freq . In addition to the lab view error I am getting this messege on my VNA ( addressed to talk with nothing to say ).
Looking forward to your reply!
Best regards,
aas552
01-03-2017 04:55 AM
Hi aas,
the fit circle code is fine
No!
There are still local variables leading to race conditions. And one of the FOR loops isn't needed because of polymorphism…
I always have the error in the subVI NAreadwrite, and it carries on to the scan from string node Start Freq .
So you need to debug your NAReadWrite subVI! And you need to learn about error handling!
And NO, the error does NOT carry on to the ScanFromString node: there is NO error wire between them! ScanFromString produces it's own error because of BAD INPUT DATA!
Didn't I recommend to do some debugging before?
I have tidied up my VI
Well, apparently you don't like the AutoCleanup tool.
And you don't need this big sequence frame anymore…
01-03-2017 05:53 AM
Hello Gerd,
Many thanks for your reply! The fit circle always worked for me before I got this error, so I assumed it was fine. I will work on it.
Secondly, I am seriously new to this (never used labview before this month) so I am studying from a labview book, taking the online course as well and building smaller codes while fixing what I have from before.
This labview VI is based on a matlab code we had for the equipment, and my only explination could be that the command sent from labview is not understood by my device and thats may be why it stops there. My VNA screen has this messege every time I try running my VI (Addressed to Talk with Nothing to Say)
I will continue working on your valuble comments.
Many thanks,
aas552
01-03-2017 01:40 PM
@aas552 wrote:
Many thanks for your reply! The fit circle always worked for me before I got this error, so I assumed it was fine. I will work on it.
It is definitely not fine! If the values of the indicators only change little between calls, you might get results that are only slightly wrong (the worst kind of bug, because it is hard to detect!). Even if it works correctly now, it could fail after tiny changes in the future. (e.g. a recompile caused by a edit operation elsewhere, an upgrade or downgrade to a different LabVIEW version, running on a computer with a different number of CPU cores, etc.)