bjarket Posted December 13, 2006 Report Posted December 13, 2006 Hi! I've studied the simple serial communication examples in LabVIEW and knows how to set up and close a connection. But how do I take the next step? What is good programming practice when developing a routine for serial communication? My application is about streaming data via RS232, and I would appreciate references for further development /Bjarke Quote
EJW Posted December 13, 2006 Report Posted December 13, 2006 Hi!I've studied the simple serial communication examples in LabVIEW and knows how to set up and close a connection. But how do I take the next step? What is good programming practice when developing a routine for serial communication? My application is about streaming data via RS232, and I would appreciate references for further development /Bjarke It will mainly depend on what type of data you are streaming and what you are streaming from. Many serial devices have their own way of sending data and you need to know how to decode the data as it is received. After you have determined what type of data it is sending you and how to properly decode it, you can then build an appropriate program around it. Quote
bjarket Posted December 13, 2006 Author Report Posted December 13, 2006 It will mainly depend on what type of data you are streaming and what you are streaming from. Many serial devices have their own way of sending data and you need to know how to decode the data as it is received. After you have determined what type of data it is sending you and how to properly decode it, you can then build an appropriate program around it. So true! I'm building both the transmitter and receiver, so I can pretty much decide everything... The data to be sent is both measurements taken from a DAQ device and commands to start and stop measuring. I see a lot of different possible solutions and could go from there. However, my question was intended to be more general than that. I'm interested in dos and don'ts such that I can improve the quality of my code... Quote
EJW Posted December 13, 2006 Report Posted December 13, 2006 However, my question was intended to be more general than that. I'm interested in dos and don'ts such that I can improve the quality of my code... Check out the following links, they should be a good starting point for you. NI-VISA Overview 9-Bit Serial Writing in LabVIEW Accessing one COM port from diffrent locations within a VI Async Serial I/O Using Events and VISA COM Interface Quote
Neville D Posted December 13, 2006 Report Posted December 13, 2006 Hi!I've studied the simple serial communication examples in LabVIEW and knows how to set up and close a connection. But how do I take the next step? What is good programming practice when developing a routine for serial communication? My application is about streaming data via RS232, and I would appreciate references for further development /Bjarke Do a websearch for Scott Hannah's Serial Server routines in LabVIEW. They are an example of well-written code that can read/write serial data. Any other improvements really depend on your application. Are you JUST reading and writing? Do you need to analyze the data? What is the Baud rate/Data Rate? In the past, I had a very high data rate serial application with lots of display/file write/analysis. About 20 plots, over 200 variables, and data at 10Hz from the device. There I had two loops, a very fast serial loop, and a slower parse/display/write loop. The 2 loops communicated via 2 separate Q's. One for data read from the device and another for sending commands to the device. Both loops were state-machines. Sorry can't post any code. Neville. Quote
i2dx Posted December 14, 2006 Report Posted December 14, 2006 some time ago, I have written a RS232 demo. You can find the (LV 7.1.1) code here Quote
bjarket Posted December 14, 2006 Author Report Posted December 14, 2006 Thank you all for great replies!!! Now it's time for reading :-) 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.