LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Visa serial comm (use event ) problem at loopback but virtual port OK

I am new to Labview!

I build a Vi to perform serial comm to test the visa info.

First, I test this vi at virtual ports ,comm1 for serial program, comm 2 for this vi,one for transmission and one for receiving. OK!

but when I use it at single Comm3 (Prolific USB serial port,MAX's view is OK) and loopback ,I got

Error -1073807298!

 

I Don't figure out what's the problem, Could Give me some advice? Thanks!

0 Kudos
Message 1 of 7
(3,342 Views)

Hi Alex,

 

where does this error occur (at which function)?

 

General comments:

- stay away from accessing the serial port in parallel loops. It can be possible - but I don't recommend it.

- You configured to use the TermChar at VISASerialPortInit: get rid of the BytesAtPort function! This one is NOT NEEDED in >99% of serial communication cases!

- get rid of the VISAEvent: just read a suitable number of bytes from the port - you have configured a TermChar, don't you!?

 

Did you examine the BasicSerialRead&Write example VI? When you forget about the BytesAtPort it explains serial comm in a very basic way…

 

Other comments:

- get rid of all those "value" property nodes

- use a shift register for "accumulation…" and delete it's local variable

- clean up your VI: lots of bended wires

- always attach real VIs (or snippets) instead of images: they are just hard to debug in LabVIEW…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 7
(3,300 Views)

HI GerdW!

Thanks for reply!

The error message occured at read function,I use VisA event  becasue I want to build multiport 485 bus data collection system.Because the remote end would send data (somthing like alarm signal) to upper end ,I don't want to use while structure to polling the port.Your advice is very important to me and I would modified it later,and I will double check the BytesAtPort. but I  don't understand why loopback is not working. 

 

Thank you very much!

 

Best regards,

Alex

 

0 Kudos
Message 3 of 7
(3,294 Views)

Hi Alex,

 

You may try using a different converter.  Many of these converters are conterfiet and they do not work Well with labview. I had a prolific converter and saw random erros and as soon as i switched to an FTDI converter directly from FTDI the errors dissappeard.



-Matt
0 Kudos
Message 4 of 7
(3,270 Views)

Thanks! Matt,I will try!

0 Kudos
Message 5 of 7
(3,252 Views)
thanks,YueLiao!
Best regards.
alex
0 Kudos
Message 7 of 7
(3,145 Views)