andre.umbul Posted June 24, 2013 Report Share Posted June 24, 2013 I have a v130-330R34 (A). I've been trying to setup the Modbus TCP slave function of it using a Kepware OPC server as the master. For most part it works (MB, MI and ML). However I've been having issues retrieving the MF data. The two registers I need to grab are MF12 and MF13. I've following the manual by using the following calculation to get my modbus addresses (16384 + 400001 + 12*2 = 416409 and 16384 + 400001 + 13*2 = 416411). 16384 being a decimal representation of 4000h . I think i've pretty much tried every single permutation and still can't get it working (offset of 1 per index instead of 2). I've also tried swapping the high and low bytes in the PLC using the struct and swapbytes function and I still don't have any luck. Any one can provide any assistance? Andre Quote Link to comment Share on other sites More sharing options...
Ofir Posted June 24, 2013 Report Share Posted June 24, 2013 Hi Andre, If I'm not wrong the calculation should be as follows: MF12 - 400001 + 16384 (4000h) + 12 = 416397 MF13 - 400001 + 16384 (4000h) + 13 = 416398 Make sure you are reading 32bit register. Quote Link to comment Share on other sites More sharing options...
andre.umbul Posted June 24, 2013 Author Report Share Posted June 24, 2013 Thanks for your help. It looks like my Kepware OPC server does not support 32 bit registers. Are there easy way to split an mf into two separate 16 bit registers? Andre Quote Link to comment Share on other sites More sharing options...
Gabriel Franco Posted June 24, 2013 Report Share Posted June 24, 2013 STRUCT FB allows it Quote Link to comment Share on other sites More sharing options...
Ofir Posted June 25, 2013 Report Share Posted June 25, 2013 Hi Andre, You can try reading the address in length of 2 (32bit register = 2 x 16bit register). Anyway if you wish to split MF to 2 MIs you can use the function "Copy Memory". (Vector menu -->Use Offset --> Copy memory) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.