Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

RS232 Serial Read with COM1

Solved!
Go to solution

Hello.  I'm hoping there is an easy answer to a problem I am having. 

I previously had been using the 30-day evaluation of LabView to start creating an application for reading data from an RS232 instrument output through the serial port on my laptop.  I based this off of the basic serial read and write example and it was working fine. 

Now, I have purchased the Basic Labview software, had downloaded the software and activated it.  When I opened up the VI that had previously been working, it now will not read the data from the instrumen. - there is nothing showing up in the "read string" text indicator window.   

I verified that the instrument and connection is fine by acquiring data in HyperTerminal - I'm using all the same data transfer settings in LabVIEW. 

The instrument automatically prints / sends the data at specified intervals (I've had this set to 1 sec).  No commands need to be written to the instrument.

 

I wonder if there is something with the LabView installation that requires the computer ports to be configured?  The Visa Resource Name in the VISA Serial configuration is "COM1", as it had been previously.  Does LabVIEW need to be instructed as to what "COM1" refers to?  I did not have to do that previously, so I kind of doubt it. 

 

I've attached the VI.  Note that it is rather messy in the case structure for the serial read function, because I've been playing around with how to handle the data.   

 

Thanks for any advice. 

0 Kudos
Message 1 of 10
(4,452 Views)

Why on earth would you flush the receive buffer when you are trying to do a read?

 

Also, disabling the termination character and using a fixed byte count to read is in general, a bad combination. /if the instrument sends a term character, enable it. If it doesn't, use the VISA Bytes at Serial Port.

0 Kudos
Message 2 of 10
(4,451 Views)

Thanks for the input, Dennis. 

There was some reason that I found flushing the buffer before each read made things work better.  I think it was the only way I could each keep the subsequent read string to be in the right "frame" with the specified bytes to read.  If I didn't flush the buffer first, the string would keep shifting.  Changing the number of bytes to read from 26 only made it worse.  I might be able to try a carriage return as a termination character and see if that solves the problem of not having things lined up right. 

 

I'm obviously new to LabView and am trying to sort all these things out.  The online forums and help files have made learning basics very easy, but some of the details of how to best do things are a little harder to figure out.  I definitely appreciate the suggestions on this. 


Any ideas why LabVIEW (after un-install and re-install) is all of a sudden not ablt to read from the COM1 port? 

(For some reason I thought it might be best to first uninstall the evaluation version of LabVIEW before installing the Basic version I purchased, but it turned out that to download the software and activate my liscence over the internet I ended up first needing to download and install the evaluation version again.  So that uninstall was probably pointless.)

 

0 Kudos
Message 3 of 10
(4,448 Views)

are you able to see com1 in the Measurement and Automation eXplorer (MAX)?

greetings from the Netherlands
0 Kudos
Message 4 of 10
(4,444 Views)

Do you have a manual that you could attach?

0 Kudos
Message 5 of 10
(4,443 Views)

Albert,

 

No, I cannot see any of my PC's ports under 'Devices and Interfaces' in the MAX configuration tree - In Fact, 'Devices and Interfaces' does not show up in MAX. Under 'My System', I only have 'Software' and 'Remote Systems'.  Should MAX be detecting and displaying the ports from my PC? 

 

I'm wondering if I should just uninstall and this time reinstall LabVIEW Base from my CD that was shipped to me instead of installing from the download from the NI website. 

 

Another think I noticed, not sure if related, is when I try to place the 'Instrument I/O Assistant' on the block diagram (not sure what this would be used for, but just playing around), I get the following error message: "Measurement & Automation Explorer or the Instrument I/O Assistant is not installed correctly.  Please install these from the LabVIEW driver CD."  I had this error message before when my VI was working properly in the software evaluation mode, so I didn't think much of it. 

0 Kudos
Message 6 of 10
(4,420 Views)
Solution
Accepted by topic author prenaut41

Indeed I would do a repair from the cd and make sure that also max is installed correctly.

good luck.

greetings from the Netherlands
0 Kudos
Message 7 of 10
(4,409 Views)

You will need to install "Device Drivers" this usually ships on a dvd with your software but you can also download it from the link.

 

Also double check the DAQmx version if you think you have installed Device Drivers.  there was a incompatability in some versions that is known to cause devices to not show up in MAX with certain USB devices present


"Should be" isn't "Is" -Jay
0 Kudos
Message 8 of 10
(4,404 Views)

for serial daqmx is not needed but visa surely should be present, and if it worked once you should have it on the dvd.

greetings from the Netherlands
0 Kudos
Message 9 of 10
(4,399 Views)

Turned out that uninstalling LabView and reinstalling from the CDs did the trick.  It is again acquiring the data through the serial COM1 port.  Not sure exactly what the problem was, but it is working.  Now, back to trying to build my application.  Thanks. 

0 Kudos
Message 10 of 10
(4,366 Views)