Created
March 9, 2017 12:10
-
-
Save xiaoqiangwang/16576c1739e60300dde407bae044b88e to your computer and use it in GitHub Desktop.
test of ca sync group
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "cadef.h" | |
int main(int argc, char **argv) | |
{ | |
CA_SYNC_GID gid; | |
chanId chid; | |
double value; | |
int status; | |
// preemptive disabled, no hang up | |
// status = ca_context_create(ca_disable_preemptive_callback); | |
// preemptive enabled, hang up | |
status = ca_context_create(ca_enable_preemptive_callback); | |
SEVCHK(status, "create context"); | |
status = ca_create_channel("catest", NULL, NULL, 0, &chid); | |
status = ca_pend_io(2); | |
SEVCHK(status, "create channel"); | |
status = ca_sg_create(&gid); | |
SEVCHK(status, "create sync group"); | |
status = ca_sg_array_get(gid, DBR_DOUBLE, 1, chid, &value); | |
SEVCHK(status, "sync group get"); | |
while (ca_sg_test(gid) != ECA_IODONE) | |
ca_sg_block(gid, 0.01); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
record(ao,"catest") | |
{ | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment