Robror

MX2 Modbus doubt

7 posts in this topic

Hi there!

I'm programming a CP1L-E CPU to control 3 3G3MX2 inverters via Modbus. It got some things right, like the INV002_Refresh_X31 block and its parameters. The thing is, I also want to read some parameters from the inverter using the INV206_ReadParameter block. My doubt is, do I need to be careful so both blocks don't execute at the same time and use the serial port at the same time? Is it better to use one INV206_ReadParameter block for each parameter I want to read?

Thanks in advance!

Edited by Robror

Share this post


Link to post
Share on other sites

Sequence the instructions, and I would personally use the same ReadParameter block and just modify the address.

Share this post


Link to post
Share on other sites
51 minutes ago, photovoltaic said:

Sequence the instructions, and I would personally use the same ReadParameter block and just modify the address.

Thanks for the reply.

So If want to read 3 different parameters from those 3 inverters, is it better to use one ReadParameter block for each parameter and change node number or to use one ReadParameter block for each time I read a parameter (changing both node number, parameter no. and parameter size).

I assume you meant the first option.

 

Share this post


Link to post
Share on other sites

I personally change both node and index  and only have 1 read instruction. Stops you from accidentally issuing multiple commands at the same time and uses less memory

Share this post


Link to post
Share on other sites
1 hour ago, photovoltaic said:

I personally change both node and index  and only have 1 read instruction. Stops you from accidentally issuing multiple commands at the same time and uses less memory

Do you also change Parameter size and Value output in case you're reading different size parameters? Do you use pointers to achieve that?

One last question, Refresh block must be enabled with a P_On, right? Do I need to place ReadParameter blocks (in case of using more than one) above it? I was thinking on enabling Read block after Refresh block's busy signal goes down and so on, but Refresh block must be always on right?

Sorry for making so many questions, it's my first time using these FBs!

Share this post


Link to post
Share on other sites

Both blocks need to be on all the time, and like you said use the falling edge of the buys bit to trigger the parameter read. Adjust the interval of the refresh block so it won't interfere.

 

I would use a carousel to feed the values into the blocks as needed. Advance it upon completion of the block.

Share this post


Link to post
Share on other sites
1 hour ago, photovoltaic said:

Both blocks need to be on all the time, and like you said use the falling edge of the buys bit to trigger the parameter read. Adjust the interval of the refresh block so it won't interfere.

 

I would use a carousel to feed the values into the blocks as needed. Advance it upon completion of the block.

I don't know if I'm missing something. I'm using two INV206_ReadParameter blocks to read frequency and current from inverters. My INV002_Refresh_X31 block is always on (P_On in EN input). I use falling edge of refresh busy singal to execute first ReadParameter. Then I use falling edge of this block to execute next ReadParameter. I got a word where I store the nº of inverter to read (1 to 3), I add 1 to this word everytime the secon ReadParameter block finishes, and goes back to 1 when needed.

I notice that I/F Area registers, where you set frequency and start/stop commands, changes values sometimes, and ReadParameter blocks take a couple of seconds to execute. Am I doing something wrong? I understand that start/stop commands can be activated by simply activating the correct bits of I/F Area, and same for frequency data. I don't know if this is correct.

PS: I have no inverter to test right know, maybe this is just normal behaviour when you have no port or inverters connected?

Edited by Robror

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now