Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

problems with rs-232

Solved!
Go to solution

Hello,

 

first of all, I need to say that I'm new to Labview and so I'd like to apologize in advance if my questions will be too stupid! I've a problem with my thesis project.

 

I've to develop a software acquiring data from a balance (METTLER TOLEDO BBA422) using the rs-232 serial port. I've to make the program wait for the operator's input (he has to press a key on the balance), and then the balance will transmit a string through the serial interface.

I've tried to use the VISA in order to read the data, but it seems impossible to read anything from the instrument; i've used configure, read and close serial VISA inside a while loop, but when I press the keys nothing seems to happen.

 

The configuration seems to be ok (baud 2400, 8 bits, 7 even, XONXOFF) 

 

Do you have some suggestions?

 

thanks in advance

0 Kudos
Message 1 of 17
(5,053 Views)
Are you sure you have the correct type of cable? Have you verified communication with a program such as Hyperterminal? That should be your first step.
0 Kudos
Message 2 of 17
(5,033 Views)

Yes, I'm sure about the cable and the functionality of the COM port, just I can't understand why I can't see any string at all from the balance.

0 Kudos
Message 3 of 17
(5,029 Views)

If you can actually read some data with Hyperterminal, then there is no reason that LabVIEW cannot do the same. Why don't you post the code you've written?

0 Kudos
Message 4 of 17
(5,018 Views)

Dennis, first of all, thank you very much for your helpfulness (i'll write a lot on this forum during these weeks.. hoping to help someone a the end :)) 

 

Just to be clear, in Hyper terminal which steps do I have to do? I opened it and connected to the COM1 port, after having set the balance to "countinuous output" mode. Actually, I see nothing.

 

I post a copy of the code I used today in order to try to communicate with the instrument:

 

 

Message Edited by Stefano Moret on 07-20-2009 04:02 PM
0 Kudos
Message 5 of 17
(5,008 Views)

I'm confused. You said you were sure about the cable and functionality of the com port. What did you base that statement on? If you are running a utility program from the vendor and getting data, then perhaps you don't have the com port configured exactly correctly or there is some other step that you need to do in order to have it output continuously. If the com settings are incorrect, the balance isn't even seeing the output continously command.

 

Once you get data in Hyperterminal, we'll worry about the LabVIEW code. It's not at all very effective.

0 Kudos
Message 6 of 17
(5,000 Views)

I was told by my colleague that he already used the COM ports and everything was going right. Which steps should I make in order to check the instrument output with hyperterminal? I created a connection with the port and waited for the instrument output (i tried also to send manually) but I saw nothing. Anyway, maybe I did something wrong in the procedure.

 

0 Kudos
Message 7 of 17
(4,985 Views)

You were right, the problem was with the serial cable!

 

What were the mistakes in my VI?

0 Kudos
Message 8 of 17
(4,951 Views)
The biggest problem is that you should not initialize the port with every iteration of the while loop.
0 Kudos
Message 9 of 17
(4,949 Views)

Ok, I have understood what I need to do. My VI works.

 

Now I have one more problem: I've also to connect a "bar code reader" using the keyboard port. I created an interface which reacts perfectly to keyboard input (key press) and reads everything. My problem is that when I connect the reader, it happens sometimes I dont' see anything from the program and, also, I can read only one character. I used the input device controls.

 

Any ideas?

0 Kudos
Message 10 of 17
(4,893 Views)