REXYGEN Community Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Login
    1. Home
    2. Popular
    Log in to post
    • All Time
    • Day
    • Week
    • Month
    • All Topics
    • New Topics
    • Watched Topics
    • Unreplied Topics
    • All categories
    • H

      Complier issue

      Watching Ignoring Scheduled Pinned Locked Moved REXYGEN Studio
      7
      1 Votes
      7 Posts
      1k Views
      cechuratC

      @har Hi har,

      Thanks for the additional info. We are not able to provide free support on this since it's your custom Python script. The error is not related to the Rexygen ecosystem. It seems that the CPU dispatcher is being initialised multiple times.

      Tomas

    • A

      Problems Sequential reading channels ADC MCP3424 via I2C

      Watching Ignoring Scheduled Pinned Locked Moved Communication (RS232, RS485, I2C, SPI, UDP, TCP, ...)
      7
      0 Votes
      7 Posts
      915 Views
      J

      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

    • S

      How to run a compiled .rex model from command line for fast repeated cost-function evaluation

      Watching Ignoring Scheduled Pinned Locked Moved REXYGEN Studio
      7
      0 Votes
      7 Posts
      880 Views
      S

      @cechurat
      Hi,
      I apologize for the delayed response. I needed to consult this issue further before getting back to you.

      Afterwards, I verified the following behavior: after creating the simroot folder and enabling write access to it, running my project in Simulation mode causes crashes. The issue disappears when I set log.file.enabled=1 in rexcore.cfg.

      This can be used as a temporary workaround, although it slightly slows down execution, especially when the simulation is run repeatedly many times.

      If there is a better systematic solution, please let me know.

      Best regards,
      Stepan

    • C

      Raspberry Pi and Click PLC, Modbus TCP

      Watching Ignoring Scheduled Pinned Locked Moved Modbus TCP
      6
      0 Votes
      6 Posts
      4k Views
      S

      Hello folks,

      I just wanted to confirm that reducing the "Max. requests" number to 1 allows multiple Modbus reads of the Click PLC.
      I agree that reading registers in groups of 4 or 8 is more elegant and will try that next.

      Cheers,
      Tom Sisk

    • C

      How to force DbDrv to write the data every 5 minutes (xx:00,xx:05,xx:10, ...)?

      Watching Ignoring Scheduled Pinned Locked Moved Database (MySQL, MariaDB, PostgreSQL, MSSQL)
      6
      0 Votes
      6 Posts
      3k Views
      cechuratC

      @petrch Glad I could help 😉
      Our developers already implemented the new functionality. Starting from new REXYGEN release it will behave as you expected - that Group itself will have also _Trigger flag.

      Good luck with your project.

      Regards, Tomas

    • C

      Help with function blocks

      Watching Ignoring Scheduled Pinned Locked Moved REXYGEN Studio
      6
      0 Votes
      6 Posts
      3k Views
      cechuratC

      Hi Phil,

      let me answer your questions:

      ad 1) Yes, in order to count time connect CNI=1 to "ti" input as you proposed.
      ad 2) Correct, "Y" should contain time.
      ad 3) Exactly.

      It also assumes that your boolean signal from pushbutton is connected to input "u".

      For more details about the INTE function block see docs: https://www.rexygen.com/doc/ENGLISH/MANUALS/BRef/INTE.html#x81-800005

      Cheers, Tomas

    • G

      Envoi commande http / curl

      Watching Ignoring Scheduled Pinned Locked Moved IoT http get http post
      6
      0 Votes
      6 Posts
      2k Views
      cechuratC

      Hi Geocipo,

      thanks for asking. You can send HTTP commands (HTTP GET and HTTP POST) using HTTP2 function block. Have a look at "0302 IoT Integrations" example folder where you can find many examples with HTTP2 function block in various situations.

      If you need more information, let me know.

      Regards,
      Tomas

    • gninausG

      Export archive data via HMI Display

      Watching Ignoring Scheduled Pinned Locked Moved REXYGEN HMI Designer
      6
      0 Votes
      6 Posts
      2k Views
      cechuratC

      Hi Mike,

      thanks for your interest in trying out the pre-release version. You can find the instructions here: https://forum.rexygen.com/topic/120/installation-of-rexygen-2-50-10-r5

      If I can be of any assistance, let me know.

      Cheers,
      Tomas

    • S

      TCP socket : parsing NMEA string

      Watching Ignoring Scheduled Pinned Locked Moved REXYGEN Studio
      6
      0 Votes
      6 Posts
      2k Views
      S

      Thanks for the info .... I'll give it a try one of these days. I'll post the solution... at least if I am able to solve it..... 🙂

    • A

      Use of local parameters in RexHMI Designer

      Watching Ignoring Scheduled Pinned Locked Moved REXYGEN HMI Designer hmi designer local variables
      6
      0 Votes
      6 Posts
      2k Views
      A

      Thank you for the examples. I was trying to make use of the placeholders (like $T for example) which I completed at the end in the Connections tab.

      Now I got it working by only creating the local parameters (HIDE_WINDOW_A, HIDE_WINDOW_B, ...) and giving them a default value '0' in the connections table.
      Then in the button's and windows which are to be hidden I used these newly created local parameters directly. (instead of using the $T).
      And now it is working fine. :-)... still don't know what I'm doing wrong when using the connections table....

    • M

      Strange Modbus Behavior

      Watching Ignoring Scheduled Pinned Locked Moved Modbus RTU modbus rtu diagnostics
      6
      0 Votes
      6 Posts
      2k Views
      cechuratC

      @mikeyh Hi Mike,

      thanks for update. Could you please try to test one Raspberry Pi with certain SD card (i.e. OS) and check with working Monarco HAT and then switch the one failing so we can say it is Monarco HAT failure afterwards?

      Thanks for cooperation.

      Kind Regards,
      Tomas

    • S

      AVG - Moving average - number of samples?

      Watching Ignoring Scheduled Pinned Locked Moved REXYGEN Studio
      6
      0 Votes
      6 Posts
      2k Views
      S

      @cechurat ... this would mean that if I add a task in the future the timing might not be correct anymore.
      Would it not be better that this can be configured with timing (e.g. seconds, minutes, days,.....) instead of a certain amount of samples?

    • M

      REXduino - 1-wire connection

      Watching Ignoring Scheduled Pinned Locked Moved Unsolved General
      6
      0 Votes
      6 Posts
      2k Views
      R

      @mtomek Hi Michal,
      I found the meaning of the errors directly in the REXduino_slave.ino code. The first number indicates the type of error and can have values:

      49 - ERROR_COMMAND 50 - ERROR_PINMODE 51 - ERROR_SERIAL 52 - ERROR_ONEWIRE 53 - ERROR_I2C
      The second number indicates error specification. For example for ERROR_ONEWIRE: 49 - ERROR_ONEWIRE_NOMOREDEVICES 50 - ERROR_ONEWIRE_BUSYBUS 51 - ERROR_ONEWIRE_BADCRC 52 - ERROR_ONEWIRE_DEPLETED 53 - ERROR_ONEWIRE_NOTEMPDEVICE
      I agree that the errors could be mentioned more explicitly somewhere.

      So in your case, the code 52 51 means bad crc error. So, for example, some noise may have appeared during data transmission.

      I don't have any experience with the UniPi hub, because I'm using Monarco HAT. But as I understand to the UniPi 1-wire knowledge base, you should use the first hub port to connect the hub to your Raspberry Pi GPIO. Default GPIO pin for 1-Wire is GPIO 4. After connecting, you can read the data in REXYGEN using OwsDrv module. Please pay special attention to the note in the knowledge base:
      b7515074-e8a3-460c-8a1d-58874c661791-image.png

      Unfortunately, I have no idea if the UniPi hub provides ESD protection. You should check this directly from the manufacturer. If the hub doesn't have protection, I definitely wouldn't connect it directly to the Raspberry GPIO. The resistance of such a solution to the induction of unexpected voltages is negligible and it's possible that your Raspberry would get burned. In the absence of ESD protection, I would rather invest in Monarco HAT, where ESD protection is present and Monarco communicates 1-Wire over the I2C bus (documentation here), so 1-Wire is not connected directly to the processor.

      Cheers,
      Jan

    • F

      Blok PWM

      Watching Ignoring Scheduled Pinned Locked Moved Solved General
      6
      0 Votes
      6 Posts
      2k Views
      R

      @fabio Není zač.

    • M

      REXduino - REXLANG Error

      Watching Ignoring Scheduled Pinned Locked Moved General
      6
      0 Votes
      6 Posts
      3k Views
      R

      @mtomek Hi Michal,
      you are welcome. I'm glad the problem has been fixed.

      Cheers,
      Jan

    • J

      Relační bloky

      Watching Ignoring Scheduled Pinned Locked Moved REXYGEN Studio
      6
      0 Votes
      6 Posts
      2k Views
      A

      Hello, @jackobocze.
      REXYGEN Community Forum is predominantly an english speaking forum.
      Please, refrain from using languages other than english. By doing so your comments and contributians can be useful to much larger field of users of this forum.
      In the future we would like to keep this forum english only and that could cause comments and contributions written in other languages to be deleted without prior notice.

    • C

      Problem rex-odbc and libmaodbc/libmyodbc

      Watching Ignoring Scheduled Pinned Locked Moved Database (MySQL, MariaDB, PostgreSQL, MSSQL)
      6
      1 Votes
      6 Posts
      2k Views
      C

      @jan-reitinger
      Great! Installation completed successfully! Thank you.

    • S

      Is certificate expired?

      Watching Ignoring Scheduled Pinned Locked Moved Bug reports, Feature requests
      6
      0 Votes
      6 Posts
      2k Views
      S

      Closed. Solved in another way. Thanks support!

    • T

      Simulate project without target connected

      Watching Ignoring Scheduled Pinned Locked Moved REXYGEN Studio
      6
      1 Votes
      6 Posts
      2k Views
      T

      @Tourneur

      Hello,

      All my apologies for this very late replying, and status of my advancement.

      Unfortunately, I left completely the idea of using simulation without real target connected.

      I tryed to compare the use of Rexygen with Profilab Expert, which is for me a really, and really compfortable software.
      Particularly, when you are not familiary with all the complexity of programming environnement.

      But yes, now, I see it's completly different, and I must re-see all my vision of Rexygen.

      I finally decided to use a real target, and follow the tutorial in the documentation.

      I arrived to put in place an interactive comunication with the target and my ethernet devices.

      You understand lot of thing when system running, for example, i won't understood the machine interface is a web page.

      Now I could, thing a little bit deeper in the working of the rexstudio.
      Particularly, with Nextape, for a particular project.
      I will put my question in HMI topic.

      Have a good end day

    • S

      Exchanging data between tasks

      Watching Ignoring Scheduled Pinned Locked Moved REXYGEN Studio
      6
      0 Votes
      6 Posts
      2k Views
      cechuratC

      @carvin Hi carvin,

      thanks for your feedback. I would suggest to use the SRTF function block with some certain subsystem (e.g. "sybsystem_slow") within your fast task.

      Would that solve your issue?

      Cheers,
      Tomas