LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Concatenate series of chars

Solved!
Go to solution

@Baioneta wrote:

That doesn't work, simply because of the 1st question I asked. The visa reader is getting each char at a time, I have to put it all together and then analyze it.

 

 


Did you program it like I have shown?  It is a snippet so you can drag and drop that image into the block diagram of a blank VI.  The VISA read won't be getting each character at a time if you ask for enough characters.

0 Kudos
Message 11 of 24
(2,041 Views)

I can't run it. 

 

LabVIEW:  An input parameter is invalid. For example if the input is a path, the path might contain a character not allowed by the OS such as ? or @.

0 Kudos
Message 12 of 24
(2,039 Views)

That error doesn't make sense.

 

Here is the VI attached as a .vi file.

0 Kudos
Message 13 of 24
(2,034 Views)

Now there's a different one

 

LabVIEW:  Scan failed. The input string does not contain data in the expected format.

0 Kudos
Message 14 of 24
(2,032 Views)

I don't get it, everything looks fine but I can't run it. I checked the serial configurations, the data sizes, ...

0 Kudos
Message 15 of 24
(2,030 Views)
Solution
Accepted by topic author Baioneta

Done.

 

Problem solved, maybe it ain't the best solution but it works...

 

Basically what I did was a function to count the number of lines and then scan the line I want.

 

 

0 Kudos
Message 16 of 24
(2,027 Views)

Instead of continuing to try to force your version of the VI to work which I told you had problems with it, why didn't you actually try to use mine.  I told you the bytes at port method was wrong, and it made no sense to continually redefine the termination character on every loop iteration, yet you don't listen.

 

I'm glad you think you got it working, but in reality there are still so many things wrong and the code is a hack job trying to make it work the way you are trying to do it.  It is just a matter of time before something else will occur that keeps it from working and you'll have to hack something else together.

 

There is no reason for that scan from string error to occur unless you aren't getting the data you think you are getting, or you didn't set the format string correctly.  I'm sure that problem would've been solveable if you posted the VI with actual received data, but whatever.

0 Kudos
Message 17 of 24
(2,022 Views)

Your help was very nice but somehow I couldn't make it work, I'll try to modify those things you said.

 

I did post the received data, in a picture where you can see the string sent by the mcu. 

 

 

0 Kudos
Message 18 of 24
(2,019 Views)

The scan string looks the same in your image as it did in the one I pulled from your VI.  So there is no reason for that to cause an error.

 

I do see data, but it is only a screen shot which makes it impossible to try out in code.

 

But something doesn't look right in your screen shot.  It looks like "tempo" came out as 0, but is 1 in the data.  And "tenso" also came out as zero, but looks like it has a value in your data.

 

Are you sure you aren't getting an error with your VI but disabled automatic error handling?

0 Kudos
Message 19 of 24
(2,015 Views)

The string is something like this:

 

!14R448.373V1.548$  2  0

 

The first char(!) is the start char

The 2nd and 3rd is the number of chars that will be sent untill ($)

those in orange are R (stands for resistor) and the value of the resistor

those in purple are V (stands for voltage) and the voltage value

$ is the finall char

2 is the seconds between Analogue to digital conversions

0 is the channel of the analogue multiplexer

 

So this means this values can change all the time, except ! and $

 

This is the reason why I want to scan the string, to check this values...

 

 

The scan string looks the same, but I get those errors, I don't know why

 

0 Kudos
Message 20 of 24
(2,013 Views)