LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Condition labview

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.

0 Kudos
Message 1 of 12
(1,917 Views)

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)!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 12
(1,909 Views)

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


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 3 of 12
(1,864 Views)

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.

0 Kudos
Message 4 of 12
(1,856 Views)

Like that? What passes for the false part?

0 Kudos
Message 5 of 12
(1,849 Views)

i dont send the screen -_-

0 Kudos
Message 6 of 12
(1,848 Views)

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


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 7 of 12
(1,824 Views)

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.




0 Kudos
Message 8 of 12
(1,809 Views)

????😩

0 Kudos
Message 9 of 12
(1,794 Views)

that dont work , so nobody can help me?

0 Kudos
Message 10 of 12
(1,793 Views)