Jump to content

Help understand a piece of program

Recommended Posts



A friend asked me to modify him a scada software, he wants to change some controls. The scada software comunicates by modbus with a V120 which is conected to a V130.

The person who wrote the program is unreachable and he didnt leave any comments in the program. At least there is a subrutine named Scada.

At the begining of the subroutine is this piece of program that I don't understand what it does (see attachment).

If someone can explain me what is going on there I would be greatefull.

Thank You.


Best Regards.


Link to comment
Share on other sites

Hi nkwai,


It is very hard to determine just from the one net.  The MODBUS scan means the controllers is a MODBUS slave.  The reset looks like there is data that is being stored in a bit map and the programmer is using num to bit and bit to num to convert between decimal format and binary format but it is difficult to see much else.  If you need any help understanding the program please feel free to send an email to support@unitronics.com.  





Link to comment
Share on other sites

Ok, after some hours I think I understood what it does.

The first 20 bits of DW3 covers the digital imputs from I2 to I20

The bits of DW6 covers the MB from 340 to 371

And the bits of DW4 covers the MB from 300 to 331

And the three DW are use to comunicate with the scada software

Now I just need to find the "pinout" of the three DW.

I think this was used as a workaround for the 24 tag limit of the licence, this way only 3 tags are consumed.

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.

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...