Pooling Data from Multiple PLC in vb6

E

Thread Starter

Edgar

Hello Guys

I have created a Automation Program for my Home and like all other Automation software writing Data to the Device is the most important task of the program. i have created a loop with a timer control in vb6 with the interval to 300. i'm using Modbus Protocol and so far is OK but my only problem is that sometime when i try to write data to a plc IO it doesn't go through. I have to write to it again in order to complete the writing task. I think is the Driver is either at the beginning of requesting data or at the end of receiving data. And I have no clue on how can I fix or stop this from happening. this program is great so far but that is the only damn thing that is holding me back…

Here is how I implemented

1- Startup
2- Load all drivers for each enabled Comm Port or Ethernet

Loop start here for serial device from 1 to 128...

1- Check if device number ### is enabled
2- Check writing Buffer for Command
3- Execute Command if any
4- Request DI Table (50 Points at a time) or up to what ever point is defined
<> Repeate 2 and 3
5-Request DO Table (50 Points at a time) or up to what ever point is defined
<> Repeate 2 and 3
6-Request IR Table “If any” (50 Points at a time)
<> Repeate 2 and 3
7-Request HR Table (50 Points at a time)
<> Repeate 2 and 3
8- Loop back to 1 for the next device

All the data is save in DI,DO,IR,HR,Collection in vb6
Point are map by a name created in a Database some what like an OPC Server.
i.e.: Device_1.SupplyTemperature = Maps to address (41001) Holding register of the PLC
For sharing with Client in the LAN

the Loop need better implementation, what do I have to do in order to synchronize the Reading and writing of data to the PLCs in the 485 Network?

Any advice will be greatly appreciated or any web site for information or books that I can buy that can explain the synchronous process to create this type of Data pooling...
I'm using the vHMI Modbus Master Driver. I’m not a millionaire but money is not an issue when it comes to learning. Please guide me to the right spot if is possible. Thanks in advance...
 
Top