Search:

Type: Posts; User: Marvin Gorres

Page 1 of 3 1 2 3

Search: Search took 0.01 seconds.

  1. Replies
    102
    Views
    33,525

    even if i changed to this code result2 =...

    even if i changed to this code



    result2 = write(mainfd, myCommand, sizeof(myCommand)); //return number of byte written to the port
    if ( result2 < 0 ) { perror("error: write"); }
    if...
  2. Replies
    102
    Views
    33,525

    Hello Zuk, i changed it already. Thanks for the...

    Hello Zuk, i changed it already. Thanks for the information, now my error looks like this:

    error: write: Success
    error in write, result = -45

    but i just disable the second error and i get the...
  3. Replies
    102
    Views
    33,525

    its negative.

    its negative.
  4. Replies
    102
    Views
    33,525

    Yea you got a point there. Any suggestion how to...

    Yea you got a point there. Any suggestion how to check the error?
  5. Replies
    102
    Views
    33,525

    Now i'm trying to transfer 211 byte of data so i...

    Now i'm trying to transfer 211 byte of data so i have this code below:



    unsigned char myCommand[211] = { 245,65,0,196,0,0,133,245,245,0,1,1,245,0,0,0,15,29,40,43,193,34,...
  6. Replies
    102
    Views
    33,525

    Thanks Kurt!!

    Thanks Kurt!!
  7. Replies
    102
    Views
    33,525

    UPDATE: int myCommand[8] = {...

    UPDATE:




    int myCommand[8] = { 245,1,0,0,0,0,0,0 };

    int str1, str2, str3, str4;
  8. Replies
    102
    Views
    33,525

    I wonder if i'm doing this correctly. Please...

    I wonder if i'm doing this correctly. Please correct me. This is what i did:



    fscanf(fp, "%s %s %s %s", str1, str2, str3, str4);

    two[1]= str1;
    two[2]= str2;
    two[3]= str3;
    two[4]= str4;
  9. Replies
    102
    Views
    33,525

    alright thanks for the suggestion. Too many thing...

    alright thanks for the suggestion. Too many thing now and i keep forgetting things.
  10. Replies
    102
    Views
    33,525

    its in write() library, the write() will return...

    its in write() library, the write() will return you the number of byte as long as you set the correct parameter for it.
  11. Replies
    102
    Views
    33,525

    Owh sorry! i forgot to change the 801 to 8..my...

    Owh sorry! i forgot to change the 801 to 8..my mistake. now it works properly already. thanks for pointing it out.

    Now what i have to do is how to transfer an array which have the following value...
  12. Replies
    102
    Views
    33,525

    Tried already, my device seems to respond but the...

    Tried already, my device seems to respond but the error is still there. 42 byte were sent.
  13. Replies
    102
    Views
    33,525

    This is what i've done: unsigned char...

    This is what i've done:



    unsigned char myCommand[810] = { 0xf5,0x01,0x00,0x01};
    unsigned char two[50];

    two[1]= "0x03";
    two[2]= "0x00";
    two[3]= "0x03";
  14. Replies
    102
    Views
    33,525

    convert? is there any other method without...

    convert? is there any other method without altering the original data?
  15. Replies
    102
    Views
    33,525

    This is what i did: unsigned...

    This is what i did:



    unsigned myCommand[100] = { 0xf5, 0x01, 0x00, 0x01, 0x03, 0x00, 0x03, 0xf5,};

    result2 = write(mainfd, myCommand, sizeof(myCommand));


    now my .txt file content is...
  16. Replies
    102
    Views
    33,525

    To make a quick understanding, i have one...

    To make a quick understanding, i have one example:



    char get[1000] = {"\\xF5\\x01\\x00\\x00"}, get_2[1000] = {"\\x00\\x00\\x01\\xF5"};

    strcat(get,get_2);

    printf("%s",get); //output...
  17. Replies
    102
    Views
    33,525

    I can read the file exactly as it is in .txt file...

    I can read the file exactly as it is in .txt file n it looks like this:

    \xf5\x00\x00\x00\x17\x0a\x16\x01\x61\x0e\x1d\x1a\x 01\x16\x95\x00\xc1\x1f\x26\x44\xa1\x1f\x88\x95\xe1 ...
  18. Replies
    102
    Views
    33,525

    Yes Jim, i printed out the correct data from the...

    Yes Jim, i printed out the correct data from the .txt file. The problem is how to combine the hex data in array(temp_final) with the existing hex data in here ==> "result2 =...
  19. Replies
    102
    Views
    33,525

    Hello Jim, now i have a big problem, hope you'll...

    Hello Jim, now i have a big problem, hope you'll bear with me to solve this.

    1.) i'm sending hex command to my device/port like the code below:



    result2 =...
  20. Replies
    102
    Views
    33,525

    Oh man you're awesome dude..thanks for helping...

    Oh man you're awesome dude..thanks for helping me..^^
  21. Replies
    102
    Views
    33,525

    So basically i cant have this kind of output?...

    So basically i cant have this kind of output? \xf5\x23\xc4\x00\x00\xe7\xf5\xf5\x00\x00\x00\x29?
  22. Replies
    102
    Views
    33,525

    Hello jim, the problem seems to be solved...

    Hello jim, the problem seems to be solved already. I did the input and output clear buffer and its settled. Now i have another problem, below is my code to print the output from the device into a...
  23. Replies
    102
    Views
    33,525

    Changed it already but still the output data i...

    Changed it already but still the output data i get sometimes correct and sometimes not correct. hmm.
  24. Replies
    102
    Views
    33,525

    The way i clear my buffer, is that a good way?

    The way i clear my buffer, is that a good way?
  25. Replies
    102
    Views
    33,525

    Thanks for pointing it out Jim. I've updated my...

    Thanks for pointing it out Jim. I've updated my code and get the correct result but sometimes it is correct and sometimes its not. comment on my code below:



    chout = 0;

    fp =...
Results 1 to 25 of 56
Page 1 of 3 1 2 3