LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Scan from string error

Solved!
Go to solution

Hi,

 

I need to read 8 voltages from an microcontroller DaQ system via RS232 protocol. I made an Vi which I read data from DaQ system, and I use scan from string to match each value of voltage. My vi only work if the delay in the case loop where is the scan from string function is more than 1000 ms, also when is small, like 100 ms, I get an error like the one attached. How can I solve this? I need to use this delay of 100 ms, because after I want to print this values in a ascii file. I hope you understand my problem and you will provide me a solution.

 

Thank you and  best regards

Download All
0 Kudos
Message 1 of 5
(3,007 Views)

I can't open your file (sitting with LV2011 currently), but it sounds like you're not using End of read-character and/or read a set number of characters, which typically gives problems similar to this.

Set up your RS232 to use End of read-character and set Visa Read to a large enough number to read the full message (i usually set 100 chars even if the message is 20 chars).

How does the read information look like, set a Read buffer indicator to \\-mode so you can see if you have some dirt characters making it hard to interpret.

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 2 of 5
(2,995 Views)

Hello, Yes I don't have  a number of  chars to be read in visa read block, I\ve used a  property node. I have attached  the VI for LabVIEW 2011. 

 

Later edit: and this is  my data  from DaQ  system: "Z1.031\r\n\n0.025\r\n\n1.521\r\n\n0.000\r\n\n1.792\r\n\n0.030\r\n\n3.308\r\n\n0.118\r\n\n"

0 Kudos
Message 3 of 5
(2,978 Views)
Solution
Accepted by topic author vlad.mihai

Change the interpretation to use a String to Array, and don't forget to remove the 1st 'Z'. See attachment.

ScanFromString.png

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
Message 4 of 5
(2,959 Views)

Hi, i solve the problem with  a constant in VISA read block for number of bits. Thank you.

0 Kudos
Message 5 of 5
(2,882 Views)