administrators

Posts

  • RE: Resolution of data passed through GoTo block

    @MikeyH
    Hi Mike,

    Without seeing the full schema, my guess would be a data type mismatch. It looks like the block with the val0-2 inputs might be expecting an integer (long) data type. If that's the case, any incoming real number would get automatically rounded or truncated, which would explain the lost decimal places.
    4c1bb596-2757-4241-9838-e73fc8ea7611-image.png

    Cheers,
    Jan

    posted in REXYGEN Studio
  • RE: How to run a compiled .rex model from command line for fast repeated cost-function evaluation

    @stepan-ozana Hi Stepan,

    Thanks for the data file.

    I can confirm that I'm able to run the project using ResCore on localhost. I'm also able to run your project in the Simulation mode invoked via Studio.

    Please, try out the following: In the project folder (where all the mdl files and Python files are stored), create an empty folder simroot and try to run the simulation via Studio again. (This tells simulation mode to use the simroot folder as a root folder for RexCore)

    You can also try to run the simulation from the command line:

    1. Copy the compiled project myproject_exec.rex into folder C:\ProgramData\REX Controls\REX_<VERSION>\rexcore\ and rename it to exec.rex
    2. Run command: "C:\Program Files\REX Controls\<REXYGEN_VERSION>\Bin\RexCore.com" -C <PATH>, where <PATH> is relative/absolut path to <PROJECT_FOLDER>\simroot\rexcore\rexcore.cfg file. This config file is already prepared for simulation. You can change its parameters if desired.

    Please note that using RexCore.com instead of RexCore.exe keeps the process running in the command line along with all the System Log printouts, which could provide a clue as to what is preventing you from using the simulation mode.

    Let me know if you have any progress on this.

    Kind regards,
    Tomas

    posted in REXYGEN Studio
  • RE: How to run a compiled .rex model from command line for fast repeated cost-function evaluation

    @stepan-ozana Hi Stepan,

    Thanks for sharing your experiences. Please, can you provide kanal2_od_000645.csv file? It is to be loaded in compile time in block CNA_uU.

    Thanks.

    Tomas

    posted in REXYGEN Studio
  • RE: How to run a compiled .rex model from command line for fast repeated cost-function evaluation

    @stepan-ozana Hi Stepan,

    Thank you for your advanced question.

    The proposed solution can look like the following:

    1. Run RexCore from the command line with specific simulation parameters:
      RexCore -z simulation.enabled=1

    Simulation-related parameters (other parameters can be found at /rex/rexcore/rexcore.cfg.help):

    simulation.enabled=1 // turns on simulation mode
    simulation.tickmin=0 // minimum tick time in milliseconds (if calculations finish earlier, sleep is done; default 0, so no sleep is done)
    simulation.steps // number of ticks after start, then the run stops
    simulation.start // date and time before the start of the simulation; default 0, i.e. Rex epoch 1.1.2000 00:00:00
    
    1. Load set of input parameters - use SILO/SILOS function block or STATELOAD/STATESAVE function block.
    2. At the end of the simulation, you can store the results using the same FB as mentioned in 2. It is also possible to read the result values via the REST API. The RexCore will continue running after the specified tick count, but the blocks will no longer be executed.

    If you have any additional questions, just let me know.

    Regards,
    Tomas

    posted in REXYGEN Studio
  • RE: Refrigeration system P-H Diagram

    @MikeyH Hi Mike,

    Thanks for the details. Currently, there is no direct support for such data representation.

    For small-scale, I can imagine using the CNDR function block. You can also check the STEAM function block, but it appears the data you require is missing there.

    There is also the possibility to use, e.g., Python or a C library if available.

    Let me know your thoughts on this.

    Regards,
    Tomas

    posted in REXYGEN Studio
  • RE: License error

    Hi @MikeyH ,

    The error "Configuration requires higher license than available on the target device" is caused by having an old license version with the new REXYGEN.

    This error does not prevent the algorithm from running – your System Log confirms it started successfully.

    The real issue is the Modbus communication failure with your slave device. Could anything have changed on the slave device side recently?

    Cheers,
    Jan

    posted in General
  • RE: Refrigeration system P-H Diagram

    @MikeyH Hi Mike,

    Thanks for your post. Please can you add more details about your intention? Are you looking for a solution to store or use such a dataset in your control algorithm? Or is the goal to visualise similar diagrams on the HMI screen?

    Kind regards,
    Tomas

    posted in REXYGEN Studio
  • RE: Problems Sequential reading channels ADC MCP3424 via I2C

    Hi everyone,

    @AlexanderH solved his MCP3424 multi-channel reading issue! Here's the key takeaway:

    The Problem

    When reading multiple channels sequentially from MCP3424, conversion time must be respected. Each configuration byte starts a new conversion:

    • 12-bit: ~5ms (1/240 s)
    • 18-bit: ~267ms (1/3.75 s)

    Table 4.3 from MCP3424 datasheet lists all data rates by resolution.

    The Solution

    One-shot mode + proper timing between configure/read operations:

    For 12-bit (2 channels):

    // Channel 1 - configure + convert + read
    i2c_bufTx[0] = 0x80; // CH1, one-shot, 12-bit, gain x1  
    i2c_write_count = 1;
    i2c_read_count = 0;
    i2c_ret_fun = I2C(i2c_bus_handle, i2c_chip_address, i2c_bufTx, i2c_write_count, i2c_bufRx, i2c_read_count);
    
    Sleep(0.01); // wait for 10 ms before reading the first channel 
                 // Data rate: 12bit = 240 SPS, 14bit = 60 SPS, 16bit = 15 SPS, 18bit = 3.75 SPS
    
    i2c_write_count = 0;
    i2c_read_count = 3;
    i2c_ret_fun = I2C(i2c_bus_handle, i2c_chip_address, i2c_bufTx, i2c_write_count, i2c_bufRx, i2c_read_count);
    // i2c_bufRx[2] contains configuration byte
    channel1 = ((i2c_bufRx[0]<<8) + i2c_bufRx[1])/2;
    
    i2c_bufTx[0] = 0xA0; // channel 2, one-shot, 12bit, gain 1 (see MCP3424 datasheet)
    i2c_write_count = 1;
    i2c_read_count = 0;
    i2c_ret_fun = I2C(i2c_bus_handle, i2c_chip_address, i2c_bufTx, i2c_write_count, i2c_bufRx, i2c_read_count);
      
    Sleep(0.01); // wait for 10 ms before reading the second channel 
                 // Data rate: 12bit = 240 SPS, 14bit = 60 SPS, 16bit = 15 SPS, 18bit = 3.75 SPS
      
    i2c_write_count = 0;
    i2c_read_count = 3;
    i2c_ret_fun = I2C(i2c_bus_handle, i2c_chip_address, i2c_bufTx, i2c_write_count, i2c_bufRx, i2c_read_count);
    channel2 = ((i2c_bufRx[0]<<8) + i2c_bufRx[1])/2;
    

    Important Notes

    Sleep time scales with resolution - 10ms works for 12-bit, 270ms needed for 18-bit

    Original MCP3422 example worked because it read only 1 channel (no channel switching). The message from the previous tick was probably returned as a response.

    Example Update

    REXYGEN example library will be extended with:

    • read_mcp3424_12bit.c - 2 channels, 12-bit
    • read_mcp3424_18bit.c - 2 channels, 18-bit

    Big thanks to Alexander for the thorough debugging, testing different timing scenarios, and sharing his working scripts!

    Cheers,
    Jan

    posted in Communication (RS232
  • RE: Rexygen Runtime installation after 31st January 2026

    @martinpies Dear Martin,
    Thank you for pointing this out. Everything should be working now. The command

    sudo wget https://download.rexcontrols.com/rexygen.gpg -O /etc/apt/trusted.gpg.d/rexygen.gpg
    

    will now download the new version of the certificate, which is supported even under the new licensing policy.

    Cheers,
    Jan

    posted in Bug reports
  • RE: Rexygen Runtime installation after 31st January 2026

    @martinpies
    Hello Martin,
    I apologize for the complications. This issue is on the REXYGEN side, and I have already reported it to the developers. I hope it will be resolved soon.

    In the meantime, I recommend using our pre-installed Bookworm image according to the instructions in chapter 2.2 Monarco HAT: https://www.rexygen.com/doc/ENGLISH/MANUALS/RexCore_Installation/RexCore_Installation_ENG.html#x1-60002.2

    Alternatively, you can install REXYGEN from Studio using the Quick bootstrapping guide in chapter 3.1: https://www.rexygen.com/doc/ENGLISH/MANUALS/RexCore_Installation/RexCore_Installation_ENG.html#x1-90003

    Cheers,
    Jan

    posted in Bug reports