LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Error 1 occurred at Scan From String (arg 1)

Solved!
Go to solution

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

Download All
0 Kudos
Message 1 of 11
(5,520 Views)

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:

check.png

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!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 11
(5,477 Views)

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!

0 Kudos
Message 3 of 11
(5,473 Views)

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! 

0 Kudos
Message 4 of 11
(5,427 Views)

I don't have the manual for that instrument on my desk.  Of course, you didn't link to it either.

 

What is FORMat4?


"Should be" isn't "Is" -Jay
0 Kudos
Message 5 of 11
(5,407 Views)
Solution
Accepted by topic author aas552

@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?

0 Kudos
Message 6 of 11
(5,395 Views)

Many thanks 

 

Download All
0 Kudos
Message 7 of 11
(5,353 Views)

Hi aas,

 

 

 

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 8 of 11
(5,350 Views)

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

0 Kudos
Message 9 of 11
(5,342 Views)
Solution
Accepted by topic author aas552

@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.) 

Message 10 of 11
(5,324 Views)