06-16-2021 04:43 AM
Hello,
I have to create a condition here ,I have to create a loop that waits for M , I have to look for the character "M" which is my first string character and as soon as I find M I take the characters until we see "E" the end character .
as soon as I see "M" I stop and do the treatment.
help.
06-16-2021 05:01 AM - edited 06-16-2021 05:04 AM
Hi Debutante,
@DébutanteLabVIEW wrote:
I have to create a condition here ,I have to create a loop that waits for M , I have to look for the character "M" which is my first string character and as soon as I find M I take the characters until we see "E" the end character .
as soon as I see "M" I stop and do the treatment.
Right now your VI looks for "T1:" and "T2:" to recognize a "full message".
All you have to do is to replace this by code looking for "M" and "E"…
What have you tried? Where are you stuck?
Btw. in general it helps to cleanup the block diagram to better understand the code:
Why do you read the serial port byte by byte? You configured a TermChar, so you should read full messages by requesting substantially more bytes (like 999)!
06-16-2021 06:31 AM - edited 06-16-2021 06:32 AM
@DébutanteLabVIEW wrote:
I have to look for the character "M" which is my first string character and as soon as I find M I take the characters until we see "E" the end character.
I would set it up something like this. The idea is to read 1 byte at a time until you read the M. Once you read the M, read the rest of the message (termination character set to be E) and then parse that message.
06-16-2021 06:54 AM
that’s what I’ve been trying to do, my teacher told me I had to do a loop that waits for "M" and then does the treatment and stops when we have "E", he told me to do a condition at the top left of my LabVIEW , that I will have to make a 3rd line of regex parallel to the other two.
We do our best to be sure to get the full string because labview can launch in the middle of the buffer so not necessarily start with the beginning of the string.
06-16-2021 07:15 AM
Like that? What passes for the false part?
06-16-2021 07:17 AM
i dont send the screen -_-
06-16-2021 08:16 AM
@DébutanteLabVIEW wrote:
Like that? What passes for the false part?
The FALSE case just passes the VISA Resource and error cluster through. But it is in the TRUE case that you parse the message, however that should be done.
06-16-2021 09:10 AM
Hello,
I have to create a condition here ,I have to create a loop that waits for M , I have to look for the character "M" which is my first string character and as soon as I find M I take the characters until we see "E" the end character .
as soon as I see "M" I stop and do the treatment.
06-16-2021 09:33 AM
????😩
06-16-2021 09:34 AM
that dont work , so nobody can help me?