09-29-2005 01:19 PM
09-29-2005 01:21 PM
09-30-2005 05:55 AM
Hi,
Just want to add one thing to what Dennis said, If the data your receiving is not plain ascii disable terminate char in the VISA open function. Otherwise, the read data function stops at the first 0x0A character.
Like Dennis said first see how many bytes there are available (with a timeout) before reading the COM port.
See my example. Forget all the blue VI’s and look into the red square. This while loop waits for 1 second or if there are 6 or more bytes available at the COM port. Also look at the VISA open at the beginning. If things are OK I expect 6 bytes if it’s not OK who knows. In this way I always get the data if there is any without a hang-up situation.
Needles to say that the 1 second is time-out is valid for my application.
KC
09-30-2005 06:34 AM
09-30-2005 07:49 AM
09-30-2005 01:07 PM
09-30-2005 01:14 PM
09-30-2005 02:05 PM
Okay, now we're getting somewhere. DTE stands for Data Terminal Equipment which usually means a computer, and DCE stands for Data Communication Equipment like a modem. When you connect DTE-DCE, you use a straight through serial cable. Pin 2 of the DB9 at the computer connects to pin 2 of the modem, pin3 at the computer to pin3 of the modem, etc. Many instruments are implemented as DTE which means you use a null-modem or cross-over cable to connect from the pc to the instrument. Pin 2 at the computer (Tx) gets connected to Pin 3 (Rx) at the instrument and Pin 3 at the computer (Rx) gets connected to pin 2 (Tx) of the instrument. For your loopback test to work, this is how you had to have the cable wired to go between com1 and com2. If you just did a loopback test on com1, then you just wired Tx to Rx at the same port. I did a lookup of the MDSi8 and it has a wiring diagram for the cable between pc and instrument. It is a straight through wiring scheme. With an ohm meter, check the wiring of the cable you're using. Every wire at one end should have continuity to the same pin at the other end. I hope you find that the cable is wrong and once you get the correct cable, you can use Hyperterminal to talk to it. I haven't tried to find the manuals for the other instruments but I wouldn't be surprised if you have a similar problem with them.
09-30-2005 02:23 PM
09-30-2005 02:40 PM