Group Details

administrators

  • RE: REXYGEN 3.0.0 is available

    @Scoobsalamander Hi Kris, thanks for your question!

    We are still missing the converter from EtherCAT XML files to our driver which is crucial for EtherCAT setup. Do you have any EtherCAT IO modules in your mind? We can prepare a basic example for you so you can modify it according to your needs. What do you think?

    Please, note that the Raspberry Pi is not the best piece of HW for challenging tasks and short communication periods 😉

    Cheers,
    Tomas

    posted in Development tools
  • RE: Modbus Tcp/IP communication Rpi(Rexygen)<->PC(Matlab)

    @stepan-ozana Thanks for sharing your solution! Unfortunately, I don't have the required toolboxes to run the script on my computer. However, the code is well-documented and well-organized, which should make it easy for anyone with the necessary Matlab toolboxes to use it without any issues.

    'modbus' requires one of the following:
      Industrial Communication Toolbox
      MATLAB Coder Support Package for NVIDIA Jetson and NVIDIA DRIVE Platforms
    
    Error in example_ModbusTcpIP_Comm_RpiToPC (line 9)
    m = modbus('tcpip', IP_ADDR,MODBUS_PORT)  %establish communication with the server (client)
    

    Cheers,
    Jan

    posted in Communication (RS232
  • RE: Modbus Tcp/IP communication Rpi(Rexygen)<->PC(Matlab)

    @stepan-ozana
    That's good news. I believe your confusion arises from different terminology. The Master/Slave terminology is used in the original context, which we are still adhering to for now. However, the Server/Client terminology is more commonly used nowadays. In the earlier terminology, the client was referred to as master and the server as slave.

    posted in Communication (RS232
  • RE: REST API communication example

    @stepan-ozana
    Thank you for confirmation. I will update the example. Unfortunately, quite large changes occur across Matlab versions, and there are situations where a script from older versions stops working in newer ones.

    Cheers,
    Jan

    posted in Communication (RS232
  • RE: REST API communication example

    @stepan-ozana
    Dear Štěpán,
    I can confirm that the Matlab script behaves the same way for me as it does for you. Thanks for reporting the bug. Can you please test the following modified script? This modification works for me:

    clc;
    clear all;
    
    serviceUrl = 'http://192.168.100.2:8008';
    username = 'admin';
    password = ''; 
    
    % Data to be written
    value_double = 17.89;
    value_long = 1234;
    value_bool = 1;
    value_string = "External string";
    
    % URLs of the data points
    url_double = "/api/tasks/rest_api_task/CNR_IN:ycn";
    url_long =   "/api/tasks/rest_api_task/CNI_IN:icn";
    url_bool =   "/api/tasks/rest_api_task/CNB_IN:YCN";
    url_string = "/api/tasks/rest_api_task/CNS_IN:scv";
    
    % Basic authentication header
    credentials = base64encode([username ':' password]);
    authHeader = ['Basic ' credentials];
    
    % Writing data type double
    data_double = struct('v', value_double);
    writeData(serviceUrl, url_double, data_double, authHeader);
    
    % Writing data type long
    data_long = struct('v', value_long);
    writeData(serviceUrl, url_long, data_long, authHeader);
    
    % Writing data type Boolean
    data_bool = struct('v', value_bool);
    writeData(serviceUrl, url_bool, data_bool, authHeader);
    
    % Writing data type string
    data_string = struct('v', value_string);
    writeData(serviceUrl, url_string, data_string, authHeader);
    
    % Function to encode base64
    function encoded = base64encode(str)
        encoder = java.util.Base64.getEncoder();
        encoded = char(encoder.encodeToString(uint8(str)));
    end
    
    % Function to write data to the server
    function writeData(serviceUrl, url, data, authHeader)
        options = weboptions('RequestMethod', 'post', ...
                             'ContentType', 'json', ...
                             'MediaType', 'application/json', ...
                             'HeaderFields', {'Authorization', authHeader});
        try
            response = webwrite(strcat(serviceUrl, url), data, options);
            disp(['Successfully wrote data to ', url]);
        catch ME
            fprintf('Error writing data to %s:\n%s\n', url, ME.message);
        end
    end
    

    Cheers,
    Jan

    posted in Communication (RS232
  • RE: Modbus Tcp/IP communication Rpi(Rexygen)<->PC(Matlab)

    @stepan-ozana

    Hi Stepan,

    I believe there might be a misunderstanding in the way the connection is being set up. It seems there might be a confusion between the roles of Master and Slave in Modbus TCP communication.

    In Modbus communication, the Slave holds the Modbus table, meaning the Master should connect to the Slave. Therefore, the correct approach should be:

    1. Upload the REXYGEN Slave to your Raspberry Pi.
    2. Try to connect to the Raspberry Pi from Matlab using the following command, where Matlab acts as the Modbus Master:
    m = modbus('tcpip', '192.168.111.2', 'Port', 502);
    

    This way, you are ensuring that the Master (Matlab) is correctly connecting to the Slave (Raspberry Pi with REXYGEN).

    Please let us know if you encounter any further issues.

    Best regards,
    Jan

    posted in Communication (RS232
  • RE: Custom display component

    @Tourneur Hi,

    glad you made it work!

    Yes, it is possible to make a custom component (separate SVG file). For more details see example "0301-12 HMI with External file".

    Cheers,
    Tomas

    posted in REXYGEN HMI Designer
  • RE: Raspberry pi 5 with Book worm

    @MikeyH Hi Mike, I think the fix should be ready within 14 days.
    Cheers,
    Jan

    posted in General discussion
  • RE: Custom display component

    @Tourneur Hi! What a progress - great!

    You just need to change the pivot point by means of the Inscape editor. Feel free to Google any Inkscape-related documentation on this (e.g. https://www.tutorviacomputer.com/inkscape/rotate-flip-objects/)

    Note: Once the object is "animated" by REXYGEN Extension I recommend you to delete the object, change the pivot point and make the animation again.

    Good luck!
    Tomas

    posted in REXYGEN HMI Designer
  • RE: Calling REXYGEN block from PYTHON

    @stepan-ozana Thanks for sharing your solution with the community!

    Good luck with your project.

    Tomas

    posted in General