Jump to content
OMRON Forums

Is the Modbus of CK3M thread-safe?


11hours

Recommended Posts

I upadte some data of "double" by saving them in ModbusBuffer.

The updating function code is some like below:

{
  double *g_modbus_buff  = (double*)(pshm->ModbusServerBuffer);
  g_modbus_buff[0] = something_i;
  g_modbus_buff[1] = something_ii;
  g_modbus_buff[2] = something_iii;
  g_modbus_buff[3] = something_iv;
  g_modbus_buff[4] = something_v;
  ......
}

I put the code in "Realtime Routines" directory, and call the code in "user_pid_ctrl".

Is there any potential risk of "thread-safety" problem when I read holding registers from PC continuously? After all the Servo Frequency is 20kHz, "user_pid_ctrl" running so fast. 

Or, on the other hand, if the read-write process is thread-safe, will the modbus function slow down the servo task?

Edited by 11hours
Link to comment
Share on other sites

  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

2 hours ago, steve.milici said:

Modbus is a background task in Power PMAC, so if you have enabled the server sockets (Sys.ModbusServerEnable = 1) for the documented Modbus use then this will not function properly in Power PMAC "Realtime Routines".

thank you Steve, I will move this code to background.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...