Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

serial communication breakdown

I read data continuously in off the serial port and for the majority of the time it reads in what I expect and the error out gives a correct tick, the number 1073676294 in the code box and the message 'visa read in serialtest.vi' in the source box. Every now and again, the signal seems to drop and while the correct tick still appears there is now a 0 in the code box and nothing appears in the source box. Can anyone help me with this problem.
Thanks
kilyg
0 Kudos
Message 1 of 5
(3,231 Views)
Attached is my vi
0 Kudos
Message 2 of 5
(3,228 Views)
0 Kudos
Message 3 of 5
(3,229 Views)
Hi Kilyg,

Thanks for this post. I have been looking into this for the last couple of days but as yet, have not figured out exactly what is going on. I just wanted to let you know that I'm looking into it and will hopefully have an answer soon.

Best regards,

Peter H.
Applications Engineer.
NIUK.
0 Kudos
Message 4 of 5
(3,178 Views)
Hi Kilyg,

Sorry for the delay in replying. What is happening is that you don't have any synchronisation between the read functions and whatever it is you are reading from. I used a serial cable to do a loop back test and a write vi to write functions on to the serial port.

Sometimes it will read the correct number of bytes on the serial port and it will realize you have read exactly the same number of bytes as you have written and that there could be more. In this case it will give the warning. This is a good thing. Sometimes it will read too fast and may only read 3 bytes when there have actually been 5 bytes written and therefore it miss's 2 bytes on that time round. This will give the same warning but is obviously a bad thing.

The third possibility is that it reads more than there are and doesn't give any error messages as it knows there is nothing more to read. This is when you will get 0 in the error code and no error source.

Hope this helps.

Regards,

Peter H.
Applications Engineer.
NIUK.
0 Kudos
Message 5 of 5
(3,025 Views)