RS-232 to 4-20ma Current Loop: Quick RS-232 side question
xanatos
Posts: 1,120
Does a current loop converter (232 to 4-20) require a continual refresh of the RS-232 data, or is it a send once and shut up until a new level setting is required? In other words, do I need to continually loop with a SEROUT to maintain the 4-20 output, or just when the sensed signal on the stamp-side of things changes? My stamp is driving the 4-20 converter, and it's a one-way communication).
Thanks!
Dave
Thanks!
Dave
Comments
As absurd as it might seem, I did not know it was two states -- or binary. I thought it was some sort of calibrated analog communications. Does it have a bit rate?
Or is it more akin to pulse wide modulation?
The answer to Xanatos' question is highly device specific. It could be implemented either way. Holding the last received value is the easiest thing to do but in some applications you'd want a timeout to prevent a held value from being assumed true if comms are lost. That in turn might be configurable.
Sorry, my post was later than yours, which fell off the screen!
No bit rate or PWM to a signal like this. It's a scaled analog value. An example may be a transmitter for a thermocouple that would transmit 4mA at 40 degrees and 20mA at 250 degrees. Current loops are popular because they tend to be more noise immune than voltage loops over longer distances.
Reading the OP, it looks like its a serially controlled 4-20 mA interface. Send it a serial string and the output would be maintained at some analog level between 4mA and 20mA until reset to another level.
The other device mentioned (more commonly called a 20mA current loop converter) is used to transmit serial data in electrically noisy environments. The rs-232 signals are converted to a data stream of 1's and 0's corresponding to 0mA and 20mA. It is also possible for the 0mA to be some slightly higher value (4mA) so that it is easier to tell if no signal is caused by a low bit or a broken wire(open circuit).The receiver runs the current through a resistor and turns the resulting voltage mark/space into a serial string.
B&B Electronics' website has numerous technical articles on everything in digital communication.
Cheers,
The converter I am using is here: http://www.l-com.com/item.aspx?id=6981
I'm hoping it's set-n-forget... :-)
Dave
Essentially what you want is an analog-to-serial converter. Your level goes in one side from the level transducer and a serial string comes out the other side. If this is a hobby project, it will be cheaper to use a Stamp and an a/d converter chip (LTC1287) than find a suitable commercial product.
Feed the 4-20mA through a 250 ohm resistor to generate a voltage. Get the Stamp to read the voltage and send out a serial string as the analog level changes.
Cheers,
Any of the current loop and particularly the 4-20mA version is very immune to noise and often used in industrial environments.
The best way to implement these is to have a power source, often 24V, at one location, usually the master location. The loop is twisted pair wire.
Noise pulses hitting the twisted pair wire inductively couples equally to each wire in the pair, effectively canceling the noise.
Duane J
Hi Tom,
Actually, it's the other way around - I need to send the RS-232 out to the converter. I'm not receiving the current loop, I'm sending on it. Are you saying the converter I've specified does teh mark-space thing and not the level thing?
Dave
It looks to me these are not the analog 4-20mA type.
They are used to communicate digitally in Full duplex , 19.2Kbps up to 4000ft.
Definitely not analog, as I see it.
Duane J
Thanks folks,
Dave
A/D and D/A
There are probably many others.
Duane J
-Phil
That RS232 to Current Loop Converter is definitely not what you need to do what you describe in post #9. It converts the digital data represented by the + and - RS232 voltage levels to digital data represented by 0 mA and 20 mA current levels.
What you need is a D/A converter that produces 4 mA at 0% and 20 mA at 100%. A current output D/A will do that, but you will have to do some math.
On that wayjun site this is the device you will need:
http://www.wayjun.net/index.php?main_page=product_info&cPath=3&products_id=41&zenid=0b4262bd26c8d8c6c3ba3764b806af98
You will need to hook it up to a terminal for bidirectional communication to set it up, as described in the manual. Setup is a bit obscure but once you get it configured you can blindly send it output level commands in set-and-forget mode. I strongly recommend setting it up with a terminal and sending it commands while you watch the output with a milliameter to get a feel for how it works. As described above, when you send "zero" the output should read 4 mA, and when you send it "max capacity" it should read 20 mA. You can just hook the milliameter directly across the current loop output terminals.
In the field, you may need to calibrate the levels so that the PLC reading agrees with what you intend to send. That will probably be easier to do at the PLC end; you'll want a test mode where you can force zero and full-scale for this purpose.
Coincidentally I just did this in the other direction, with one of their products that takes the 4-20 signal and converts it to digital. It doesn't broadcast -- I have to poll it for the current reading.
Perhaps if you clarify what bits you are in charge of, and what you are given, and what you need to talk to.
So far I have decoded Tank Fill on one end and PLC on the other.
Tank fill implies a Sensor with ?? output, and PLC will most likely expect a linear 4-20mA Analog value.
-Phil
Again, the device you referenced is for digital communication. Some of the most recent posts describe the device you'll need.
If you have ever tried to get that sensor data into a PLC you'd understand why analog persists. It's the only universal standard. You don't have to worry about baud rates or worse protocol tics or parsing or repeat rates or timeouts. Solutions to the all-digital route have been tried, and none has gained universal traction; everything is particular to either a manufacturer (e.g. modbus) or an industry (e.g. SMA). If you want to be SURE some random industrial controller will read your output, you will provide it in analog form.