Migration from VB6/RSLogix to C#/NET.ABLINK

1 post in this topic

The PLC controlling our refrigeration plant is a PLC 5/40. Years ago I wrote a VB6 GUI program using INGEAR's ABCTL driver;

It still works perfectly under XP, but, needing Windows 10, I had to get their NET.ABLINK driver and rewrite in C# (at which I'm no guru).

The program's basic function is to make one read of 5 ints, one read of 2 ints, three reads of 8 bits of DI, three reads of 8 bits of DO, assigning the read values to screen elements after each read. These calls are in a Timer event that allows plenty of time for the I/O. There are thread.sleep calls between the reads as well, to give them more than enough time to complete. (I also put some test code nonsense in Button events).

My C# program works initially, but after 1 to 10 minutes it begins to spit error messages about startIndex, which I can't even find in my solution. If I let it run it it throws an error for incorrect data types, as though the PLC is responding to an int read with bit data.

I attach a screen shot of the failure, as well as the form code (to open in Notepad or code editor). Thanks for any tips you can provide!





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