07-11-2012 10:44 AM
I am pretty new to Labview. With the help of this forum I was able to configure my DAQpad 6020E with my Labview 7.1.
Now I am looking at using an Extech Instruments Hot Wire Thermo-Anemometer (407123) in my experiment and running it through Labview. Based on my research, I was led to believe that I should use the Instrument Assistant I/O and NI-Visa, but I am having a lot of difficulties. First off, the Thermo-anemometer is wired for RS232 and I have it connected to an RS232 to USB converter, which is then plugged into my computer. I have the driver for the converter. When I plug the thermo-anemometer into my computer, MAX reads it as a serial port and it is listed as COM3. MAX claims that the device is working properly. However, when I run Labview's Instrument Assistant I/O, and tell it to read data I get a bff0015 error and it says that the device timed out. I have tried changing the time and I still get the same error. I am assuming this means that Labview and my device are not communicating.
I have seen some mention of instrumentation drivers, but I haven't been able to find any for my particular device. I am assuming that is the root of my problem, and that if I had an instrument driver to run my device in Labview that it would work properly. So here are my questions.
1) What do I need to take data from a third party thermo-anemometer in Labview?
2) Am I correct in thinking I need some sort of instrument driver? And if so, where could I find one (I have already searched for one and did not find it)?
3) Is it possible and practical to take data through Labview from a DAQpad and a third party instrument at the same time?
4) Are there any guides or tutorials I could use that may show me how to accomplish what I'm trying to do?
Solved! Go to Solution.
07-11-2012 10:58 AM - edited 07-11-2012 11:04 AM
I did a quick search, read the users manual ( 8 pages). Could not find any Drivers on IDnet or the vendor website.
My impression is that there are no published instructions for programming this instrument. You will need to get the serial port configuration ( Baud rate, etc...) and also the communication commands for the instrument. Maybe the vendor will release these.
Take a look at MAX's configuration, it would seem that MAX got a response from an IDN command. You should be able to get the COM configuration MAX used.
You don't need drivers, but they are helpful. You can write the commands directly using VISA, if you have them.
There are quite a few guides for instrumentation, just query the knowledge base and/or developer zone.
This link has some good links. http://forums.ni.com/t5/Instrument-Control-GPIB-Se
07-11-2012 11:12 AM
One more trick you might try. Many of their instruments use the 407001 software, and some of their instruments have a programming guide. You might see if any of the instruments that use the 407001 software have the software protocol, and then use that protocol to test if this instrument uses that protocol.
Yes, just a shot in the dark.
I recommend getting on the phone with them to see what they can do for providing the communication protocol.
07-11-2012 11:45 AM
One thing to keep in mind is that when MAX says the device is working, it is NOT talking about the instrument connected to the serial port. It is just saying the com port itself is functional.
Whether you use the instrument i/o assistant or write your own VISA commands, you simply cannot proceed until you understand the communication protocal as Mark says. If the vendor does not provide it, you could also try using portmon from microsoft as a serial port sniffer and run the vendor provided program.
07-31-2012 01:30 PM
I've been trying numerous things to get this to work, and I've had little luck in getting exactly what I want. I have been able to get data from some example VI's designed for serial read, and I was able to tweak them some, but this data seems to be only able to be saved to a .txt file. I want the data from my anemometer to be read along with the time it was read and stored in a spreadsheet.
Instrument I/O Assistant appears to have exactly what I need to do this, but I can't get it to work. I keep getting the bff0015 error, which is that the device timed out before the operation completed. I don't understand why it is doing this, or how to stop it, because I am able to get data from the device otherwise. In fact, following these steps I can see the exact data I want:
1. Open Instrument I/O Assistant
2. On "Select Instrument" I select the correct port and then click "properties"
3. At the top corner of the window I click "Open VISA Session"
4. Once there, I go to the "Basic I/O" tab. Within that tab I click the "Read" tab.
Please see attached screenshots if you want to see what I'm talking about below.
At this point I can read the data from my device. The default count value is 1024 bits. If I click "execute" the device is read and I can read the data in the textbox that says "buffer." However, my device only makes one 16-bit reading every 1.6 seconds, so I have to let the device sit for some time before it can fill the buffer up with 1024 bits. If I don't, the reading takes place, I can see all of my data in the buffer, but the "Return Count" value on the screen is something significantly less than the "Count" value. This makes sense because the buffer did not have time to fill. Needless to say, the "Return Value" says "bff0015" which means it would return the time-out error.
If I wait for the full time for the buffer to fill, OR if I change the "count" value to something significantly lower, say... 32 bits, the buffer "fills" much faster, the "return count" count is correct, and the "return value" reads "3FFF0006" which I assume is a standard code meaning everything went correctly. I also notice that if I wait long enough, the buffer will continue to fill, and I can click "Execute" many times rapidly and get readings instantly. I can tell that the program is just reading data stored in the buffer when it doesn't take a second to perform the reading, and if I continue to click "Execute" rapidly, I will eventually expend the data stored in the buffer and I will start to see the "fresh" readings again.
So here is my question. How do I lower the expected "count" value in the actual "Instrument I/O Assistant"? I can do it in the "Open VISA session" under properties, but the only thing I can change in the Instrument I/O Assistant is the timeout value, but even when I set the value to 5 minutes, I still get the time out error. What else can I do?
07-31-2012 01:31 PM
07-31-2012 02:15 PM
I will never use the Instrument I/O Assistant and the version you have is a much lower version than what is current. The current version has a setting for the termination character. If set correctly, a Read will automatically terminate when it is detected. If you to set it correctly in the VISA Interactive control, you could specify 1024 bytes, read 18, and not get a timeout. I would suggest you modify the simple serial write and read that comes with LabVIEW. With the VISA Configure Serial Port, you need to change the read termination character. It appears your data is terminated with a \r (carriage return). The default setting in VISA is \r (line feed). The decimal code for a carriage return is 13 so wire a that constant to the termination character input. A VISA Read would be inside a while loop. Wire some large number up to the bytes to read and run it.
08-03-2012 01:02 PM
The information on the termination character is interesting and helpful. I have used the example "Advanced Serial Read and Write" and tried to modify it (I actually did a lot of tweaking with it before I even wrote this post), and I think the termination character makes it run better, but I still have the problem of recording my data. I can see my data in the front panel without any issue, but that doesn't really do me any good since I need a record of many data points over time.
I have tried using a "Write to Spreadsheet File" and connecting it to the "read buffer" pin on the "VISA Read" but I get an error because the buffer is a string and the write to spreadsheet vi is expecting a 32-bit real number. I even tried using conversion vis to translate the string but that didn't work either. I also tried other vis for writing the data and the only one that worked was to "Write Characters to File" and that only allows me to write to a .txt file. If I open that file in Excel, all of the data is displayed in one cell, and I am still faced with the problem of no time stamp.
The reason I want so badly to use the Instrument I/O Assistant is because it is designed to be used with the "Write LabVIEW Measurement File", which I have used before for other tasks, and which I know records data neatly into a spreadsheet file along with the time of the measurement, which is very important to me. I understand that newer software would probably make this task a lot easier, but unfortunately I do not have access to anything newer than LabVIEW 7.1. I find it very difficult to understand why I can get a VISA example to work, and I can open a VISA session in the options for the Instrument I/O Assistant and see data, but I can't get the Instrument I/O Assistant itself to work.
08-03-2012 01:04 PM
Also, in response to the question about drivers, I'm not sure what drivers you are talking about. If you are referring to drivers for my hot wire thermo-anemometer, I do not have the drivers for it. I searched both NI and the internet for drivers but was unsuccessful in finding anything of use.