10-11-2011 01:16 PM
ohm out the cable, assuming it's a DB9, ohm out pins 2 and 3 to see if
2 goes to 2(on the other end) / 3 goes to 3 (on the other end)
or
if they swap (pin 2 goes to pin 3 on the other side etc)
-pat
10-11-2011 02:13 PM
I've not seen anyone ask so I will. Have you made sure your com port has the correct settings? Baud rate, parity etc. MAX is also handy for testing com ports out too through the test panel.
If you're getting resorce in use messages you probably forgot to release the com port in your code.
As it was mentioned, the correct cable is very important.
10-11-2011 02:29 PM
the port is configured properly. when i run the serial general vi uploaded in this thread, i get a byte array when i go to visa write TS command to the device. but it stalls on the read.
10-11-2011 03:03 PM
Ran MAX and the device was recognized and I am able to write to it. So i send TS and it gets 3bytes back. But if ihit read, it gives me the timeout error. I increase the timeout time to 1000000 and still get the error. what gives? i'm calling the company firs thing in the morning.
10-11-2011 03:09 PM
It's really not all that relevant that the write seems to work. You will not get an error even if there is nothing connected at all to the serial port. Did you check the cable as previously asked?
10-11-2011 03:12 PM
10-11-2011 03:14 PM
@superomario wrote:
Ran MAX and the device was recognized and I am able to write to it. So i send TS and it gets 3bytes back. But if ihit read, it gives me the timeout error. I increase the timeout time to 1000000 and still get the error. what gives? i'm calling the company firs thing in the morning.
The return count: 3 bytes is not what you got back, but is what you sent out. It is the number of bytes that the comm port sent. But you do not know if they got to your instrument through the cable. Nothing is showing back at the connector to your comm port.
Bad Cable,
Bad instrument
Wrong port setting
10-11-2011 03:19 PM
It's really important to actually know what kind of cable you are using. Nothing will work if you are using the incorrect type of serial cable. Basic information of RS-232 is that there are two major types - null modem and straight through. You have a straight-through cable if the linked cable is what you are actually using. Try a null modem cable.
10-11-2011 03:47 PM - edited 10-11-2011 03:53 PM
Looking at the manual that you posted I have keyed in on some things that make me start reading between the lines on what the writers of the manual meant.
Comm. signal : RS-232 , one way
What do they mean by "one way". The unit does not responds to command, but maybe only to flow control.
Then there is the manual's use of "TS" and "CR". Think we all agree "CR" mean a 'carriage return' \r or ascii 13.
So maybe the "TS" means 'Start Text' or an ascii code 2 and not the two characters T and S but a single byte value \02.
Try sending the single ascii 'Start Text' or 'STX' or '\02' without anything else.
You would think if they used the STX to start, why did they not use the ETX to end or stop it.
10-11-2011 04:24 PM
As Dennis pointed out, the cable you hyperlinked to is a straight through 1:1 pinout.
The OX400 requires a NULL modem cable as shown in the link below. While you are at it, why not download and test the free logging software from Yokogawa first?
And if that works, why not run a serial port sniffer to capture the data transactions between the PC and the OX400 using the freeware? 40+ posts on basic serial comms (again).
http://www.yokogawa.com/us/is/downloads/pdf/analytical/software/OX400_FREEWARE.pdf
-AK2DM