Jump to content

Communication through RS232


Drozerce

Recommended Posts

Hi guys,

 

I'm still working on my project. So I have a PLC V130. On the other side, I have a Weighing Indicator that I want to communicate with through RS232. I need to read 4 weighing values from this indicator in the PLC, so I can use them in my calculation program.

 

But I'm not very sure how to do that!

The weighing Indicator has very poor documentation and for RS232 communication it says:

 

I'M SENDING PART OF THE MANUAL IN ATTACH (page 35 and 36).
 
So, what I have tried so far is:
 
1. I have created in the PLC program for reading the values from the weighing indicator. I don't know if this is the way, but as I saw it is not working! I attached a pic with the ladder (see attach)
2. Connected the PLC and Weighing Indicator with the same cable that I have got along with the PLC for serial communication;
 
So, my questions are:
 
1. Can someone explain me how to do this communication? How to configure the software in the PLC? Where and what to look for?
2. Is there any example program for this kind of communication except those in Examples in the Unitronics Software?
 
If you do need some more information, I'm here... 
 
Thanks in advance,

Technical Manual LD5250.pdf

post-20227-0-36477000-1389344543_thumb.jpg

Link to comment
Share on other sites

  • MVP 2023

This scale is not a modbus device.  You are going down the wrong path - get rid of the modbus stuff.

 

Read the Help on the Protocol Config and Scan blocks.  According to the manual you can set the scale to continuously broadcast the weight, so you should be able to catch the string using Protocol Scan and then extract the weight from it.

 

I have found it very helpful when dealing with a serial device to first connect it to a computer running a terminal program to get an idea of exactly what the strings look like.  You can use this information to determine if you have the PLC configured correctly and where the data you want is in the string.

 

Look at the example Projects->Communication "V130 Display String from Hyperterminal".  It won't extract your weights, but it will get you started on talking to the scale.  That's the hard part.

 

Have a go at it and attach your program next time.  We can do a better job troubleshooting the problem if we can actually open the code.

 

Joe T.

  • Upvote 1
Link to comment
Share on other sites

  • 2 weeks later...

Joe, thanks for your replay,

 

I have seen the manuals about what you said. But I still have one thing not clear...

I have a Vision 130 PLC. On this PLC I have a RS232 port, looks like telephone cable connector (port on which I can connect the Unitronics MJ10-22-CS25 cable).

On the document that I send it to you (LD5250, page 14), there is pinout for the serial cable RS232C. On this MJ10-22-CS25 cable the pinout is different.

Now, what is my question, can I make a cable with an appropriate pinout and use the same port in the PLC? I can make a cable with a standard serial conector from one side to connect to the LD5250, and from the other I can use a connector same as  MJ10-22-CS25 cable to connect to the PLC. Can I do this, or I need to buy a new serial card for the PLC?

 

thanks in advance,   

Link to comment
Share on other sites

  • MVP 2014

There is no need to buy a new serial card.  The issue is with how the DB9 connector is terminated.

 

One option is to see if you can purchase an MJ10-11-CS76 from your local distributor.  This is for serial modems, but also works quite well for other devices that have a standard 9-pin female serial port.

 

You may also be able to get it working on the MJ10-22-CS25 if you use a null-modem cable between that plug and the scales.

 

In both cases turn off hardware handshaking (or hardware flow control as it may be called) on the scale.

 

You can make a cable direct from the RJ12 modular plug to DB9, but even if you know what you are doing (and have done this before) it can be confusing trying to get the right pinouts on the RJ12 connector, so take your time and don't panic.

Link to comment
Share on other sites

  • MVP 2023

I think he probably needs a -CS26.  If you look carefully at the Unitronics interconnecting cable with the RJ12 plugs on each end you'll see that the conductors are reversed in it, effectively creating a null modem cable.  To talk to a device such as a scale you need to keep the RX and TX wires crossed.  The -CS76 connector un-crosses them for the modem.

 

If you're handy with a soldering iron or have a pin crimp tool you can make your own cable.  Making "first contact" is always the hardest part of serial communications - read the Help on how the serial port on the Unitronics is wired.  You're going to just have to take a deep breath and dive in to understand which signals need to be connected where on each side.

 

Joe T.

Link to comment
Share on other sites

  • MVP 2014

Joe, from my recollection, the -CS26 is just the old version of the -CS76.  Did you mean the CS25?  The CS26 was used for 9-pin modems before the Jazz was released.  Post-Jazz we needed the CS76 to supply power via pins 1 and 6 to the Jazz comms adaptor.

 

If the scales are wired as a DCE (modem) then the CS26 or CS76 is needed - no crossover

If the scales are wired as a DTE (PC) then the CS25 is sufficient.

 

If it's just a 3-wire port (RX, TX and GND) all you need to do is swap RX and TX if it doesn't work first time.  This is why I suggest turning off hardware handshaking/flow control at both ends if possible.

Link to comment
Share on other sites

  • MVP 2023

Simon - your recollection is correct.  I'm just looking at what I still have in stock.  I'm also thinking that the gender between the CS25 and CS26/76 is different, which may be confusing as to which one is needed.

 

The main point which you also make is that serial communications usually require a bit of experimentation with the cable to get them to work.

 

Joe T.

Link to comment
Share on other sites

  • 4 weeks later...

