03-02-2010 10:54 AM
Hi everybody,
I've got a microcontroller board here which sends some text over RS232. For example
[quote='HTERM']
UART'4': Key SW2 pressed<\r><\n>
UART'4': Key SW2 pressed<\r><\n>
UART'4': Key SW2 pressed<\r><\n>
UART'4': Key SW2 pressed<\r><\n>
UART'4': Key SW2 pressed<\r><\n>
[/quote]
In LabView I can see
[quote='LabView']
UART'4': Key SW2 pressed
[/quote]
I think I need some kind of buffer. I compared my VI to a LabView made hyperterminal. I filtered all the receiving thins out and optimized my own VI but it won't make several lines like it has to make it.
I attached my and the terminal (hyperterminal) VI. Maybe someone know why it won't work or rather where the differences are.
Kind regards,
Marc
03-02-2010 11:04 AM
03-02-2010 11:08 AM - edited 03-02-2010 11:10 AM
Hi Marc,
please read the context help for "Configure serial port"! Here you can set a term[ination] char - and the default is "Use term char"=True and "term char"=\n. The help also says how to change those parameters...
If you switch off term char, you should receive \n\r too in your output string.
Edit:
Ok, Dennis beats me by some minutes - but basically we are advising exactly the same
03-02-2010 11:11 AM
Thank you. It works better but not as fine as it should:
[quote='LabView']
'4': Key SW2 pressed
UART'4': Key SW2 pressed
UART'4': Key SW2 pressed
UART'4': Key SW2 pressed
UART'4': Key SW2 pressed
UART'4': Key SW2 pressed
UART'4': Key SW2 pressed
UART'4': Key SW2 pressed
UART'4': Key SW2 pressed
UART'4': Key SW2 pressed
UART'4': Key SW2 pressed
UART'4': Key SW2 p
[/quote]
After about 30sec the text disapears. I took another look at the terminal.vi. There I saw a shiftregister for the output string. I will compare both VI's in a few minutes again and try to implementate a shiftregister. I think it would work then.
03-02-2010 11:14 AM
03-02-2010 12:44 PM - edited 03-02-2010 12:45 PM
I found a solution that works. But the main memory of my virtual winxp is too small to handle it
(192MB). Hm after a restart (the program crashed) it works fine :D.
[quote="LabView"]
UART'4': Key SW2 pressed
UART'4': Key SW2 pressed
UART'4': Key SW2 pressed
UART'4': Key SW2 pressed
UART'4': Key SW2 pressed
UART'4': Key SW2 pressed
UART'4': Key SW2 pressed
UART'4': Key SW3 pressed
UART'4': Key SW3 pressed
UART'4': Key SW3 pressed
UART'4': Key SW3 pressed
UART'4': Key SW3 pressed
UART'4': Key SW3 pressed
UART'4': Key SW3 pressed
UART'4': Key SW2 pressed
UART'4': Key SW2 pressed
UART'4': Key SW2 pressed
UART'4': Key SW2 pressed
UART'4': Key SW2 pressed
UART'4': Key SW2 pressed
UART'4': Key SW2 pressed
UART'4': Key SW3 pressed
UART'4': Key SW3 pressed
UART'4': Key SW3 pressed
UART'4': Key SW3 pressed
UART'4': Key SW3 pressed
UART'4': Key SW3 pressed
Welcome to UART4 of the SK-FR-144PMC Evaluation-Board
================================================================
After Reset => 7-Segm. LED-Display shows counter
Key SW2, SW3 will change count direction
UART'4' will be echoed
UART'5' will be echoed
UART'5' will be send to CAN with ID #3
CAN ID #2 receive will be send to UART5
Key SW2, SW3 will result in UART output
================================================================
[/quote]
Maybe someone would take a look 🙂
By the way: How's my english? Every time I have the chance I try to get some response about it 🙂
Thanks for helping me
Best regards,
03-02-2010 01:55 PM - edited 03-02-2010 01:57 PM
Hi Marc,
some points:
- You should initialize the shift register. Use an "empty string" constant for this purpose...
- You collect data in your while loop. As the loop may run for a long time the collected data may grow and use a lot of memory. In fact it uses memory twice the size of the string, one buffer for the shift register and one for the string indicator! Sooner or later you get a "memory full" error as you have a buffer allocation in your code. (Btw. LV isn't showing a buffer allocation on the "Concat string" function, but IMHO there should be an allocation... Maybe the allocation is done in the shift register). So you should implement some mechanism to limit memory usage of string display.
- The program itself should start with as little as 1kB of memory buffer. Don't know why it should crash on first start. But see second point.
- Implement some more error detection. No need to run the loop endlessly when the VISA commands return an error (like on my computer, don't have a COM3 port).
Your English seems ok for me - but I'm not a native speaker...
03-02-2010 02:01 PM
Thank's for your answer. I know, there has to be some more mechanism and a initialization for the shift registers. It was just a test how easy it is to handle the COM Port.
In the next step I'm making a kind of monitor for several measured data from a race car. There a microcontroller sends the speed, labda value, oil pressure, oil and water temperature and so on over RS232. The challenge is to visualize the data. There I want to make some more security mechanism for the memory.
Thank's for helping 🙂