LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Serial read not giving an output?

Solved!
Go to solution

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

0 Kudos
Message 31 of 41
(2,129 Views)

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.

Why do geeks think Halloween and Christmas occur on the same day?
Because 31oct = 25dec!
0 Kudos
Message 32 of 41
(2,107 Views)

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. 

0 Kudos
Message 33 of 41
(2,104 Views)

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. 

0 Kudos
Message 34 of 41
(2,098 Views)

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?

0 Kudos
Message 35 of 41
(2,095 Views)

I beleive this is the cable we have 

 

 

http://www.cablewholesale.com/specs/serial-cable/10d1-03406.htm

0 Kudos
Message 36 of 41
(2,093 Views)

@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


 

Omar
0 Kudos
Message 37 of 41
(2,092 Views)
Solution
Accepted by topic author superomario

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.

0 Kudos
Message 38 of 41
(2,087 Views)

 

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.

Omar
0 Kudos
Message 39 of 41
(2,073 Views)

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

~~~~~~~~~~~~~~~~~~~~~~~~~~
"It’s the questions that drive us.”
~~~~~~~~~~~~~~~~~~~~~~~~~~
Message 40 of 41
(2,065 Views)