ouput signal


Results 1 to 14 of 14

Thread: ouput signal

  1. #1

    Default ouput signal

    Tom, is it possible to output rs322 / 422 angular signals of rotational axes in degrees in 0/360 format? for kflop wiht canalog thanksdalmazio

    Similar Threads:


  2. #2
    Member TomKerekes's Avatar
    Join Date
    May 2006
    Location
    USA
    Posts
    4045
    Downloads
    0
    Uploads
    0

    Default Re: ouput signal

    Hi dalmazio,

    I assume you meant RS232 port?

    Yes that should be possible. Periodically sample the current axis Destination or Position, convert to degrees, perform modulo 360, write to port.

    You might look at the Modulo360.c example used to reset the current axis position to 0-360degrees
    Code:
    #include "KMotionDef.h"
    
    #define CNTS_PER_DEG 1000.0
    #define AXISA 4
    
    double modf(double, double*); // returns integer part with more han 32-bit precision
    
    double floor(double x) // truncate down toward -ininity
    {
       double y; 
       return (modf(x, &y) < 0 ? y - 1 : y);
    }
    
    main()
    {
        double dest = chan[AXISA].Dest;
        double cnts = CNTS_PER_DEG * 360.0;
        EnableAxisDest(AXISA, dest - (floor(dest/cnts)) * cnts);
    }
    HTH
    Regards

    Regards
    TK http://dynomotion.com


  3. #3

    Default Re: ouput signal

    dear tom, I use the kanalog and if active the suggested program for the rs232 stops the system, works with the programs write and read kanalog rs232, another question, it is possible to have the imput encoder signals divided x180 on the digital outputs for two axes ? thanks dalmazio



  4. #4
    Member TomKerekes's Avatar
    Join Date
    May 2006
    Location
    USA
    Posts
    4045
    Downloads
    0
    Uploads
    0

    Default Re: ouput signal

    Hi dalmazio,

    Sorry I don’t understand the question.

    Regards
    TK http://dynomotion.com


  5. #5

    Default Re: ouput signal

    We can move two axes in degree with Kflop integrated in a Kanalog. Could you explain us and
    give us the indication to reach a position in degree outside the kanalog through RS232?
    Or also to reach the differential signal of the encoder divided into 180 times to follow the conversion in degrees with ARDUINO.
    The reduction is necessary because the number of pulses in the Kanalog input is very high.
    Y inform that if Y start the program ENABLE RS 232 the KFLOP crashed.
    thanks a lot Dalmazio



  6. #6
    Member TomKerekes's Avatar
    Join Date
    May 2006
    Location
    USA
    Posts
    4045
    Downloads
    0
    Uploads
    0

    Default Re: ouput signal

    Hi Dalmazio,

    Sorry I still don't understand.

    Do you want your Arduino to send a command to KFLOP to move an axis?

    Do you want to send the current commanded Destination divided by 180 out to your Arduino?

    If you configure KFLOP to receive commands from RS232 then the USB commands will no longer function.

    Regards
    TK http://dynomotion.com


  7. #7

    Default Re: ouput signal

    Do you want to send the current commanded Destination divided by 180 out to your Arduino?


    yes, I convert them to degrees to send them to a remote display



  8. #8
    Member TomKerekes's Avatar
    Join Date
    May 2006
    Location
    USA
    Posts
    4045
    Downloads
    0
    Uploads
    0

    Default Re: ouput signal

    Hi Dalmazio,

    Well you can simply divide the commanded destination for channel 'x' with:

    double value;

    value = chx->Dest / 180.0;

    What format do you want to send the value in over the RS232? ASCII characters?

    Regards
    TK http://dynomotion.com


  9. #9

    Default Re: ouput signal

    BR dear tom, I need to send the display reading out of the kflop or knalog in angular degrees format via rs232 kanalog, if it is not possible the encoder inputs divided by 180 to convert them with arduino 2

    for the rs232 in hexadecimal I think it is appropriate, tanks



  10. #10
    Member TomKerekes's Avatar
    Join Date
    May 2006
    Location
    USA
    Posts
    4045
    Downloads
    0
    Uploads
    0

    Default Re: ouput signal

    Hi Dalmazio,

    I still don't really understand. But to convert the value as hexadecimal integer. You might:

    Code:
    double value;
    int ivalue;
    char s[20];
    
    value = chx->Dest / 180.0;  // divide destination by 180
    
    ivalue = (int)value;  // convert to integer
    
    sprintf(s,"%8X",ivalue);  // convert integer to 8 hexadecimal characters


    Regards
    TK http://dynomotion.com


  11. #11

    Default Re: ouput signal

    HIi Tom
    double value;
    int ivalue;
    char s[20];

    stop compilation error value = chx->Dest / 180.0; // divide destination by 180

    ivalue = (int)value; // convert to integer

    sprintf(s,"%8X",ivalue); // convert integer to 8 hexadecimal characters
    tanks regards



  12. #12
    Member TomKerekes's Avatar
    Join Date
    May 2006
    Location
    USA
    Posts
    4045
    Downloads
    0
    Uploads
    0

    Default Re: ouput signal

    Hi Dalmazio,

    Replace 'x' with your channel number. ie. ch3

    Regards
    TK http://dynomotion.com


  13. #13

    Default Re: ouput signal

    dear tom, with the program rs232read, can only communicate with the console kamotion that prints them in hexadecimal, and does not execute the command, how can I translate it because the axis moves with a command like move0 = 500 via serial rs232 tanks dalmazio



  14. #14
    Member TomKerekes's Avatar
    Join Date
    May 2006
    Location
    USA
    Posts
    4045
    Downloads
    0
    Uploads
    0

    Default Re: ouput signal

    Hi Dalmazio,

    Sorry I don't understand what you are doing or trying to do.

    If you want to have KFLOP receive Move commands from the RS232 port you will need to write a C Program that receives the command and parameter characters, converts the parameter characters to a value, then calls a C Function to Move.

    sscanf can be used to convert characters to a variable

    Move(0, value); can be used to move axis 0 to some destination

    Regards
    TK http://dynomotion.com


Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


About CNCzone.com

    We are the largest and most active discussion forum for manufacturing industry. The site is 100% free to join and use, so join today!

Follow us on


Our Brands

ouput signal

ouput signal