LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Communication issues with COM port

I'm trying to control a monochromator device using Labview, via USB (COM4 port). We did it in the past, using our old monochromator, via GPIB, and it worked well. Now we installed the new monochromator including drivers. We can communicate with it using Hyperterminal, but Labview does not see it. Exactly the same program does work on the old monochromator.


I'm using Windows 7, Labview 2011. The error message reads 'The resource is valid, but VISA cannot currently access it'. Do we need to modify the program when using the COM-port instead of GPIB (apart from the resource name obviously)?

 

Thanks a lot for your help!

0 Kudos
Message 1 of 27
(2,341 Views)

Hi DVD_11,

 

You cannot use same VISA string input for configuring VISA GPIB and VISA USB. Check it out here how to configure VISA USB :

http://www.ni.com/getting-started/set-up-hardware/instrument-control/usb-connect.htm

 

BR

Vincent

0 Kudos
Message 2 of 27
(2,326 Views)

If you were using VISA, then you should just have to change the resource name in your code.

 

Did you still have Hyperterminal open when you started LabVIEW?  That would be a resource conflict.  Only one program can have access to the port at a time.  I would recommend shutting everything down and then try opening your project and run it.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 3 of 27
(2,307 Views)

Hi Vincent, crossrulz,

 

Thank you for your help. 

 

For clarification: it seems in MAX that it is not directly a USB port, but an artificial serial port (COM), as you can see in the screenshot I attached. 

 

I made sure no other programs were using this port. I also thought that only changing the resource name would be sufficient.

Now the error that I get is this one:

VISA: (Hex 0xBFFF003A) Unable to start operation because setup is invalid (due to attributes being set to an inconsistent state)

 

When I open a VISA Test Panel (from MAX) and open the tab 'View Attributes', I see an error at the attribute 'Is Port Connected', saying that there is an invalid property value, and displaying this error: VISA:  (Hex 0xBFFF001D) The specified attribute is not defined or supported by the referenced resource.

 

I hope this information will be useful to you. I'd be grateful to hear any suggestions to solve this problem.

0 Kudos
Message 4 of 27
(2,296 Views)

Try out to fill in the VISA ressource name following this description in your VI or/and MAX :

 

USB[board]:: manufacturer ID:: model code:: serial number[:: USB interface number]::INSTR

 

BR,

Vincent

0 Kudos
Message 5 of 27
(2,289 Views)

Where can I find all these numbers? As you can see, there is no USB device listed in MAX (except for the one shown as COM4 port). In the latter case, ASRL4::INSTR is the name given by MAX, and using this in the VI gives exactly the same result.

The manufacturer of the instrument does not have specific information on this issue and says it is a Labview-related issue, since it is working fine with Hyperterminal.

0 Kudos
Message 6 of 27
(2,281 Views)
Please ignore Vincent's advice. You must use the com port name. The USB reference is just not used unless you use the VISA wizard and that is just about the worst thing you could do.Ignore the error about the attribute. That only applies to NI hardware.
Message 7 of 27
(2,273 Views)

Does anyone has an idea what I could try to make it work? Thanks so much in advance!

0 Kudos
Message 8 of 27
(2,215 Views)

What have you tried so far?

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 9 of 27
(2,181 Views)

@DvD_11 wrote:

Does anyone has an idea what I could try to make it work? Thanks so much in advance!


For using VISA you need to either free resources or use free resources. In your case your VISA is already connected to something else or being used by other devices.

--------------------------------------------------------------------------------------------------------
Kudos are always welcome if you got solution to some extent.

I need my difficulties because they are necessary to enjoy my success.
--Ranjeet
0 Kudos
Message 10 of 27
(2,176 Views)