Recent

Author Topic: SnapTRAINER  (Read 3518 times)

davenardella

  • New Member
  • *
  • Posts: 13
SnapTRAINER
« on: July 08, 2024, 10:24:38 am »
I have released SnapTRAINER, a modular Virtual-PLC Trainer that allows you to test your control programs without having additional hardware, it connects to almost all PLCs on the market.

SnapTRAINER is part of an ambitious project that allows even those without the economic means to take the first steps in industrial automation.

In fact, three platforms are reported, OpenPLC which is completely free, Arduino OPTA which costs little and Siemens S71500 as a reference for a professional PLC.

SnapTRAINER is free and open source and is built in Lazarus. All libraries used can be installed via Online Update Manager and have not been changed.

Hope you like it  ;)

The article:
https://www.linkedin.com/pulse/learn-plc-arduino-optaopenplc-snaptrainer-davide-nardella-stzpf

The Project:
https://github.com/davenardella/SnapTRAINER

Dzandaa

  • Sr. Member
  • ****
  • Posts: 354
  • From C# to Lazarus
Re: SnapTRAINER
« Reply #1 on: July 08, 2024, 02:23:11 pm »
Hi,

Great job.

I tried to compile the main program, but I have errors at:

Code: Pascal  [Select][+][-]
  1.     if (c mod 3) = 0 then
  2.     begin
  3.       DinRails[Z]:=TImage.Create(self);
  4.       DinRails[Z].AutoSize:=false;
  5.       DinRails[Z].Stretch:=false;
  6.       DinRails[Z].Images:=RailImage; // Here: no member
  7.       DinRails[Z].ImageIndex:=0; // Here : no member
  8.       DinRails[Z].SetBounds(0,Y+132,1600,118);
  9.       DinRails[Z].Parent:=SB;
  10.       DinRails[Z].SendToBack;
  11.       X:=StartX;
  12.       Y:=Y+SpanY;
  13.     end;  
  14.  
  15.  

FPC 3.2.2, lazarus 2.2.4 and 2.2.6

B->
Regards,
Dzandaa

davenardella

  • New Member
  • *
  • Posts: 13
Re: SnapTRAINER
« Reply #2 on: July 08, 2024, 03:11:23 pm »
Hi,

Great job.

I tried to compile the main program, but I have errors at:

Code: Pascal  [Select][+][-]
  1.     if (c mod 3) = 0 then
  2.     begin
  3.       DinRails[Z]:=TImage.Create(self);
  4.       DinRails[Z].AutoSize:=false;
  5.       DinRails[Z].Stretch:=false;
  6.       DinRails[Z].Images:=RailImage; // Here: no member
  7.       DinRails[Z].ImageIndex:=0; // Here : no member
  8.       DinRails[Z].SetBounds(0,Y+132,1600,118);
  9.       DinRails[Z].Parent:=SB;
  10.       DinRails[Z].SendToBack;
  11.       X:=StartX;
  12.       Y:=Y+SpanY;
  13.     end;  
  14.  
  15.  

FPC 3.2.2, lazarus 2.2.4 and 2.2.6

B->

Before starting this project I refreshed my Lazarus installation, so now I'm using Lazarus 3.2 with FPC 3.3.2

Anyway, DinRails is an array of TImage and Images and ImageIndex are regular fields (at least in Lazarus 3.2, I don't know if in previous releases was different...)


Dzandaa

  • Sr. Member
  • ****
  • Posts: 354
  • From C# to Lazarus
Re: SnapTRAINER
« Reply #3 on: July 08, 2024, 05:16:13 pm »
Hi,
@davenardella

Quote
(at least in Lazarus 3.2, I don't know if in previous releases was different...)

Yes it was different, I've installed the latest version of Lazarus and both fields are present.

B->
Regards,
Dzandaa

dseligo

  • Hero Member
  • *****
  • Posts: 1372
Re: SnapTRAINER
« Reply #4 on: July 09, 2024, 02:26:05 am »
Is there a chance it could work with Unitronics' Jazz (https://www.unitronicsplc.com/jazz-series-jazz/)?

lainz

  • Hero Member
  • *****
  • Posts: 4593
  • Web, Desktop & Android developer
    • https://lainz.github.io/
Re: SnapTRAINER
« Reply #5 on: July 09, 2024, 05:07:27 am »
Seems that you're using bgrabitmap and bgracontrols, uecontrols as well...

Looks awesome good job!

davenardella

  • New Member
  • *
  • Posts: 13
Re: SnapTRAINER
« Reply #6 on: July 09, 2024, 06:13:55 am »
Is there a chance it could work with Unitronics' Jazz (https://www.unitronicsplc.com/jazz-series-jazz/)?

As far I can see it supports Modbus, directly or via MJ20-ET1 interface, so yes, it should work fine  ;)

Dzandaa

  • Sr. Member
  • ****
  • Posts: 354
  • From C# to Lazarus
Re: SnapTRAINER
« Reply #7 on: July 09, 2024, 07:01:22 pm »
Hi,

Too bad this program only works with Windows...

B->
Regards,
Dzandaa

davenardella

  • New Member
  • *
  • Posts: 13
Re: SnapTRAINER
« Reply #8 on: July 10, 2024, 07:28:34 am »
Hi,

Too bad this program only works with Windows...

B->

Yes, essentially for two reasons:
1 - For convenience, this program is designed to work on the same PC as the PLC development system, and 99.99% of them run under Windows.
2 - Each module is a DLL that contains a Form. I know Linux quite well but I use it by programming in C++, I am not expert enough to manage forms in .so libraries (I don't even know if this is possible)

Anyway, the spirit of open source is precisely this, allowing anyone to make improvements; the communication libraries work perfectly under Linux, so if anyone would like to try their hand at porting they would be welcome  ;)


Dzandaa

  • Sr. Member
  • ****
  • Posts: 354
  • From C# to Lazarus
Re: SnapTRAINER
« Reply #9 on: July 10, 2024, 05:07:04 pm »
Hi,

Tried with Lazarus 3.4 on Windows 64 bits.
Everything works flawlessly.

Thank you.

B->
Regards,
Dzandaa

gagarin77

  • Newbie
  • Posts: 1
Re: SnapTRAINER Problem connection
« Reply #10 on: August 25, 2024, 02:56:25 pm »
Hi,
I  use TIA PORTAL V17
I have load PLC S7_LeakTest in  PLCSIM and it's ok PLC have IP 192.168.0.250 ( and I can go online)

Setting Snap Trainer it's default for Communications Settings and for "station cylinder"
but the led remains red for "station cylinder"

I use Vmware machine wihti WIN 10
and the setting network is in DHCP

Do you have any suggestions?

davenardella

  • New Member
  • *
  • Posts: 13
Re: SnapTRAINER
« Reply #11 on: September 13, 2024, 08:28:42 am »
Sorry for delay  ;D

PLCSIM doesn't virtualize the ethernet hardware (you can't attach an Ethernet HMI too).
Two solutions:

1 - Use PLCSIM Advanced
2 - Use NetToPLCsim (https://nettoplcsim.sourceforge.net/)

No problem for VM

 

TinyPortal © 2005-2018