Digital I/O

cancel
Showing results for 
Search instead for 
Did you mean: 

Communicating between Labview and Acton Spectrometer via USB or RS232

Solved!
Go to solution

I am trying to communicate between a PC running XP and an Acton 2300i spectrometer using Labview.  Windows recongizes the Spec and assigns it to COM3 with the correct name.  Also the software that came with the Spec can communicate with it.  However, I have been unable to communicate using VISA in Labview.  I downloaded the simple read and write example vi fromt the example finder and changed the inputs to 9600 baud ... but am still unable to communicate.  I also tried connecting via NI measurement and automation software, but get the time out error code.  I have been able to connect using GPIB from Labview to another older Acton Spec 500i but the new version onle connects via RS232 or USB.  

0 Kudos
Message 1 of 6
(5,713 Views)

First thing I'd do is change the COM port from COM3.

 

COM3's typically reserved for a modem, much like COM1 is reserved for the on-board serial port. 

 

Open up Device Manager, double-click the COM port, "Port Settings" tab, click "Advanced", and change the "COM Port Number" at the bottom to the first available port.

 

Have you tried using tools like a serial port monitor or NI-Spy to see if there's some initialization that's going on that you're not doing in LabVIEW?  Try turning off the termination character on the serial initialize; that's given me problems in the past while communicating with serial devices.

 

 

0 Kudos
Message 2 of 6
(5,709 Views)

Actually, I just got back from fiddling around with the Spec and the only reason it was registering COM3 was because both the RS232 cable and USB cable were plugged in.  Once I removed the USB connection, it is no longer recognized by Windows.  However, I am still able to control it via the software that came with it.  

 

To answer your question, no I have not tried any of those programs.  I dont even know what they are.  Im very new to Labview, as in a week.

 

Any other advice.

0 Kudos
Message 3 of 6
(5,707 Views)

I am now able to connect to the Spec via RS232 using hyperterminal with settings baud 9600, data bits 8, 1 stop bit, no parity and data flow none on COM1.  I try the same settings on the example read and write vi, but I am unable to control the Spec.  It seems like it is connecting though, because when I have hyperterminal open and connected to the Spec, I get an error from labview shen I try to communicate which says VISA:  (Hex 0xBFFF0072) The resource is valid, but VISA cannot currently access it.

0 Kudos
Message 4 of 6
(5,703 Views)

You have to exit Hyperterminal before running your LabVIEW code. Hyperterminal restricts access to the port thus LabVIEW cannot use the resource.

 

-AK2DM

~~~~~~~~~~~~~~~~~~~~~~~~~~
"It’s the questions that drive us.”
~~~~~~~~~~~~~~~~~~~~~~~~~~
0 Kudos
Message 5 of 6
(5,688 Views)
Solution
Accepted by topic author SaltyWahoo

The problem was simply not having a carrage return appended to the end of my command.  Thank you for your help.

0 Kudos
Message 6 of 6
(5,681 Views)