12-25-2010 02:38 PM
hi..im currently doing some data logger involving labview..here the data such as voltage,current,temperature and etc will be send from microcontroller to a pc by using serial com. im using labview serial write and read.vi example to grab the data..data that i received is in HEX display..so the question is how do i modified this vi to make sure all of the data are arrange in correct order and save it to spreadsheet?
12-26-2010 11:15 AM
hi hohoi,
I think in your program of reading data from serial port,you must be using a while loop.Then you just wire the string output from the VISA Read.vi to the border of while loop and enable indexing.Then place a write to spreadsheet.vi ,configure it for string input,make transpose as true and wire the string ouput from the while loop to the string input of write to spreadsheet function.
thanx and regards
srikrishnaNF
12-26-2010 11:25 AM
@srikrishnaNF wrote:
hi hohoi,
I think in your program of reading data from serial port,you must be using a while loop.Then you just wire the string output from the VISA Read.vi to the border of while loop and enable indexing.Then place a write to spreadsheet.vi ,configure it for string input,make transpose as true and wire the string ouput from the while loop to the string input of write to spreadsheet function.
thanx and regards
srikrishnaNF
Well, that won't do much good in decoding the data.
The hex data can be converted using the String to Byte Array. From there, you can index the array and get the different elements. After that, it depends on how you encoded the data with the micro. It also depends on whether you have done something such as only sending data only at the request of the pc. If you just constantly send data, very difficult to determine which bytes you read are voltage, current, etc.
12-26-2010 11:37 AM
how do i index the data?
the data such as voltage, current, temp and etc will keep sending to the pc randomly..so how do i arrange them accordingly?
im not so good in labview 😞
12-26-2010 11:55 AM
Change the way the data is sent. The problem is not with the LabVIEW side. If you have no idea what byte x is, you can't 'arrange' them.
As I said, one way is only send when requested. Another is to use a prefix/suffix that you make sure does not appear in the data. Another is to send the data as ASCII with a terminator (i.e. V=xx.xCR)
12-26-2010 01:02 PM
attached is my Hex display after the random send from my motor controller and the other one is my motor controller datasheet
can u show me how i can arrange it based on the given register used in that datasheet?
12-26-2010 01:33 PM
Have you been paying any attention at all to what I've said? If the instrument is sending random data, you CANNOT decode it. There is a command that you can write to the controller and it will resond with data in a known order. Try that.
In the future, do not post an image that has no meaning, Pst the actual VI or a snippet (look it up).
12-28-2010 04:45 PM
When you say random send from the controller do you mean that it sends a packet periodically at random intervals? It sounds to me like you simply want to know how to index the fields. Is that what you are asking?
This example vi will take a tab delimited string and convert it to an array of strings. It then uses the index array function.
01-19-2011 11:41 AM
HI,
I am a beginner to Labview, and I want to create a GUI application in Labview where the user can enter the flowrate for the infusion pump , so I want the microcontroller (HCS12) to read the data(flowrate) and start running the program which is in microcontroller. Through my research I found that I have to configure the VISA write but dont know how to proceed ahead. Please help me this is my final year project..
03-24-2011 04:27 PM
Which Microcontroller you are using ?