Snap7 code for partnering with a siemens 7 server.
This allows you to create a S7 peer to peer communication. Unlike the client-server model, where the client makes a request and the server replies to it, the peer to peer model sees two components with same rights, each of them can send data asynchronously. The only difference between them is the one who is requesting the connection.
A snap7 partner.
Sends a data packet to the partner. This function is asynchronous, i.e. it terminates immediately, a completion method is needed to know when the transfer is complete.
Receives a data packet from the partner. This function is synchronous, it waits until a packet is received or the timeout supplied expires.
Sends a data packet to the partner. This function is synchronous, i.e. it terminates when the transfer job (send+ack) is complete.
Checks if a packed received was received.
Checks if the current asynchronous send job was completed and terminates immediately.
Creates a Partner and returns its handle, which is the reference that you have to use every time you refer to that Partner.
Parameters: active – 0 Returns: a pointer to the partner object
Destroy a Partner of given handle. Before destruction the Partner is stopped, all clients disconnected and all shared memory blocks released.
Returns the last job result.
Reads an internal Partner object parameter.
Returns some statistics.
Returns: a tuple containing bytes send, received, send errors, recv errors
Returns the Partner status.
Returns the last send and recv jobs execution time in milliseconds.
Sets the user callback that the Partner object has to call when a data packet is incoming.
Sets the user callback that the Partner object has to call when the asynchronous data sent is complete.
Stops the Partner, disconnects gracefully the remote partner.
Parses a s7 error code returned the decorated function.