Saturday, September 03, 2005

Modbus TCP simulator

I got a requirement to develop a Modbus TCP simulator.
Thought of doing something quickly using VB6. Then ended up with limitaion of good threading library. Then thought of doing in VB.Net. Coded using MsFlexGrid controls. Found them looking very nice. All working fine for 15 minutes. Suddenly there is a red cross across the Grid. After 10 minutes another grid got the same. Then observed Microsoft already accepted that bug and I need to hunt for a patch to fix it. Left that option too.

Then thought of doing in VC6 using MFC Dialog. Another problem, I want to simulate 64 AI, 64 AO, 64 DO and 64 DI. So thought of using text boxes for AI and AO and CheckBoxes for DI and DO. Another limitation, I cant have more than 255 controls on a Dialog box. As all frames are inherited from Dialog boxes no option left.

Then decided to use VB UI and VC library. I am more biased towards pthread library (ftp://sources.redhat.com/pub/pthreads-win32) than Windows. Just decided to use Win API instead of going through big loop of ATL and COM stuff.

Interesting I got good working Simulator. Its not complete but easy to enhance.

I have VB6 application which essentially has code to export handles of controls to vc library.

No comments: