LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

check custom string received via Serial

1 Have attached a labview program. 

2. Data received is in pic attached. Two lines are received at a time. 

i.e 

numRoute:0001 addr:40bc time:18d2b2 hops:01 seqno:0259 size:0020
0c2f 0c2e 0c2e 0c2f 0c2e 0014

 

3. Want that string received matched the data and if format matched then display it , get the info and wait for string.

 

4. How to match the string received as mentioned in 2?

Download All
0 Kudos
Message 1 of 4
(829 Views)

@Vindhyachal.Takniki wrote:

3. Want that string received matched the data and if format matched then display it , get the info and wait for string.

 

4. How to match the string received as mentioned in 2?


It looks like you are already doing this.  Are you not getting the results you want?

 

But for parsing that second line, I would just use Spreadsheet String To Array with a format of "04x" to create your array of U32.


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 2 of 4
(781 Views)

Currently what i am doing is receiveing one line at a time.

But in actual what happens is outside system send two lines at a time :

a) NumRoute:  line

b) data line 

 

 

Need to receive both together so that information of both are not mixed. Current VU has issue that sometimes when 2nd line received of first data set & then 1st line of second data set. Both get mixed.

 

Issue is both lines have enter at their end. How to reeive two data lines at once?

0 Kudos
Message 3 of 4
(744 Views)

Hi Vindhy,

 


@Vindhyachal.Takniki wrote:

But in actual what happens is outside system send two lines at a time :

a) NumRoute:  line

b) data line 

Issue is both lines have enter at their end. How to reeive two data lines at once?


You need to read two lines: use two VISARead calls and the NL as termchar…

 


@Vindhyachal.Takniki wrote:

Need to receive both together so that information of both are not mixed. Current VU has issue that sometimes when 2nd line received of first data set & then 1st line of second data set. Both get mixed.


But you still know the order of those lines!?

When you receive the "2nd line" first then you know it belongs to the previous dataset…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 4
(721 Views)