cancel
Showing results for 
Search instead for 
Did you mean: 

Condition labview

Condition labview

Message contains an attachment

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.

11 REPLIES 11
GerdW
Knight of NI

Re: Condition labview

Message contains an image Message contains an attachment

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
crossrulz
Knight of NI

Re: Condition labview

Message contains an image Message contains an attachment

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



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

Re: Condition labview

Message contains an attachment

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.

Re: Condition labview

Like that? What passes for the false part?

Re: Condition labview

Message contains an attachment

i dont send the screen -_-

crossrulz
Knight of NI

Re: Condition labview


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



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

want stop when i have a certain character

Message contains an attachment

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.




Re: Condition labview

????

Re: Condition labview

that dont work , so nobody can help me?