Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Communication with serial port card problems.

I am having problems communicating through a Meilhaus ME-9100 serial port card. I have run tests on it, and the card itself works. However, when I try to read data from any of the six instruments connected to this card, I get null data. Not zeroes even. Absolutely nothing. I am reading from a VISA port to a string indicator. What could be going wrong? I have some GPIB devices connected, and they work fine, so I am left only to assume that there is an issue with the ME-9100 and my computer.
----------------------------------------------------------------------------------------------------------------------------------------------------
I've got a sneaking suspicion that Jesus might have been made of bread. Why else did they have to put him in a warm cave and wait three days for him to rise?

Damnant quadnon intelligunt - They condemn what they do not understand.
0 Kudos
Message 1 of 9
(4,816 Views)
Or there could be a problem with your program, the serial settings, or the cable. What language are you using? Have you tried Hyperterminal to talk to the instruments? That's always the first thing I try. If you can do that, then you can use VISA. Do you get an error back when trying to read? If you first have to send a command to request data, are you terminating the command with a control character like CR or LF?
Message 2 of 9
(4,804 Views)
Sorry, I don't really know anything but Labview. The cable and serial settings I know are fine. The program I have been looking at for a while and cannot figure out anything wrong, but that doesn't mean a whole lot. I have no idea what language I am using. I put the VISA write down, look in the manual to see what command will make the device read from whatever channel, pop in a VISA read and connect that ouput to a string indicator. I do not know how to use hyperterminal, or even if it is on my computer. I have managed to get back reads from  the devices in the NI Instrumentation program. I do not get an error, just nothing. Absolutely nothing. I do not know what termination characters I could use on them, but I have written programs for GPIB without them and it worked quite well. It doesn't help being the only one in my department with any knowledge of Labview, while not knowing much about other types of programming or computer stuff.  Hope this helps, and thanks for the help you have already given me.
----------------------------------------------------------------------------------------------------------------------------------------------------
I've got a sneaking suspicion that Jesus might have been made of bread. Why else did they have to put him in a warm cave and wait three days for him to rise?

Damnant quadnon intelligunt - They condemn what they do not understand.
0 Kudos
Message 3 of 9
(4,794 Views)
Oh, yes. I figured it might help whoever reads this to know what exactly I am trying to communicate with. The first is a Tektronix TDS 520D 2 Channel Digital Phosphor Oscilloscope. Second, an MKS 600 series Pressure Controller. An MKS type 247 Four Channel readout. MKS 937A Gauge Controller. Dressler Cesar RF Power Generator. Omega 10 Channel Temperature Read Out with an analog channel selector. Don't know how much it will help. But it can't hurt.
----------------------------------------------------------------------------------------------------------------------------------------------------
I've got a sneaking suspicion that Jesus might have been made of bread. Why else did they have to put him in a warm cave and wait three days for him to rise?

Damnant quadnon intelligunt - They condemn what they do not understand.
0 Kudos
Message 4 of 9
(4,789 Views)

Okay, the language you're using is LabVIEW. You didn't say that in the original post.

Hyperterminal is a terminal emulation program that comes with every version of windows. You can get to it from Start>Programs>Accessories>Communications. But, since you've managed to get communications to work in MAX (Measurement & Automation Explorer and what I'm assuming you mean by NI Instrumentation program), you don't need to try Hyperterminal.

There's a big difference between GPIB and serial. GPIB has standards for electrical, physical, and communication. The communication stardard defines the handshaking  and interface management. One management line is EOI. This is asserted at the end of a message. Serial has no standards beyond the electrical and physical. Most serial instruments require some sort of termination character at the end of each command. This is often a carriage return or a line feed. The instrument manual should tell you what it is. In the example that worked, did you see a \n or \r anywhere? A \n is a line feed and a \r is a carriage return. If one of those is the correct termination character, you need to add it to the end of the command. One way to do that is to right click on the string control/constant you're using for the write and select '\' Code Display. You can then type either \r or \n at the end of the command. You can also use the concantanate to String function and use the constants on the String palette. You can also use a VISA property node to automatically append a termination character to each VISA Write but I think the first step you should take is one of the first two options I mentioned and actually get some data.
 
The problem you're having is common. If you had searched the forum, you would see hundreds of posts on the subject. You might want to take the time to do a search as a lot also have some example code.
Message 5 of 9
(4,788 Views)
Ok. That has not worked. I have tried adding both the carriage and line feed termination character to the end of all of them, and none of it works. I do, however, get this error message when I try to pull up the block diagram. The instruction at "0x1ca12b95" referenced memory at "0x00000000". The memory could not be "read".   Click OK to terminate the program.  I don't think it has anything to do with why the parts are not communicating, but hey. It also comes up several times, even after clicking OK. I am all out of ideas. I have even tried calling the verious device manufacturers to confirm that the commands are correct. They are. I am out of ideas. Please help. *gasp*

Sorry, a bit overdramatic there at the end, but that just about sums up the problem. I would appreciate the help.
----------------------------------------------------------------------------------------------------------------------------------------------------
I've got a sneaking suspicion that Jesus might have been made of bread. Why else did they have to put him in a warm cave and wait three days for him to rise?

Damnant quadnon intelligunt - They condemn what they do not understand.
0 Kudos
Message 6 of 9
(4,767 Views)

Is this error message something new that just happened or has it been there from the beginning? Is there anything in the VI besides a VISA Read or Write or is there a Call Library Function Node in there? Post your VI so someone can look at it. You say that the communication to the GPIB instruments work and it's only the serial that you're having trouble with? That seems to indicate to me that LabVIEW and VISA are okay. Do you happen to be using a USB<->Serial converter?

Never mind about the USB question. I looked back at your first post and saw you're using a PCI card for the additional com ports. I would suspect the driver for this board is causing some problems. You might try re-installing it or checking to see if the vendor has an updated version.

It would still be nice to see your VI though.

Message Edited by Dennis Knutson on 09-14-2005 01:00 PM

0 Kudos
Message 7 of 9
(4,760 Views)
This is an old problem that happens whenever I try to open the block diagram. I click OK somewhere near 10 times and it goes away. I have no idea what it means. I don't have anything but VISA Write and Read commands. Nothing that should have to access something outside of basic labview stuuf that should be part of the program. No call Library functions anywhere. GPIB does work, but serial does not. I will post the vi on this message. I tried re-installing the drivers for the PCI card and it didn't help. There are no new updates.

Thanks once again for your help,
Cole

----------------------------------------------------------------------------------------------------------------------------------------------------
I've got a sneaking suspicion that Jesus might have been made of bread. Why else did they have to put him in a warm cave and wait three days for him to rise?

Damnant quadnon intelligunt - They condemn what they do not understand.
0 Kudos
Message 8 of 9
(4,735 Views)

One thing you didn't do correctly is append the CR constant. You have to right click on the text constant and select '\' Code Display and then enter \r. You have normal display on and you're not sending the control character. Your're sending the character "\" and the character "r". If you right click and select Hex Display, what you will see is 0D.

I have no explanation for the error though. I can open the diagram with no problem. I still think it points to a problem with the serial card driver itself.

0 Kudos
Message 9 of 9
(4,730 Views)