1

I have established connection to a Siemens S7-300 PLC (simulated via PlcSIM) using the libnodave library. There are no issues connecting and writing data to the PLC. However, I am unable to change the status of the PLC from Start/Stop. I am attempting to use the following libnodave methods for such actions:

int daveStatus = daveStart(dc);
int daveStatus = daveStop(dc);

Both function calls return the same Error: 33794

nodave.c Cites the error as the following:

case 0x8402: return "CPU already in RUN or already in STOP ?";

The use of the daveStart() and daveStop() functions can be viewed in the example testS7online.c:

if(doStop) {
    daveStop(dc);
}
if(doRun) {
    daveStart(dc);
}

In the examples the start/stop functions are only called when MPI connections to the PLC are made. Does anyone know if the start/stop functions are supported for use with TCP connections? If so, any suggestions as to what may be causing my error?

Alex Hendren
  • 446
  • 1
  • 5
  • 18
  • 1
    Have you tried it with real PLC? Is PLCSIM in RUN-P mode? Sometimes simulation is just simulation... Here is an alternative S7 lib: http://snap7.sourceforge.net – avra Nov 14 '13 at 10:30
  • It is possible, that in PLCSim it's not supported to change PLC status from run to stop via libnodave. You can definitely change the status of PLCSim in it's Step7 window. But I will check your issue and reply more informative within a week. – user3062807 Dec 03 '13 at 18:43

1 Answers1

0

I have just tried dc.start() and dc.stop() using libnodave 8.4 and NetToPlcSim tool. It worked perfectly. Possibly you don't use NetToPlcSim tool that makes connection to PLCSim via TCP/IP (that is 127.0.0.1 port 102 obviously) hence dc can't even connect. So if your lines don't work, then u must be doing something wrong.