Elmomc Multi-Axis Motion Controller-Maestro Manual de usuario Pagina 237

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 313
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 236
After setting the Communication Parameters and User’s Data Size, click OK to create the
appropriate members of the MODBUS slave:
1. coils
2. discreteInputs
3. inputRegisters
4. holdingRegisters
12.6 MODBUS communication workflow
Modbus Slave (Server) Modbus Master (Client)
1. Server initialization
if( !server.isStarted() )
//server’s data initialization
. . .
//start server process
retval = server.startupServer()
//verify results
if( retval != 0 )
TRACE(“Error %!!!”,retval)
end if
end if
1. Connect to the server
if( !client.isOpen() )
//open communication with server
retval = client.openProtocol()
//verify results
if( !retval )
TRACE(“Error %!!!”,retval)
end if
end if
2. Data manipulations:
//for example
//set new data value
for i=1:coilsNum
server.coils[i]=array[i-1]
end for
//get new data value
for i=1:coilsNum
array[i-1]=server.coils[i]
end for
//use it in logical operations
if(server.coils[k])
TRACE(“To do something”)
end if
2. Data manipulations:
//for esample
2.1 Get data from the server
if(client.isOpen())
//read data
retval = client.readCoils( 1, &staticArr,
coilsNum )
//view results
if( retval )
for i=0:coilsNum -1
TRACE(“%-%”,i+1,staticArr[i])
end for
else
TRACE(“Error %!!!”,retval)
end if
end if
Maestro Software Manual Ethernet/IP Communication
MAN-MASSW (Ver. Q)
12-17
Vista de pagina 236
1 2 ... 232 233 234 235 236 237 238 239 240 241 242 ... 312 313

Comentarios a estos manuales

Sin comentarios