1/26/2011 1:00 AM | |
Posts: 2 Rating: (0) |
Set up As a proof of concept we have written a sample code using one cpu and 2 rack of I/O’s Rack 0 - CPU317F 2PN/DP - 4 FDI24xDC24V fail safe Digital input modules Rack 1 - Combination of Standard and SAFE Digital I/O. We have downloaded both Hardware configuration and entire program into the PLCSIM(simulator). Please find the attached PLC code for address details. IssueOur sample C# program works properly when Rack 0 Digital input signal values are changed using proSIM API’s. But having issues when we try to access Rack 1 Digital I/O signals using the proSIM API’s.But there is no issue when we try to modify the same Rack 1 Digital input signal using the PLCSim GUI interface and everything works as expected.Question is we do not understand why by using proSIM API’s accessing rack 1 I/O’s is an issue? Program: using System; using System.Collections.Generic; using System.Text; using S7PROSIMLib; using System.Threading; using System.Diagnostics; namespace PLCSIM { class Program { private static S7ProSim plcsim; static void Main( string [] args) { plcsim = new S7ProSim (); plcsim.Connect(); plcsim.SetScanMode( ScanModeConstants .ContinuousScan); plcsim.ConnectionError += new 7ProSimEvents_ConnectionErrorEventHandler (plcsim_ConnectionError); if (plcsim.GetState() == null ) { System. Console .WriteLine( "PLCSIM is not running 1!" ); } if (plcsim != null ) { byte [] b1 = { 1 }; Object inputImage1 = ( object )b1; plcsim.WriteInputImage(4, ref inputImage1); bool [] b2 = { true }; Object inputImage2 = ( object )b2.IsFixedSize; plcsim.WriteInputPoint(4, 7, ref inputImage2); plcsim.Disconnect();Thread.Sleep(5000); } } static void plcsim_ConnectionError( string ControlEngine, int Error) { System. Console .WriteLine( "Fehlermeldung: " ); System. Console .WriteLine(Error); throw new NotImplementedException (); } } } *********************************************************************Using the above program we tried to modify the Rack1, slot6 Input module signal data, Byte Address is 60 and bit 7.The corresponding bit is not changing to true and PIB value is displayed as invalid with “Inactive” status as shown below. AttachmentAutomati.zip (149 Downloads) |
4/8/2011 1:54 AM | |
Posts: 2 Rating: (0) |
I can able to modify the input through S7-PLCSIM, but not able to modify through prosim method. |
3/24/2015 10:57 AM | |
Joined: 8/23/2013 Last visit: 4/17/2024 Posts: 2 Rating: (0) |
Hello, I have exactly same problem, please advice |
Follow us on