04-02-2011 01:50 AM
I am using labview 8.6. I use VISA to get data from my serial device.am facing a problem of not getting a correct information from my device.currently i dont have a device so am just using another PC to get data from hyperterminal but the problem is what i write in the hyperterminal is not what i receive in my VISA read.there are some data which are lost so i dont get a correct information.i started with configuring my serial port,then VISA write,then VISA read,then i closed the session.configurations at the configure serial port VI matches with those in hyperterminal
04-02-2011 09:54 AM
Precisely how 'incorrect' is the data? What is the data that is lost? Typically in this sort of test, your read would be in a loop where you use the VISA Bytes at Serial Port.
04-04-2011 02:17 AM
what i mean by saying incorrect data is,example i write the sentense "im going to school" at the read buffer in VISA read vi i wont get the whole sentense,i can get "im going t" the other segment of the sentense is lost.I have put my VISA read vi in a while loop
04-04-2011 06:22 AM
04-04-2011 07:57 AM
One parameter to be taken into consideration is the "timeout" in VISA and if its configured correctly, then the data you are getting is either the NRdata or an unformatted ASCII type data. something like this -- #FFA4@fhxf$#$# which you need to convert properly.
04-04-2011 08:57 AM
Actually am using a default timeout which is ten seconds,but when using another PC sending something using hyperterminal i get timeout error and i dont know how to solve this, or should i increase the timeout?may be someone could help me on how the output from the serial device and the timeout relate.
04-04-2011 08:25 PM
Hi nnko,
Maybe if you post this segment of your code, we would be able to help you out a little bit better. Also, you could always try an NI-SPY capture to see if all of your characters are making it to the VISA driver.
04-04-2011 10:46 PM
That timeout error will not cause any trouble, i tried sending and receiving data serially using hyperterminal and i got the data transmitted properly. I dont know why you are unable to tx/rx data.
Do one thing, just store/save the data in a TDM file thats coming in and analyse it.
You can use DIAdem for that purpose.
04-06-2011 04:19 AM
what am facing right now is,i want to save readings from my serial device which gives readings every after ten seconds and it give out 4 bytes each time. I have set a byte count in my VISA read to file vi equal to 4 and i have put VISA write,VISA read and VISA read to file in the same loop. I have chosen notepad to be my file to save readings from my device. but the problem is example firstly my device give the output of 3423 it will be saved into my notepad but after ten second when another reading come let say 4567,the first one is overwritten and this will go on continously so my notepad will be saving just the last readings from my device. what should i do to solve this?
04-06-2011 04:28 AM
What am facing right now is i want to save measurements from my device in a notepad.my device gives out 4 bytes every after ten seconds. in VISA read To File vi i have chosen byte count to be 4. The problem is example the first reading from my device is 3234 it will be received and it will be saved in a notepad file.but when the second reading come it will overwrite the previous one so the notepad will be saving just the last reading. I have put VISA write,VISA read and VISA read to file VIs in the same loop. the timeout is ten seconds. so what should i do so that i will be able to save all data in a notepad without overwritting?