08-23-2010 10:05 PM
I want to use labview to realize a runtime serial control tool.
Please refer to my following source code.
I donot know why I just can use serial port at the beginning when i build and execute it. but i want the tool can automatic show the receiving serial data when I donot press stop button. I also want to realize paralled read serial date and write data to serial port.
Please help to point out any error, and give me an idea how can i realize a runtime serial control tool like hyperterminal.Thanks a million.
08-23-2010 11:05 PM
First, it looks like all you did is slightly modify the Basic Serial Write and Read example.
Second, if you want something to act continuously, you need to put a while loop around your code. Configure the port before the loop, close it after, and do the writing and reading inside the loop. To behave more like hyperterminal, you will probably need to use an event structure to handle keypresses and write data out to the serial port.
Before you do something that is sort of ambitious like recreating hyperterminal, I suggest you start smaller and just try to get some communication working with a serial device.
Also, start with some LabVIEW tutorials.
LabVIEW Introduction Course - Three Hours
LabVIEW Introduction Course - Six Hours
08-23-2010 11:09 PM
You have no loop or stop button so I have no idea what you are talking about. Do NOT use the run continuous button.
I would suggest an event structure. A value change event for the string to write with a VISA Write and place a VISA Read in the timeout event. You would be better using a shift register and concantanate string than writing new data all the time. Do not do a read if the number of bytes is 0.
You've mangled the shipping example by eliminating the termination characters. Right click and see the '\' Codes Display. Probably better to append on the block diagram antway.
08-23-2010 11:16 PM
Ravens ,Thanks, I get it. I should add a event struct and a while loop.
I will try this method immediately.
08-23-2010 11:18 PM
Yeah, Dennis, Thanks for your good suggestion.