08-26-2011 10:12 AM - edited 08-26-2011 10:17 AM
HI
i beginner in labview 2009.
i should monitoring RS232 port.i use "Basic Read and write" vi in labview but i cant on-line monitor port.
i don't know when data receive in pc port.
i should show temps and values that AVR micro send to PC.but i don't know when AVR send data to pc port.
i Connected Tx and Rx and GND to PC port. and set another parameters.
i change time out port to 120 millisecond but data isn't true and i lost some data.
--
" How to detect that data receive from RS232 in LabVIEW 2009?"
i use VISA and want to detect when data receive in port com in PC.
i use "Basic Serial Read and Write " in labview but this program has delay and dose not online??
how can i read or write data in port com(RS232) on-line ?
i want to monitor on-line port rs232 ?
my program is Here
Solved! Go to Solution.
08-26-2011 10:59 AM
Do NOT link to some odd third party site. Just attach your file here unless of course it's just the example you mention. No sense posting something that every one has.
Knowing when there is data available is a trivial task. You can simply use the VISA Bytes at Serial Port. That's in the example so I don't understand your question. If you are never seeing any bytes available, check to see if your cable is wired correctly - null modem or straight through.
08-26-2011 12:03 PM - edited 08-26-2011 12:09 PM
Hi
sorry .i attached file.
i receive data , but i don't when micro controller send data.in some times i receive 20 byte , some times 40 byte and ... .
how can i detect when micro send data to PC?
i want to process data , when micro write data to PC port (com)?
how to make my program to read data?
in another program like bascom or codevision when monitoring port , when Micro send data , codevisoin or bascom terminal as soon as
data receive ,shows data ,but in my program don't show correct data and i don't know that data received is true or not true?
my program has a stacked sequence whit 5 frame.when i run program , program start from frame 0 and process to frame 4 and at the end , program does this process....
when my program in frame 2(or 3,4,0), micro controller send data but my program don't receive data or receive data but not complete.
how can i make my program that when micro send data, my program goes to frame 1 or receive completely?
08-26-2011 12:35 PM
You said you were using the basic example from LabVIEW but the serial functions you are using have not been part of LabVIEW since about version 7. Where did you even get this code?
First, a stacked sequence structure is a poor design choice. You really need to use a state machine. Then look at the basic example in 2009. It uses VISA functions and one of the VISA Functions is VISA Bytes at Serial Port. You can poll this and when the number of bytes is greater than 0, go to a read state.
09-02-2011 08:34 AM
Hi
i can't use "Queued State Machine" in labview for monitoring RS232 port.
i searched in INTERNET but don't find any thing?!?!
help please i beginner in labview?
09-02-2011 09:42 AM
Why can't you use the queued state machine? Don't understand your internet search either. Help>Find Examples and File>New...>From Template>Frameworks>Design Patterns.
09-03-2011 05:25 AM
another approach is this
09-03-2011 07:46 AM
Hi
i use template " Producer/Consumer design pattern"
. it has two while loop :
1-producer loop.
2-consumer loop.
in "Consumer Loop" i put my controller that i use in my program.
in this loop contains : graph , number control , bar and etc.
but in "producer Loop" what controller do i put it for read data from rs232 ?
in "producer Loop" how to detect that data receive?
what controller do i use in "producer Loop"?
.
.
i think that i use events port rs232 in "producer Loop" .
but what event should i use ?
port rs232 has DTR , CTD , ... events ( i think).which event do i use?
09-03-2011 07:27 PM
As I already said, VISA Bytes at Serial Port.
10-17-2011 02:42 AM - edited 10-17-2011 02:43 AM
Hi
I used "Producer / consumer degin pattern (Event)" and i change my program now i have some problem :
1 - In , event structure , how many events can be used?Is it resonable to use 280 events?
2 - In case of using 280 events can we use " While(consumer loop)"instraction more than one time?
3 - The "Time Out" defualt value is 10 seconds and it is too mach in VISA , can we collect "Time Out" value in automatic mode?
4 - The onboard IC MAX 232 is heat up , is it the result of the IC it self or due to the my program?