sicamxdf
Hi everybody:


I am currently working with a raspberry b and the driver according to it, I am doing some tests to use the% IX and% QX registers that are not used on the card, attached code sample

int ignored_bool_inputs [] = {2};
int ignored_bool_outputs [] = {-1};
int ignored_int_inputs [] = {-1};
int ignored_int_outputs [] = {-1};

in update_custom_outputs .......
 pthread_mutex_lock (& ​​bufferLock);
    if (bool_output [2] [0]! = NULL) * bool_output [2] [0] = 1;
    pthread_mutex_unlock (& ​​bufferLock);

The program  compiles and run correctly and apparently modbus server is functional but when trying to obtain the values ​​of the records, only one time out is obtained from radzio

The server log window shows that the radzio connects and disconnects when the session is closed in the program

server log
OpenPLC Runtime starting ...
Interactive Server: Listening on port 43628
Warning: Persistent Storage file not found
Issued start_modbus () command to start on port: 502
Server: Listening on port 502
Server: waiting for new client ...
Issued start_dnp3 () command to start on port: 20000
DNP3 ID manager: Starting thread (0)
DNP3 ID DNP3_Server: Listening on: 0.0.0.0:20000
Issued start_enip () command to start on port: 44818
Server: Listening on port 44818
Server: waiting for new client ...
Issued start_pstorage () command with polling rate of 10 seconds
Server: Client accepted! Creating thread for the new client ID: 13 ...
Server: waiting for new client ...
Server: Thread created for client ID: 13
Server: Client accepted! Creating thread for the new client ID: 14 ​​...
Server: waiting for new client ...
Server: Thread created for client ID: 14
Server: Client accepted! Creating thread for the new client ID: 15 ...
Server: waiting for new client ...
Server: Thread created for client ID: 15
Server: Client accepted! Creating thread for the new client ID: 16 ...
Server: waiting for new client ...
Server: Thread created for client ID: 16
Server: Client accepted! Creating thread for the new client ID: 17 ...
Server: waiting for new client ...
Server: Thread created for client ID: 17
Modbus Server: client ID: 17 has closed the connection
Terminating Modbus connections thread

Thanks for your kind attention
Quote 0 0
thiagoralves
update custom I/O is already on a serial buffer protected mutex. If you lock the mutex again, you will end up in a deadlock. Just remove these pthread_mutex calls and you should be fine.
Quote 0 0
sicamxdf
Thanks, for your fast answer, i removed the calls for lock, then  the program compilies fine , then when i try to run it,  the plc does not work fine,  in the screen only report problem to access the logs and rasp .. hangs, need i to complete other steps?
Quote 0 0
thiagoralves
Paste your entire custom hardware layer here
Quote 0 0