Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

online monitor RS232 port

Solved!
Go to solution

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 

0 Kudos
Message 1 of 15
(6,048 Views)
Solution
Accepted by Majid_PLC

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.

Message 2 of 15
(6,045 Views)

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?


0 Kudos
Message 3 of 15
(6,035 Views)

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.

Message 4 of 15
(6,032 Views)

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?

 

0 Kudos
Message 5 of 15
(5,999 Views)

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.

Message 6 of 15
(5,996 Views)

another approach is this

Hyper Terminal RS 232  & Serial Port Test

https://decibel.ni.com/content/docs/DOC-16720

greetings from the Netherlands
Message 7 of 15
(5,980 Views)

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?

0 Kudos
Message 8 of 15
(5,975 Views)

As I already said, VISA Bytes at Serial Port.

Message 9 of 15
(5,969 Views)

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?

0 Kudos
Message 10 of 15
(5,889 Views)