Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Serial communication timeout

Hello everyone...

 

Please explain me what is TIMEOUT in serial communication. By my knowledge it is time required to receive a reply from port after transmitting a querry. M using basic serial read write example in which timeout mentioned is 10 sec. I am very much sure that after sending a querry to my unit, it responds in 3sec but still m not getting the proper output at the read side with the timeout of 10sec..

 

Please help me out with this.

 

Thanks & Regards,

Manisha

 

Message 1 of 8
(16,736 Views)

You are right in your assumption about timeout.

But did you specify the correct endcharacter, have the correct cable (yes or no twisting), did you enable the endcharacter or does your hardware als need some other hardware signals before replying?

 

You could use NI-IOtrace to see whatt really happens on the serial line.

greetings from the Netherlands
0 Kudos
Message 2 of 8
(16,735 Views)

Hii Ablert,

 

Thanks for quick reply.

 

M not using any end character for my communication. M getting proper data using hyper. Is there any way to to specify number of bytes to be read after write operation? Or after sending a querry, can I put a timer which gives me time taken for reading operation?

 

Thanks & Regards,

Manisha

0 Kudos
Message 3 of 8
(16,733 Views)

Hi

If you ook at the block diagram you see the open, then the write followed by a wait (the value in ms in lower left of front panel)

Then a check on how many bytes are available and then the read followed by a close.

 

Everything between the initialize and the close could be put in a while as is also done in the advanced serial write and read.

I would try that example first.

greetings from the Netherlands
0 Kudos
Message 4 of 8
(16,727 Views)

M attaching one VI in which m waiting for timeout to complete after sending a querry. In this I have used sequence structure in order to reduce error. M using while loop for checking the reply time. After sending a querry m waiting for 6 while loop to check whether reply has come or not? Is it a write way to check timeout???

0 Kudos
Message 5 of 8
(16,725 Views)

Hey I got sumthing. My unit is in half duplex mode. What is the exact differance in half n full duplex in labview? Any modification is required? If yes pls suggest me the changes should be made in basic serial read write example?

Please help me out with this.

 

Thanks & Regards,

Manisha

0 Kudos
Message 6 of 8
(16,704 Views)

half duplex is normal,it only menas that your device is either receiving or sending not at the same time.

full duplex is also normal meaning the device can send and receive at the same time.

 

Your sequence frame added does nothing in LabVIEW except for the single frame around the wait ms, that is a correct frame because it has no error in/error out.

In fact Everything that is connected by wire in LabVIEW is executed in that order. This is called sequencing by wiring !

And for IO it is very nice.

 

But did you already look at the advanced serail read and write.

greetings from the Netherlands
0 Kudos
Message 7 of 8
(16,689 Views)

half duplex is normal,it only menas that your device is either receiving or sending not at the same time.

full duplex is also normal meaning the device can send and receive at the same time.

 

Your sequence frame added does nothing in LabVIEW except for the single frame around the wait ms, that is a correct frame because it has no error in/error out.

In fact Everything that is connected by wire in LabVIEW is executed in that order. This is called sequencing by wiring !

And for IO it is very nice.

 

But did you already look at the advanced serail read and write.

greetings from the Netherlands
0 Kudos
Message 8 of 8
(16,689 Views)