Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hi, I want know the detail about using protocol 104 to write float and 32bits string。 #160

Open
nanqiu123 opened this issue Sep 19, 2024 · 1 comment

Comments

@nanqiu123
Copy link

nanqiu123 commented Sep 19, 2024

hi, I using thoese programs to writing data to 104 server,
InformationObject sc = (InformationObject)SingleCommand_create(NULL, 10, false, false, 0);
printf("Send control command C_SC_NA_1\n");
CS104_Connection_sendProcessCommandEx(con, CS101_COT_ACTIVATION, 1, sc);
InformationObject_destroy(sc);

    sc = (InformationObject)SingleCommand_create(NULL, 10, true, false, 0);
    printf("Send control command C_SC_NA_1\n");
    CS104_Connection_sendProcessCommandEx(con, CS101_COT_ACTIVATION, 1, sc);
    InformationObject_destroy(sc);

    sc = (InformationObject)DoubleCommand_create(NULL, 30, 0, false, 0);
    printf("Send control command C_SC_NA_1\n");
    CS104_Connection_sendProcessCommandEx(con, CS101_COT_ACTIVATION, 1, sc);
    InformationObject_destroy(sc);

    sc = (InformationObject)DoubleCommand_create(NULL, 30, 1, false, 0);
    printf("Send control command C_SC_NA_1\n");
    CS104_Connection_sendProcessCommandEx(con, CS101_COT_ACTIVATION, 1, sc);
    InformationObject_destroy(sc);

    sc = (InformationObject)DoubleCommand_create(NULL, 30, 2, false, 0);
    printf("Send control command C_SC_NA_1\n");
    CS104_Connection_sendProcessCommandEx(con, CS101_COT_ACTIVATION, 1, sc);
    InformationObject_destroy(sc);

    sc = (InformationObject)DoubleCommand_create(NULL, 30, 3, false, 0);
    printf("Send control command C_SC_NA_1\n");
    CS104_Connection_sendProcessCommandEx(con, CS101_COT_ACTIVATION, 1, sc);
    InformationObject_destroy(sc);

    sc = (InformationObject)StepCommand_create(NULL, 50, 2, false, 0);
    printf("Send control command C_SC_NA_1\n");
    CS104_Connection_sendProcessCommandEx(con, CS101_COT_ACTIVATION, 1, sc);
    InformationObject_destroy(sc);

    sc = (InformationObject)StepCommand_create(NULL, 50, 3, false, 0);
    printf("Send control command C_SC_NA_1\n");
    CS104_Connection_sendProcessCommandEx(con, CS101_COT_ACTIVATION, 1, sc);
    InformationObject_destroy(sc);

    sc = (InformationObject)SetpointCommandNormalized_create(NULL, 70, -1, false, 0);
    printf("Send control command C_SC_NA_1\n");
    CS104_Connection_sendProcessCommandEx(con, CS101_COT_ACTIVATION, 1, sc);
    InformationObject_destroy(sc);

    sc = (InformationObject)SetpointCommandNormalized_create(NULL, 70, 0.1234, false, 0);
    printf("Send control command C_SC_NA_1\n");
    CS104_Connection_sendProcessCommandEx(con, CS101_COT_ACTIVATION, 1, sc);
    InformationObject_destroy(sc);

    sc = (InformationObject)SetpointCommandNormalized_create(NULL, 70, 1, false, 0);
    printf("Send control command C_SC_NA_1\n");
    CS104_Connection_sendProcessCommandEx(con, CS101_COT_ACTIVATION, 1, sc);
    InformationObject_destroy(sc);

    sc = (InformationObject)SetpointCommandScaled_create(NULL, 90, -32.768, false, 0);
    printf("Send control command C_SC_NA_1\n");
    CS104_Connection_sendProcessCommandEx(con, CS101_COT_ACTIVATION, 1, sc);
    InformationObject_destroy(sc);

    sc = (InformationObject)SetpointCommandScaled_create(NULL, 90, 0, false, 0);
    printf("Send control command C_SC_NA_1\n");
    CS104_Connection_sendProcessCommandEx(con, CS101_COT_ACTIVATION, 1, sc);
    InformationObject_destroy(sc);

    sc = (InformationObject)SetpointCommandScaled_create(NULL, 90, 32.767, false, 0);
    printf("Send control command C_SC_NA_1\n");
    CS104_Connection_sendProcessCommandEx(con, CS101_COT_ACTIVATION, 1, sc);
    InformationObject_destroy(sc);

    sc = (InformationObject)SetpointCommandShort_create(NULL, 110, 1.2347, false, 0);
    printf("Send control command C_SC_NA_1\n");
    CS104_Connection_sendProcessCommandEx(con, CS101_COT_ACTIVATION, 1, sc);
    InformationObject_destroy(sc);

    sc = (InformationObject)SetpointCommandShort_create(NULL, 110, 2.4567, false, 0);
    printf("Send control command C_SC_NA_1\n");
    CS104_Connection_sendProcessCommandEx(con, CS101_COT_ACTIVATION, 1, sc);
    InformationObject_destroy(sc);

    sc = (InformationObject)Bitstring32Command_create(NULL, 120, 123456);
    printf("Send control command C_SC_NA_1\n");
    CS104_Connection_sendProcessCommandEx(con, CS101_COT_ACTIVATION, 1, sc);
    InformationObject_destroy(sc);

but ,in last two page program, sc = (InformationObject)SetpointCommandShort_create(NULL, 110, 2.4567, false, 0);
printf("Send control command C_SC_NA_1\n");
CS104_Connection_sendProcessCommandEx(con, CS101_COT_ACTIVATION, 1, sc);
InformationObject_destroy(sc);

    sc = (InformationObject)Bitstring32Command_create(NULL, 120, 123456);
    printf("Send control command C_SC_NA_1\n");
    CS104_Connection_sendProcessCommandEx(con, CS101_COT_ACTIVATION, 1, sc);
    InformationObject_destroy(sc);`

I can‘t using the program to write data , the messages to server are listed below。
I find those message are not 32bits string message or float message but scaled num message, so it write fail, I want to know the reason about it please.
image
image
image
image

@nanqiu123
Copy link
Author

OH, there is not any help for me?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant