LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

When I use the RS-232 or RS-422

Solved!
Go to solution
In my Application I should read from An ABB Flow Meter "Mag Master" through Serial RS-422
 
actually I don't have the protocol for this device,
but i can read from it using hyper terminal,
it's Parameters are:

Baud rate : 4800 / Data bits : 8 / Stop bits : 1 / Parity : NONE / Handshaking : NONE (OR RTS/CTS)

Actually I can read from this device using labview but i need to read from it continously and i need to read different things

so my problem is when i send another command to read it , it gives me an error "Frame character error" and if i run it again it 'll read it with no error.

 

so  any one can help me to find out what's the problem here?!!!

I'll be so thankful for your cooperation

Mahmoud Alshair
Intelligent Systems Integrator ( ISI )
System Developer
0 Kudos
Message 1 of 10
(5,448 Views)
As you can read from the device, most possible error could occur from timeout, or end character.
Check those two settings in your vi. Enable or disable them.. (i did not read the pdf..)
 
If you have further problems, you should post your vi. Maybe we can say something more.
0 Kudos
Message 2 of 10
(5,443 Views)

Hi there,

I know that the problem is one of things you 've said but i can't get it

so i 'll attach my vi  and u can check it and tell me your comments

let tell u how i read from it using hyper terminal;

first i click "Enter" to start the communication ________________ it replies :  Read 1>

then write "1"  then I ckick "Enter"____________ it replies : Read Flow 1> 0.0

then if click "Enter" again __________________ it replis : Read Flow Fwd 2> 0.0

and if write "5" then i click "Enter" ___________ it replies : Read Net 5> 0

and if want to quit i write "q" then i click "Enter"

and once again i write "q" then i click "Enter" ___________ so it replies : bye

so if you can do any thing pls let me know

and if u want to test the device online by using remote desktop just tell me the suitable for u and i 'll be ready

thanx

Mahmoud Alshair
Intelligent Systems Integrator ( ISI )
System Developer
Download All
0 Kudos
Message 3 of 10
(5,406 Views)
Solution
Accepted by topic author M.Shair

You don't say if your vi works (partially). What strings you are receiving, where is the problem focused?

Just guessing, your device sends you a line feed , at the end of each answer. If that is true, you don't need all those settings.

First don;t open and close your port continiously. Leave it open. Iniallize it only with VISA Configure Serial Port. I don't think you need all the other property nodes. Leave flow control to none, set a timeout of 3 sec, enable termination char, and that should do.

Write a command and then simply read it. No delays, no bytes at port.  The read will terminate automatically when it will receive the termination character, or it will timeout (error. no responce)

Tell us what your progam reads, and maybe i can say more.

 

Message 4 of 10
(5,393 Views)

What you mean of my VI works partially?        any way it works as a sub VI in my project

this sequence it goes when i read from the hyper terminal :


ABB Kent-Taylor
Process Magmaster
V 1.10  17/05/93
1
Read Flow 1> 0.0  5
Read Net 5> 0?
Read Net 5> 0  1
Read Flow 1> 0.0?
Read Flow 1> 0.0  5
Read Net 5> 0?
Read Net 5> 0

Descibtion of operation :

first i start with clicking "Enter" , it replies with :

ABB Kent-Taylor
Process Magmaster
V 1.10  17/05/93

then i write "1" and click enter , it replies with:

Read Flow 1> 0.0 

then i write "5" and click enter , it replies :

Read Net 5> 0?
and i click enter again to get the result :

Read Net 5> 0 

 

and i can do the same for any number i want from 1 to 6 in the same procedure

but if run a VI to read it will gives errors like " Timeout , A framing error occurred during transfer."

so if you can connect on online and then you can test this device and make online test

thanx

Mahmoud Alshair
Intelligent Systems Integrator ( ISI )
System Developer
0 Kudos
Message 5 of 10
(5,343 Views)

I see a couple problems with your code.

Your sub-VI is RS-422.vi.  But the way it is coded is more like a top-level program where it loops continuously until the stop conditions are met.  Even if that sub-VI still manages to behave like a sub-VI, your "sub-VI" runs the VISA configure everytime it is called and closes the port at the end, so that will either just slow down the whole serial communication, or worse, run the risk that you lose some incoming bytes.  Only execute the VISA configure once at the beginning of your program and the end of your master program.

Also, the way you manipulate the incoming data doesn't make much sense.  You are putting the data into an array based on an index value that gets passed in from the main VI, so it is either 0 or 1.    What do you ultimately do with this data as your Main VI doesn't get it out by way of the sub-VI's connector panel.



Message Edited by Ravens Fan on 05-27-2008 08:43 PM
0 Kudos
Message 6 of 10
(5,317 Views)

Just wondering if any one can help me.

I'm trying to connect my laptop to a magmaster 2 line display using hyperterminal.  The first time I connected and tried to access the menue it came up with odd symbols (u and $ type thing)  Since then I re opened hyperterminal and now I cant get anything to come up I assume it is not connecting to read anything?  Doesn any one have any experience with magmasters and hyperterminal that could help me out?

thanks

0 Kudos
Message 7 of 10
(4,775 Views)

If you're not getting ANY communication (even with the most basic commands) via hyperterminal it means one of a few things.

 

1) Your device isn't working (not powered/broken).

2) You don't have your device plugged in properly.

3) You don't have the right commands that actually issue responses.

4) You don't understand how to use hyperterminal.

5) You have a problem with your mobo/serial ports.

6) You have a severe problem with drivers/hyperterminal.

 

I tried to put those big typical-problems in order from most typical to least typical, but the most important question to ask is "Have I ever gotten something like this (or exactly this setup) to work before?" If yes, what's different? If no, simplify your setup somehow. 

 

Unfortunately I don't know anything about Magmaster, but I've had my fair share of hyperterminal communication problems. Sorry if that advice is overly general/useless, but it's all I have without more information/symptoms.

0 Kudos
Message 8 of 10
(4,747 Views)

Odd symbols may indicate a baud, parity, or stop bit setting which is incorrect.  Any of these can cause framing errors which may appear as strange characters.

 

Lynn

0 Kudos
Message 9 of 10
(4,739 Views)

Thanks got it sorted had a problem with me one of my connectors

0 Kudos
Message 10 of 10
(4,725 Views)