Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

problem by continuous serial communication

Solved!
Go to solution
Solution
Accepted by momosuwan

Hi,

 

Take your time. I have enough troubles of my own   Smiley Tongue

 

In your VI 'Receive_Data.vi' you are still get the number of bytes and read these bytes from the serial port. This is possible but you have to take into account that this can be zero.

I think it is better to wait for a specified time to see if there are the expected number of bytes available at the port.

 

But there are more solutions thinkable. You can look in the timeout event (don't set it to zero) if there are bytes available.

If the number of bytes is not zero and the same as the previous check then create a event to get data.

 

See if you work this out.

 

Kees

0 Kudos
Message 21 of 23
(1,084 Views)

It's working !! I remodifed the read sub VI and it's working great now !  thanks alot for the help, I attached the file again to show you what I changed.

0 Kudos
Message 22 of 23
(1,073 Views)

It's great that is working and even better you did it yourself. Best way to learn.

One remark to make it better; within the case 0 you could generate a failure to indicate a time-out on your interface. But it also depends on your application.

 

Kees

 

 

0 Kudos
Message 23 of 23
(1,064 Views)