1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 <2018> 2019 2020 2021 2022 2023 2024 2025 | Index | 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 <2018> 2019 2020 2021 2022 2023 2024 2025 |
<== Date ==> | <== Thread ==> |
---|
Subject: | RE: Simple channel access write program within Qt |
From: | "Abdalla Ahmad" <[email protected]> |
To: | "Kasemir, Kay" <[email protected]> |
Cc: | "[email protected]" <[email protected]> |
Date: | Sun, 8 Apr 2018 05:36:38 +0000 |
Thank you Kay, that explains a lot. Abdalla. From: Kasemir, Kay [mailto:[email protected]]
Hi: I assume you have multiple threads. Some 'main' thread that starts everything up, the UI thread that handles button presses etc. from the UI, and then another worker thread in which you write, since you wouldn't want to delay the UI with such work. --> See the section on using CA from multiple threads in the CA manual,
https://epics.anl.gov/base/R3-14/8-docs/CAref.html#Client2 -Kay From:
[email protected] <[email protected]> on behalf of Abdalla Ahmad <[email protected]> Hi As part of experimenting with EPICS Qt with EPICS Base 3.14.12.3, I came to the need to write a function that writes values to PVs. Here is my attempt: int status; chid id; CA_SYNC_GID gid; ca_search(name, &id); status = ca_pend_io(1); // Already checking if status != ECA_NORMAL ca_put(type, id, &value); // type can be DBF_STRING, DBF_DOUBLE, etc. This is already working fine but I have some questions:
1.
I used to have ca_task_initialize and
ca_task_exit but my Qt application
always crashes on executing the function, the value is written but the app crashes. I thought since CA is already initialized and cleaned-up within EPICS Qt I removed both functions and the app works fine. Is this a correct
behavior?
2.
When do I really need the synchronous group version of
ca_put(the ca_sg_put)? Best Regards, Abdalla Ahmad Control Engineer SESAME Allan, Jordan. Tel: (+962-5) 3511348 , ext. 265 Fax: (+962-5) 3511423 Mob: (+962-7)88183296 |