LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

VI crashing at VISA clsoe when trying to read hex data over serial port

Hi
 
I have a real problem I am reading hex data over a serial link using the VI attached.
 
The VI seems to read the data string OK, however the VI then stalls at VISA close and to stop the VI I actually have to remove the serial connecrtion to the PC.
 
Has anybody ever had a similar problem
 
Regards
 
Ashley.
0 Kudos
Message 1 of 5
(2,334 Views)

You did not have a VISA open that may have been adding to the issue.  I fixed up you code and see if this solves the problem.

Matt

 

Matthew Fitzsimons

Certified LabVIEW Architect
LabVIEW 6.1 ... 2013, LVOOP, GOOP, TestStand, DAQ, and Vison
0 Kudos
Message 2 of 5
(2,324 Views)

Are you sure that you are reading Hex?  Most developers deal with hex communication by using an array of U8's for the hex characters.  You can use Byte Array to String to transmit the information using VISA write.

Matt

Matthew Fitzsimons

Certified LabVIEW Architect
LabVIEW 6.1 ... 2013, LVOOP, GOOP, TestStand, DAQ, and Vison
0 Kudos
Message 3 of 5
(2,321 Views)
This VI is basically the same as the shipping example called Basic Serial Write and Read. I've used this on numerous occasions and have never had a problem with the VISA Close and I don't have a problem running your version. What version of VISA are you using?
0 Kudos
Message 4 of 5
(2,319 Views)

Hi Guys.

Thanks for the replies.  I have just picked these messages up as I have had a much needed long weekend break.

The problem persists.  First I will answer the questions proposed.  The version of NI-VISA I am using is the April 2004 Edition that came with LabVIEW 7.1.  The data I am reading over the serial link is in the form of comma separated hexadecimal formatted words, where a word is 2 bytes long. 

The VI takes the data, but stalls at VI close so the connection to the coms port stays open.  (Including the VISA open function in the VI did not solve the problem).

It is a very confusing problem.  I will let you know how I get on.  I suspect that the virtual coms interface (a USB stack emulating a serial link) could be the problem so I will need to check this with a software engineer.

Best Regards

Ashley

0 Kudos
Message 5 of 5
(2,306 Views)