Quantcast
Channel: Allen Bradley / Rockwell Automation Latest Topics
Viewing all articles
Browse latest Browse all 3721

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

$
0
0

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!

20230919_124851.thumb.jpg.d15ed0a250b5ac

RefrigForm.cs

RefrigForm.cs.txt

RefrigForm.cs


Viewing all articles
Browse latest Browse all 3721

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>