03-19-2016 01:28 AM
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
03-19-2016 09:08 AM
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?
03-19-2016 11:31 AM
03-19-2016 11:36 AM
@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.
03-19-2016 12:33 PM
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.
03-21-2016 05:50 AM - edited 03-21-2016 06:16 AM
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.
03-21-2016 06:28 AM - edited 03-21-2016 06:28 AM
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:
I prefer "HSB" (H = high) for th eupper bits in a byte and "LSB" for the Lower bits…
03-21-2016 08:14 AM
@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.
03-21-2016 10:22 AM
@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.