Developer Docs v3

Classes

struct  plcData
 

Macros

#define ANALOG_BUF_SIZE   8
 
#define ARRAY_SIZE(x)   (sizeof((x)) / sizeof((x)[0]))
 
#define DIGITAL_BUF_SIZE   16
 
#define PORT   6668
 

Functions

int createUDPSocket (int port)
 
void * exchangeData (void *arg)
 
void finalizeHardware ()
 Resource clearing. More...
 
void initializeHardware ()
 Initialization procedures. More...
 
void sleep_ms (int milliseconds)
 
void updateBuffersIn ()
 Update internal buffers. More...
 
void updateBuffersOut ()
 Update output buffers. More...
 

Detailed Description

Macro Definition Documentation

◆ ANALOG_BUF_SIZE

#define ANALOG_BUF_SIZE   8

Definition at line 48 of file simulink.cpp.

◆ ARRAY_SIZE

#define ARRAY_SIZE (   x)    (sizeof((x)) / sizeof((x)[0]))

Definition at line 43 of file simulink.cpp.

◆ DIGITAL_BUF_SIZE

#define DIGITAL_BUF_SIZE   16

Definition at line 49 of file simulink.cpp.

◆ PORT

#define PORT   6668

Definition at line 46 of file simulink.cpp.

Function Documentation

◆ createUDPSocket()

int createUDPSocket ( int  port)

Definition at line 75 of file simulink.cpp.

◆ exchangeData()

void* exchangeData ( void *  arg)

Definition at line 111 of file simulink.cpp.

◆ finalizeHardware()

void finalizeHardware ( )

Resource clearing.

This function is called by the main OpenPLC routine when it is finalizing. Resource clearing procedures should be here.

Definition at line 176 of file simulink.cpp.

◆ initializeHardware()

void initializeHardware ( )

Initialization procedures.

This function is called by the main OpenPLC routine when it is initializing. Hardware initialization procedures should be here.

Definition at line 166 of file simulink.cpp.

◆ sleep_ms()

void sleep_ms ( int  milliseconds)

Definition at line 63 of file simulink.cpp.

◆ updateBuffersIn()

void updateBuffersIn ( )

Update internal buffers.

This function is called by the OpenPLC in a loop. Here the internal buffers must be updated to reflect the actual Input state. The mutex bufferLock must be used to protect access to the buffers on a threaded environment.

Definition at line 185 of file simulink.cpp.

◆ updateBuffersOut()

void updateBuffersOut ( )

Update output buffers.

This function is called by the OpenPLC in a loop. Here the internal buffers must be updated to reflect the actual Output state. The mutex bufferLock must be used to protect access to the buffers on a threaded environment.

Definition at line 197 of file simulink.cpp.