Hi guys,

 

I'm not pritty sure about this serial connection, so I was thinking to connect with this measuring indicator through 4-20mA. But, now I have another doubt...

1. If I connect measuring indicator to the PLC to analog input 4-20mA (version of the PLC is V130-33-38), I should use the Linearization Function Block, correct? For input value I should choose the MI/ML from the HW card, where I connect the wire for 4-20mA? But, because is MI (integer), on output of the LINEAR block should I recive the value in decimal, or hole number?

2. Why Positive/Negative Transition Contacts are not working? Neither of this contacts are working, no Positive no Negative contact. Can you tell me what I can use as a replacement for this contacts? For example for Positive Transition Contact I can use Timer Coil (TE), but for Negative Transition Contact I don't know what can I use, because there is no such timer that is activated on negative edge.

 

Regards,

Link to comment
Share on other sites

  • MVP 2023

1.  Yes, you use the MI defined in hardware as the X input to the Linear block.  The output of the block will be an integer; if you want a decimal you'll have to imply it and remember what it was throughout the program.  For example, if the scaled output max is 100.0 you enter 1000 in the Y2 value.

 

2.  Usually when something doesn't work it's in a subroutine that's not being called.

 

 

Can you post your program?

 

Joe T.

Link to comment
Share on other sites

  • 2 weeks later...

1.  Yes, you use the MI defined in hardware as the X input to the Linear block.  The output of the block will be an integer; if you want a decimal you'll have to imply it and remember what it was throughout the program.  For example, if the scaled output max is 100.0 you enter 1000 in the Y2 value.

 

2.  Usually when something doesn't work it's in a subroutine that's not being called.

 

 

Can you post your program?

 

Joe T.

Hi Joe,

 

Have you look into my program? Do you have any suggestions about my question?

 

Thanks,

Link to comment
Share on other sites

  • MVP 2023

I don't think you are using your timers correctly - in Unitronics the timer coil causes a related contact to close when it times out.  You appear to be using the timer as both a coil and a contact.

 

Your ladder diagrams are also overly complex.  It's usually better to break complicated decisions into a couple of pieces.

 

A |P| and |N| contact allows power to flow for one scan when that memory location goes true for a |P| and false for an |N|.  You have to have a coil referenced to it to drive it.

 

I've redone the valve logic in Net 4/Sub 8 (now Net 4 through Net 6) to what I think you're trying to do.  Let me know if I understand what you want. 

 

Joe T.

 

 

Betonerka_Gostivar_27022014 JT.vlp

Link to comment
Share on other sites

Thanks Joe for the advice,

 

You are correct about timers, but I'm doing this because I don't need a coil of the timer, and because I don't have in Unitronics only contact from the timer, I'm using the timers as coil and contact and so far is working OK.

 

For  |P| and |N| I did't know that I have to have a coil reference to it. As I said before, this is my first time with Unitronics. With Siemens and ABB it is not like that, also for the timers:)

 

How ever, I can try follow your advice and see what will happen.

 

Thanks, again...

Link to comment
Share on other sites

  • 2 weeks later...

Hello Joe,

 

For my project I need to use a Flow meter for measuring the water. I have found some Flow meters (ABB, KROHNE etc.) that have 4-20mA output that I can use to connect to my PLC. But, all of these are too expensive, the customer doesn't want to buy any of them.

In other case, I have found a Flow Meter that has pulse output and it says that it can be connected to a PLC. In Attach I'm sending you zip from the same.

 

1. Can you tell me, if I'm doing the right choice?

2. If I'm, than, can you tell me, should I use normal Input to the PLC? Should I use FB Immediately Read Input or not, or should I use High Speed Input?

3. If I'm not doing the right choice, can you tell me what to use for Flow meter?

 

Thanks in advace, 

IMPULSE DEVICES instructions - ENG.zip

Link to comment
Share on other sites

  • MVP 2023

That device should work fine - it's just a simple reed switch.

 

Before you decide how to connect it, you need to know what the maximum pulses per second it will generate.  What kind of data do you have on the flowmeter?  It should have something about pulses per gallon or pulses per liter and what the maximum flowrate is.

 

Joe T.

  • Upvote 1
Link to comment
Share on other sites

  • 1 month later...

Hi Joe,

 

sorry for not answering you before...

The Flowmeter has data pulses per liter, and it is configurable, it can be 1/10/100/1000 liters per pulse.

Here are also the Technical char.:

The Cable lenght between the PLC and the Flow Meter is cca 10 meters.

 

5.   TECHNICAL FEATURES   Contact type Normally open        Normally closed
GSD5-R                    GMB-RP-R GSD8-R
GSD8-45-R GMDX-R WDE-K30-R TAN-X5-R Material of the REED contact Rhodium Maximum switching power  ( W ) 10 Maximum switching current ( V ) 100 Maximum switching resistance  ( A ) 5 Contact resistance ( Ohm ) max 1 Breakdown voltage  ( V ) min 150 Insulation resistance  ( Ohm ) min 109 Operating time  ( ms ) max 5 Releasing time ( ms ) max 3 Capacity ( pF ) max 5 Resonance frequency ( Hz ) min 5000 Operating temperature ( ° C ) -60 y125 Max frequency ( Hz ) max 400 IP protection 66 Cable lenght 3mt

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...