Stepper Motor with S7 1200 and arduino

Hello Please I need your help
I have to order an Stepper Motor by an automaton S7 1200
Since my CPU has no output to control the stepper motors and servo motor I found a solution to control it by Arduino and make a communication between the automaton and the Arduino board.
I tried to write this program (I want you to check it with me) two errors appear after the compilation:
1: ‘class ModbusIP’ has no member named AddCoil
2: Compilation error!!
I really need your help as soon as possible

#include <ModbusIP_ENC28J60.h>
#include <EtherCard.h>
#include <Modbus.h>

const int dirPin  = 3;
const int stepPin = 4; 
const int enPin   = 5;

const int dirPin_Motor=100;
const int stepPin_Motor =200;
const int enPin_Motor=300;

//const int SENSOR_IREG=100; //modbus adress we're gonna use, 30001+100=30101
//const int sensorPin=A0; //analog input 
ModbusIP mb; //object

void setup () {
Serial.begin (9600);

  pinMode(stepPin,OUTPUT); 
  pinMode(dirPin,OUTPUT);
  pinMode(enPin,OUTPUT);
  digitalWrite(enPin,LOW);
  
// The media access control (ethernet hardware) address for the shield
byte mac[]={0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED}; //mac
// The IP address for the shield
byte ip []={192, 168, 2, 120}; //ip arduino
 //Config Modbus IP 
mb.config (mac, ip); 

// Use addIreg() for analog Inputs
// Use addCoil() for digital outputs
mb.addCoil(dirPin_Motor);
mb.addCoil(stepPin_Motor);
mb.addCoil(enPin_Motor);
//mb.addIreg (SENSOR_IREG);
// Sets the two pins as Outputs
}

void loop(){

mb.task(); //main task to update modbus tasks
//if (millis()>ts+2000){
//ts =millis(); //update every 2 seconds
//mb.Ireg(SENSOR_IREG, analogRead (sensorPin)); //values from 0-1024
//Serial.printIn (analogRead (sensorPin)); 
//	}
//Setting raw value (0-1024)
// mb.Ireg(SENSOR_IREG, analogRead(sensorPin));

// Attach ledPin to LAMP_COIL register 
// digitalWrite(ledPin1, mb.Coil(LAMP_COIL1));

digitalWrite(dirPin,HIGH); // Enables the motor to move in a particular direction
  // Makes 200 pulses for making one full cycle rotation  
  for(int x = 0; x < 1600; x++) {
    digitalWrite(stepPin,HIGH); 
    delayMicroseconds(500); 
    digitalWrite(stepPin,LOW); 
    delayMicroseconds(500); 
  }
  delay(1000); // One second delay

  digitalWrite(dirPin,LOW); //Changes the rotations direction
  // Makes 400 pulses for making two full cycle rotation
  for(int x = 0; x < 1600; x++) {
    digitalWrite(stepPin,HIGH);
    delayMicroseconds(1000);
    digitalWrite(stepPin,LOW);
    delayMicroseconds(1000);
  }
  delay(1000);

}

Moderator edit:
</mark> <mark>[code]</mark> <mark>

</mark> <mark>[/code]</mark> <mark>
tags added.

This same question is in Project Guidance and Programming Questions. Posting the same questions in multiple topics is cross posting. Cross posting wastes time. Do not cross post. Reported.

Read the how to use this forum-please read stickies so that you know the rules of the forum.

@halima-1001, stop cross-posting. This is your only warning.

halima-1001: I have to order an Stepper Motor by an automaton S7 1200

Please post a link to the datasheet for your stepper motor.

It would be a big help if you describe the project you want to create so we can understand the context of your questions. For example you mention a servo but don't say what it is for.

...R Stepper Motor Basics Simple Stepper Code