karmapayback Posted October 22, 2004 Report Posted October 22, 2004 Hello. Thanks for looking in on my questions. Let me first describe what I am trying to accomplish. I am building a telemetry system for a radio controlled helicopter. The system will include an onboard unit to sample data and transmit it to my laptop. Labview will be the interface for the user: a virtual instrument cluster with gauges, etc showing the status of the aircraft. The onboard system is a PIC microcontroller. It is sampling data from four sensors (temp, RPM, Acceleration,Altitude). The data is then sent out serial, rs232, to my computer. I have controll over what the microcontroller trasmits, so: Is there a certain way I should format the data so that my life is easier? Currently, I am sending a letter to signify the data point (T) and then the data (69.02) . The serial stream looks like ...T69.88R100T69.97R120..... (Only two data shown for simplicity) The stream never stops as the microcontroller is set into a loop and samples and transmits. I am able to read in the data using the measurement and automation explorer, but when I try to use the I/O Assistant, it does seem to read the data and drops a timeout error. The error says "timeout before completion". I am imagining that the I/O assistant is having problems deciding where the string begins and ends. Thus, my next question, Do I need an end of transmission identifier in the stream (/r/n)? I have all of the serial parameters matched up(baud, parity, etc). I have created a vi that runs to some extent using VISA operations(I/O, Bytes at port.vi, VISA Read, split string, etc). It only works right on step by step mode. Once I try to run it normally, it seems like none of the VISA operators are working right. Essentially, the string does not seem to get passed through the VI. I think I have a good idea of what to do with the data once I get it coming in correctly. It just seems like what I have set up is ghetto and simply doesnt work right. Other details, I am not using a DAQ, as they cost a fortune. I have an rs232 to USB adapter. It essentially emulates a serial port. It seems to work fine as I am able to read in data in a Measurement and Automation explorer VISA session. Let me know if you have some advice. Thanks for reading. Jeremiah. Quote
JackHamilton Posted October 22, 2004 Report Posted October 22, 2004 I would recommend a 'packet' format so telemetry is emitted in bursts. Using \r\n termination is good to know where a packet ends - you should consider unique characters or a fixed packet length to know where a packet begins. Fixed length is better - even if you have to padd with zeros. Then you configure the serial port get 2x the packet size with the proper termination. This way you'll get a full packet. Sound like a nice project! you should include a GPS! Quote
karmapayback Posted October 22, 2004 Author Report Posted October 22, 2004 Thanks for your reply. When you say to configure the serial port to get 2X the packet size, is that accomplished with a particular function, say VISA configure serial port, or is that something that the I/O Assistant will help me with once it reads in properly? Thanks. Jeremiah And GPS is a distinct possibility. I have found a GPS module that is inexpensive and I have found the Microcontroller code already written. I think once the other sensors are functioning, I will add GPS. This is my senior project for EE at San Jose State, so little extras like GPS help secure a good grade. JP Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.