Jump to content
Sign in to follow this  
stefzyc

First Project with V130 and Modbus communication

Recommended Posts

Hello,

Thanks all for you help in this forums, I see lot of informations that I will use for my first project with Unitronics IHM.

My application is simple for most of Unitronics user but for me it is a little "hard"

My project :

- I have a V130-33-R34 module with an interface IO-AI4-AO2

- I will connect 2 Ana 4-20mA inputs to the V130 and 3 Ana 4-20mA inputs to the IO interface.

- I will use 2 Ana Outputs 4-20 mA to the IO Interface too.

The application is to transfert the 5 analogic inputs to the modbus.

And have the analogic value on one or several screen(s) only for local information.

I am looking for the modbus programming as slave so I've found the example in the help documentation (file V130_Modbus_Slave.vlp)

If I used this example, The PLC master could be able to read the 5 analogic input value by pointing The "MI" adress ? without other programming ?

Is it possible to change the ID modbus adress by a V130 display and Variable and not by programming ?

because in site this Id modbus adresse could be already used by other equipment.

Thank you for your helps and knowledges.

Stef

Share this post


Link to post
Share on other sites

Hello,

it is very possible to do everything you want to do. A couple of things for you to think about.

Are you going to want to use the V130 screen to show your analog input values in engineering units (PSI, Feet/Sec, RPM.....Etc)? If so then you will have to do some programming to show these values on your screen in a scaled value, but not much. If you only care about showing the raw values comming in for the 5 analog devices then you only need to know the MI location so that you can address the requests from the master correctly (and if you want show the raw values on the V130 screen).

If you are going to take the time to scale the analog values in the V130 then you may want to have your master pick up the final scaled values instead of the raw signal values. If you want to do this then you will want to linearize (scale) the signals in the ladder code so that you can save the scaled values into MI locations and then you just pick up these values.

Keep in mind that the resolution of the 2 analog inputs are not the same as the inputs you will have on the IO card. The inputs on the V130 are 10 bit so your signal will range from 204 - 1023 (for a 4-20ma signal) and the signals on your IO card are 12 bit and your raw data range will be from 819 - 4095. So if a sensor's resolution is critical then put those sensors on the IO and ones that are less critical should be the 2 you put on the V130 (you can put 4 on the IO and only one on the V130 if it helps out).

On the PLC ID, you have the ability to make the ID when you set up the slave settings not a fixed bumber but to have the ID be set by the value of an MI. You can set this MI value on screen (if you want...small programming required) or you can just use the PLC information mode to force the value of the appropriate MI to make the ID to whatever you want without any screen programming. Since the ID will only be set one time its your choice but eiter is simple. The information mode way at least you have a password protection to stop inquiring fingers from changing your ID number without needing to make password protected screens (more programming involved).

On the analog outputs. You don't say what you want to do with these, but do you really need them if you are going to pick up the sensor values and send them to a master device using a modbus RTU connection.

Your master device will have to be set up to communicate with the same communications speed, data bits, stop bits, and parity so you may have to make your communications speed changable as well to work more smoothly with your master device (if you are able to decide with certainty what communications speed you will use then just set it in the com port intialization function block you will have to have in ladder and be done with it). If you do decide you need to have the communications speed changable then you will have no choice but to do some programming to make the speed changable by either using the HMI screen or using the information mode again to set the appropriate memory location to activate one of several com init function blocks that you will have to set up with an equals compare function block on each line so that only one com init can ever be executed at one time.

I'm sorry you have to do it this way, but while you can actually change speeds and ID directly in the information mode you will have a function block for the modbus communications that will overide your selection on ID at startup. And on the com speed, as soon as you turn power off to the PLC all of the values will reset back to default values unless you change the values using the indirect MI approach (try to make a fixed com speed value and make the master change to your speed and not the other way arround and your programming becomes much smaller)

Any way you look at it this, it is not too hard to do and learning can be fun.

Keith

Share this post


Link to post
Share on other sites

Thanks for your reply Keith,

These informations will help me for this application. I am writing the program and it will be possible to test it this week I hope.

In fact we used the V130 for a analogic duplicator for the 2 The analogics outputs.

We read the 2 Ana Inputs and them send the value to the 2 Outputs for 2 machines that used it.

And this use, as analogic signal duplicator, is cheaper than other way.

Stef

Share this post


Link to post
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.

Sign in to follow this  

×
×
  • Create New...