Andrei Blagaila

Hex adresses while comunicating

6 posts in this topic

I have a question. Take for example I have a SW that contains a lot of variables D, B, M etc... On the Rack I have a PPC that is used to collect data from the PLC (using C written software). In that communication software it has addressed written as hex (ex: 0xFF02). How can I tell what is that linked to in my PLC software? Is there a way? For example I have M200 in the software. How can I address it in the C software to read it's value (true or false), or for a word like D200 the same question. Is there a way? PLEASE HELP!!!

Share this post


Link to post
Share on other sites

 

Think we will need more info. What PLC and what software are you referring to? There is obviously no problem converting Hex to decimal (just google it if you don't know). OxFF02 is 65282 as an unsigned 16bit Integer. I would question that is an address the program is writing to - if anything that could be data.

 Can you post any of the C code here? 

 

 

 

 

Share this post


Link to post
Share on other sites

I use a Q50UDEH with a WinCPU or PPC on the older models. The WinCPU or PPC runs a c code that gathers info from the PLC and sends it to the host. I am interested in understanding how does it do that. I learned that the WinCPU or PPC has access to all the memory of the PLC. I just want to know if in the C code I want to call a variable M200 how do I do that. Does M200 have an address in the PLC that I can call. I assume it's a HEX address but i'm not sure. I cannot post parts of the code unfortunately :( Confidentiality clauses. I basically want to find out how the memory can be accessed from the outside. 

Share this post


Link to post
Share on other sites

 

You talk about WinCPU and PPC - but are you really talking about the C Controller module? 

If you are talking about bespoke software written on an industrial PC then it is impossible to help you without seeing the source code (are they using custom subroutines to talk directly to the PLC or using OPC etc).  If you are actually referring to the C Controller module then there are examples from Mitsubishi on the web.

http://dl.mitsubishielectric.com/dl/fa/document/catalog/sol/ccpu/l08211eng/l08211enga.pdf

 

Either way if you are not familiar with C or C++ then you are in for a steep learning curve.

 

 

   

 

Share this post


Link to post
Share on other sites

Where did you find "FF02"?? In a C line of code, or in a GUI for a software? It's really hard to help you without more information than this.

Based on your previous posts and this post, my guess (and only a guess) is that the WinCPU is using MC protocol. MC Protocol can be written in any language you want to (C, C++, C#, VB and all non-Microsoft programming languages that supports a communication stack) as long as you have a serial or Ethernet communication line (or special PCI cards from Mitsu) to communicate with PLC's from them. Basically it's just a well-defined protocol for exchanging data with their PLC's.

In MC protocol you address devices using first a "function-code" (this indicates what kind of device/memory you are reading/writing/modifying) and then you input the start address (and then length+++). This is put together in the stack to form a complete telegram, which the PLC responds to (if correct put together).

I have published the manual for MC protocol here on MrPLC in the past, here's a link to it:
http://forums.mrplc.com/index.php?/files/file/1086-q_l-melsec-comms-mc-sh080008lpdf/

Again; note that this is only my guess based on previous topics you have. It's very hard to tell without more information - we don't even know how the hardware looks like in your case (like @Nightfly writes you might, or might not have a C controller - who knows).

@Andrei Blagaila: You should either take some pictures of the cabinet where everything is mounted, or make a drawing of all components. Again as @Nightfly mentioned we really don't know exactly what kind of software/hardware you have at the moment.

Share this post


Link to post
Share on other sites

I can tell you the HW configuration. It's definitely a WinCPU and not a C controller. In the past it was a PPC.  i'll try to get more info when th machine will arrive where I am. I wanted to understand how the WinCpu accesses the PLC data. I am going to go over the file @kaare_t uploaded and try to undestand. Unfortunately I don't know much about C and C++ and it's a bit difficult to understand but not impossible. FF02 was found in the C code. 

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