LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

End of data in serial Communication

Hi,

  Am using Pic controller and labview for visual inspection of my sytem. Am controlling 4 Motors using my PIC controller.I have interfaced my pic controller with labview through NI_VISA. Snippet represent the manual serial data communication.When I connect my PIC controller with Labview data follows continously. Now i want to differentiate 1st set of data from 2nd set. Plz help me guys.. Thanks in advance

Download All
0 Kudos
Message 1 of 9
(4,707 Views)

Need to hit some issues with the serial port communications first.  Is the message length always 8 bytes? If so, you do not need the delay nor the Bytes At Port.  Just tell the VISA Read to read 8 bytes and it will wait for them to come in.

 

You really should give us more information on the communications protocol you have set up.

 

So you want to keep a history of the data?  How far back do you want to view the history?  How long will this run for?


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 9
(4,663 Views)

Hi velkumar,

 

another reason to get rid of BytesAtPort: you have explicitely enabled the TermChar!

So you just need to wire a sufficient high number at "Bytes to read" at VISARead…

Best regards,
GerdW


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

@GerdW wrote:

another reason to get rid of BytesAtPort: you have explicitely enabled the TermChar!

So you just need to wire a sufficient high number at "Bytes to read" at VISARead…


I almost wrote that myself.  Then I looked at the data being read.  There were 8 bytes read, all of which were data.  Therefore there was no termination character.  This is one of the reasons I asked for more clarification on the protocol being used.


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 4 of 9
(4,634 Views)

Except the scan from string shows a format string of /%d/%d/%d/%d.   Is the forward slash some sort of delimiter between data items?  (Kind of an odd choice.)

 

The OP must have put in in there for a reason.  A reply back that clarifies what the data looks like certainly would help.

0 Kudos
Message 5 of 9
(4,615 Views)

hi ,

   Byte at the port is variable. No I dont want to save my history. when I connect PIC controller with labview, the data will be sent continously from PIC controller. I just want to process the data. For eg: If the data from the PIC controller is 1111 0010 , 1st I want to process HSB ie. 0010 and later that opertion I want to process LSB ie. 1111. For each loop i wil get data from PIC controller, so i want to process the HSB 1st and then LSB.

0 Kudos
Message 6 of 9
(4,549 Views)

Hi velkumar,

 

If the data from the PIC controller is 1111 0010 , 1st I want to process HSB ie. 0010 and later that opertion I want to process LSB ie. 1111.

You can try this:

check.png

I prefer "HSB" (H = high) for th eupper bits in a byte and "LSB" for the Lower bits…

Best regards,
GerdW


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

@GerdW wrote:

Hi velkumar,

 


I prefer "HSB" (H = high) for the upper bits in a byte and "LSB" for the Lower bits…


Never heard of HSB before.  I think saying LSB for the lower bits is too confusing when everyone knows of it has Least Significant Byte.

 

Just using the word byte is inaccurate because each 4 bits in a byte are known as nibbles.

 

 

0 Kudos
Message 8 of 9
(4,519 Views)

@RavensFan wrote:

@GerdW wrote:

Hi velkumar,

 


I prefer "HSB" (H = high) for the upper bits in a byte and "LSB" for the Lower bits…


Never heard of HSB before.  I think saying LSB for the lower bits is too confusing when everyone knows of it has Least Significant Byte.

 

Just using the word byte is inaccurate because each 4 bits in a byte are known as nibbles.

 

 


So the accurate sayaing here is MSN and LSN (Most Significant Nibble and Least Significant Nibble).  Yes, I have used these acronyms before.


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
Message 9 of 9
(4,508 Views)