<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Communication (RS232, RS485, I2C, SPI, UDP, TCP, ...)]]></title><description><![CDATA[Need help configuring some of the I&#x2F;O drivers? Problems integrating custom hardware or software?]]></description><link>https://forum.rexygen.com/category/12</link><generator>RSS for Node</generator><lastBuildDate>Wed, 20 May 2026 13:58:00 GMT</lastBuildDate><atom:link href="https://forum.rexygen.com/category/12.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 10 Jan 2026 14:49:00 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Problems Sequential reading channels ADC MCP3424 via I2C]]></title><description><![CDATA[<p dir="auto">Hi everyone,</p>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://forum.rexygen.com/uid/231">@AlexanderH</a> solved his MCP3424 multi-channel reading issue! Here's the key takeaway:</p>
The Problem
<p dir="auto">When reading multiple channels sequentially from MCP3424, <strong>conversion time must be respected</strong>. Each configuration byte starts a new conversion:</p>

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

<p dir="auto"><strong>Table 4.3 from MCP3424 datasheet</strong> lists all data rates by resolution.</p>
The Solution
<p dir="auto"><strong>One-shot mode + proper timing between configure/read operations:</strong></p>
<p dir="auto"><strong>For 12-bit (2 channels):</strong></p>
// 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]&lt;&lt;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]&lt;&lt;8) + i2c_bufRx[1])/2;

Important Notes
<p dir="auto">Sleep time scales with resolution - 10ms works for 12-bit, 270ms needed for 18-bit</p>
<p dir="auto">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.</p>
Example Update
<p dir="auto">REXYGEN example library will be extended with:</p>

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

<p dir="auto">Big thanks to Alexander for the thorough debugging, testing different timing scenarios, and sharing his working scripts!</p>
<p dir="auto">Cheers,<br />
Jan</p>
]]></description><link>https://forum.rexygen.com/topic/620/problems-sequential-reading-channels-adc-mcp3424-via-i2c</link><guid isPermaLink="true">https://forum.rexygen.com/topic/620/problems-sequential-reading-channels-adc-mcp3424-via-i2c</guid><dc:creator><![CDATA[Jan Reitinger]]></dc:creator><pubDate>Sat, 10 Jan 2026 14:49:00 GMT</pubDate></item><item><title><![CDATA[Problems reading from PCF8574A]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://forum.rexygen.com/uid/231">@AlexanderH</a> Hi,<br />
I'm sorry. For some reason I didn't get an email notifying me that you had replied. I'm glad you finally resolved the issue.</p>
<p dir="auto">Cheers,<br />
Jan</p>
]]></description><link>https://forum.rexygen.com/topic/614/problems-reading-from-pcf8574a</link><guid isPermaLink="true">https://forum.rexygen.com/topic/614/problems-reading-from-pcf8574a</guid><dc:creator><![CDATA[Jan Reitinger]]></dc:creator><pubDate>Mon, 18 Aug 2025 08:35:40 GMT</pubDate></item><item><title><![CDATA[Bluetooth sensor with rexygen]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://forum.rexygen.com/uid/5722">@har</a> Hi Har,</p>
<p dir="auto">I'm sorry, but we are not able to debug third-party Python code for you.</p>
<p dir="auto">If you made it work under plain Python, then you can send the data to REXYGEN using the REST API. Have a look at "0302-03 REST API Python Bash etc", which sends data to REXYGEN using Python.</p>
<p dir="auto">Kind regards,<br />
Tomas</p>
]]></description><link>https://forum.rexygen.com/topic/612/bluetooth-sensor-with-rexygen</link><guid isPermaLink="true">https://forum.rexygen.com/topic/612/bluetooth-sensor-with-rexygen</guid><dc:creator><![CDATA[cechurat]]></dc:creator><pubDate>Tue, 08 Jul 2025 20:24:20 GMT</pubDate></item><item><title><![CDATA[SPI comms for MCP41X]]></title><description><![CDATA[<p dir="auto">Hello All,</p>
<p dir="auto">Is there, or does anyone have an example of using an MCP41X digital 257 position potentiometer with SPI?</p>
<p dir="auto">Cheers,<br />
Mike</p>
]]></description><link>https://forum.rexygen.com/topic/608/spi-comms-for-mcp41x</link><guid isPermaLink="true">https://forum.rexygen.com/topic/608/spi-comms-for-mcp41x</guid><dc:creator><![CDATA[MikeyH]]></dc:creator><pubDate>Sat, 28 Jun 2025 00:06:48 GMT</pubDate></item><item><title><![CDATA[Connection Problem]]></title><description><![CDATA[<p dir="auto">Hi har,<br />
Check if RexCore is running. I see that you are solving the Python code in another thread. It is possible that your code is not only causing the error, but also causing the entire RexCore to crash. Try connecting to the Raspberry via SSH and enter the command:</p>
systemctl status rexcore

<p dir="auto">Cheers,<br />
Jan</p>
]]></description><link>https://forum.rexygen.com/topic/606/connection-problem</link><guid isPermaLink="true">https://forum.rexygen.com/topic/606/connection-problem</guid><dc:creator><![CDATA[Jan Reitinger]]></dc:creator><pubDate>Tue, 10 Jun 2025 15:17:53 GMT</pubDate></item><item><title><![CDATA[Modbus Tcp&#x2F;IP communication Rpi(Rexygen)&lt;-&gt;PC(Matlab)]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://forum.rexygen.com/uid/26">@stepan-ozana</a> 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.</p>
'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)

<p dir="auto">Cheers,<br />
Jan</p>
]]></description><link>https://forum.rexygen.com/topic/590/modbus-tcp-ip-communication-rpi-rexygen-pc-matlab</link><guid isPermaLink="true">https://forum.rexygen.com/topic/590/modbus-tcp-ip-communication-rpi-rexygen-pc-matlab</guid><dc:creator><![CDATA[Jan Reitinger]]></dc:creator><pubDate>Wed, 26 Jun 2024 09:40:03 GMT</pubDate></item><item><title><![CDATA[REST API communication example]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://forum.rexygen.com/uid/26">@stepan-ozana</a><br />
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.</p>
<p dir="auto">Cheers,<br />
Jan</p>
]]></description><link>https://forum.rexygen.com/topic/589/rest-api-communication-example</link><guid isPermaLink="true">https://forum.rexygen.com/topic/589/rest-api-communication-example</guid><dc:creator><![CDATA[Jan Reitinger]]></dc:creator><pubDate>Wed, 26 Jun 2024 06:34:25 GMT</pubDate></item><item><title><![CDATA[Raspbiian Bookworm]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://forum.rexygen.com/uid/38">@BailP</a> Hello,<br />
yes, there are REXYGEN packages (version 3) for Bookworm. Details are described <a href="https://download.rexcontrols.cz/partner/testing/">here</a>.</p>
<p dir="auto">Cheers,<br />
Jan</p>
]]></description><link>https://forum.rexygen.com/topic/584/raspbiian-bookworm</link><guid isPermaLink="true">https://forum.rexygen.com/topic/584/raspbiian-bookworm</guid><dc:creator><![CDATA[Jan Reitinger]]></dc:creator><pubDate>Mon, 20 May 2024 16:33:35 GMT</pubDate></item><item><title><![CDATA[HW PWM on RPi?]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://forum.rexygen.com/uid/26">@stepan-ozana</a> Hello, yes PWM flags should work as HW PWM on GPIO12, GPIO13, GPIO18, GPIO19 pins. The functionality should be the same as described here:  <a href="https://www.raspberrypi.com/documentation/computers/raspberry-pi.html">https://www.raspberrypi.com/documentation/computers/raspberry-pi.html</a><br />
<a href="https://www.electronicwings.com/raspberry-pi/raspberry-pi-pwm-generation-using-python-and-c">https://www.electronicwings.com/raspberry-pi/raspberry-pi-pwm-generation-using-python-and-c</a></p>
<p dir="auto">Best regards,<br />
Jan</p>
]]></description><link>https://forum.rexygen.com/topic/418/hw-pwm-on-rpi</link><guid isPermaLink="true">https://forum.rexygen.com/topic/418/hw-pwm-on-rpi</guid><dc:creator><![CDATA[Jan Reitinger]]></dc:creator><pubDate>Thu, 23 Nov 2023 10:33:01 GMT</pubDate></item><item><title><![CDATA[ASCII Commands Over RS485]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://forum.rexygen.com/uid/60">@georgedumitru</a> I think the best documentation is <a href="https://forum.rexygen.com/topic/171/i2c-ezo-component/6?_=1692897898747">this</a> thread here on the forum. Byte array reading from communication is also discussed there.</p>
<p dir="auto">Another helpful tool is definitely the example located at C:\Program Files\REX Controls\REXYGEN 2.50.12.14711\Examples\0203_Function_Blocks_REXLANG.</p>
]]></description><link>https://forum.rexygen.com/topic/388/ascii-commands-over-rs485</link><guid isPermaLink="true">https://forum.rexygen.com/topic/388/ascii-commands-over-rs485</guid><dc:creator><![CDATA[Jan Reitinger]]></dc:creator><pubDate>Tue, 01 Aug 2023 14:29:46 GMT</pubDate></item><item><title><![CDATA[Communication with USBRLY82]]></title><description><![CDATA[<p dir="auto">Hi George,</p>
<p dir="auto">Thanks for your question. You need to create a kind of state machine which basically does the following (one line = one task period):</p>

Write() - send a read request to the device
Read() - save received data and length into a global buffer/variable and distinguish if the received message is complete
Retry and repeat Read() if the previously received message was not complete

<p dir="auto">You will need to introduce a timeout - it can happen that you lost some data so there should be some timeout when you say "Message incomplete, resend the read request".</p>
<p dir="auto">Cheers,<br />
Tomas</p>
]]></description><link>https://forum.rexygen.com/topic/386/communication-with-usbrly82</link><guid isPermaLink="true">https://forum.rexygen.com/topic/386/communication-with-usbrly82</guid><dc:creator><![CDATA[cechurat]]></dc:creator><pubDate>Thu, 13 Jul 2023 13:02:44 GMT</pubDate></item><item><title><![CDATA[REXduino and TSC2007]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://forum.rexygen.com/uid/506">@hrabalo</a> Hi,</p>
<p dir="auto">Thanks for getting back to us. I'm glad it works for you now.</p>
<p dir="auto">Good luck with your project.</p>
<p dir="auto">Cheers, Tomas</p>
]]></description><link>https://forum.rexygen.com/topic/364/rexduino-and-tsc2007</link><guid isPermaLink="true">https://forum.rexygen.com/topic/364/rexduino-and-tsc2007</guid><dc:creator><![CDATA[cechurat]]></dc:creator><pubDate>Mon, 20 Feb 2023 19:13:33 GMT</pubDate></item><item><title><![CDATA[VSD single wire Modbus]]></title><description><![CDATA[<p dir="auto">Hi All,</p>
<p dir="auto">I have a VSD I'd like to connect to the Monarco to control motor speed and read faults. Only it's a single wire half duplex. is there a way of connecting this to the Monarco?<br />
<img src="/assets/uploads/files/1657157895902-0308ff01-0432-4deb-9ddd-816e88d7662d-image.png" alt="0308ff01-0432-4deb-9ddd-816e88d7662d-image.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">VCC is 5-12vdc, so that's ok. I'm just not 100% of how I can connect it to the HAT. As it says, it's not RS485 compatible.</p>
<p dir="auto">Cheers</p>
<p dir="auto">Mike</p>
]]></description><link>https://forum.rexygen.com/topic/313/vsd-single-wire-modbus</link><guid isPermaLink="true">https://forum.rexygen.com/topic/313/vsd-single-wire-modbus</guid><dc:creator><![CDATA[MikeyH]]></dc:creator><pubDate>Thu, 07 Jul 2022 01:39:45 GMT</pubDate></item><item><title><![CDATA[eBUS]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://forum.rexygen.com/uid/307">@pancirm</a><br />
Hello Michal,<br />
as far as we know, no one implemented the eBUS in REXYGEN. However, implementation should be possible, for example, via eBUS &lt;-&gt; USB converter and <a href="https://www.rexygen.com/doc/ENGLISH/MANUALS/BRef/REXLANG.html">REXLANG</a> or <a href="https://www.rexygen.com/doc/ENGLISH/MANUALS/BRef/PYTHON.html">Python</a> programming block.</p>
<p dir="auto">Cheers,<br />
Jan</p>
]]></description><link>https://forum.rexygen.com/topic/299/ebus</link><guid isPermaLink="true">https://forum.rexygen.com/topic/299/ebus</guid><dc:creator><![CDATA[Jan Reitinger]]></dc:creator><pubDate>Thu, 17 Mar 2022 14:38:10 GMT</pubDate></item><item><title><![CDATA[Can driver]]></title><description><![CDATA[<p dir="auto">Hi Toni,<br />
FilterIdMask can be used for filtering messages from more devices. In your case, there is only one device, so you can set FilterIdMask as 0xfff. For message decomposing, use the <strong>INTSM</strong> blocks (<a href="http://www.rexygen.com/doc/ENGLISH/MANUALS/BRef/INTSM.html">www.rexygen.com/doc/ENGLISH/MANUALS/BRef/INTSM.html</a>). The basic example of using INTSM block can be found in this thread: <a href="https://forum.rexygen.com/topic/174/reading-and-writing-4-byte-floating-point-from-modbus?_=1609251284153">https://forum.rexygen.com/topic/174/reading-and-writing-4-byte-floating-point-from-modbus?_=1609251284153</a><br />
For decomposing a byte value into bits can be used block <strong>BDOCT</strong>(<a href="http://www.rexygen.com/doc/ENGLISH/MANUALS/BRef/BDOCT.html">www.rexygen.com/doc/ENGLISH/MANUALS/BRef/BDOCT.html</a>).</p>
<p dir="auto">Cheers,<br />
Jan</p>
]]></description><link>https://forum.rexygen.com/topic/173/can-driver</link><guid isPermaLink="true">https://forum.rexygen.com/topic/173/can-driver</guid><dc:creator><![CDATA[reitinge]]></dc:creator><pubDate>Wed, 16 Dec 2020 15:50:29 GMT</pubDate></item><item><title><![CDATA[I2C EZO component]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://forum.rexygen.com/uid/219">@belgacom</a> You are welcome 🙂</p>
]]></description><link>https://forum.rexygen.com/topic/171/i2c-ezo-component</link><guid isPermaLink="true">https://forum.rexygen.com/topic/171/i2c-ezo-component</guid><dc:creator><![CDATA[reitinge]]></dc:creator><pubDate>Mon, 07 Dec 2020 14:08:59 GMT</pubDate></item><item><title><![CDATA[I2C with REXDuino]]></title><description><![CDATA[<p dir="auto">Me and my colleague finally implemented some functional solution. We make it public if anyone is interested. Many thanks to Ing. Tomáš Dočekal!<br />
<a href="/assets/uploads/files/1602853902454-mcp4725_rexduino_2_50_10.zip">MCP4725_REXDuino_2_50_10.zip</a></p>
]]></description><link>https://forum.rexygen.com/topic/152/i2c-with-rexduino</link><guid isPermaLink="true">https://forum.rexygen.com/topic/152/i2c-with-rexduino</guid><dc:creator><![CDATA[stepan.ozana]]></dc:creator><pubDate>Fri, 16 Oct 2020 06:29:31 GMT</pubDate></item><item><title><![CDATA[SPI Communication &#x2F; Rexlang &#x2F; RelayPlate &#x2F; DAQCPlate]]></title><description><![CDATA[<p dir="auto">Hi Paul,</p>
<p dir="auto">thanks for reaching out. You can now integrate Python scripts within REXYGEN 2.50.10 - for upgrade see post <a href="https://forum.rexygen.com/topic/120/installation-of-rexygen-2-50-10-testing">https://forum.rexygen.com/topic/120/installation-of-rexygen-2-50-10-testing</a></p>
<p dir="auto">Python block documentaton: <a href="https://www.rexygen.com/doc/ENGLISH/MANUALS/BRef/PYTHON.html#x272-27100016">https://www.rexygen.com/doc/ENGLISH/MANUALS/BRef/PYTHON.html#x272-27100016</a></p>
<p dir="auto">Let us know if it helped.</p>
<p dir="auto">Regards,<br />
Tomas</p>
]]></description><link>https://forum.rexygen.com/topic/126/spi-communication-rexlang-relayplate-daqcplate</link><guid isPermaLink="true">https://forum.rexygen.com/topic/126/spi-communication-rexlang-relayplate-daqcplate</guid><dc:creator><![CDATA[cechurat]]></dc:creator><pubDate>Thu, 06 Aug 2020 07:52:24 GMT</pubDate></item><item><title><![CDATA[Best way to send commands over Ethernet to a 2Dcode (QRcode) reader]]></title><description><![CDATA[<p dir="auto">Hi Ivan,</p>
<p dir="auto">thank you for your question.<br />
Using REXLANG function block you can manage Ethernet communication - see REXLANG documentation - part  Communication functions: <a href="https://www.rexygen.com/doc/PDF/ENGLISH/BRef_ENG.pdf#page=447">https://www.rexygen.com/doc/PDF/ENGLISH/BRef_ENG.pdf#page=447</a></p>
<p dir="auto">Have a look also at "0504-01 Generic UDP Sender Receiver" example which can help you to start with the implementation.</p>
<p dir="auto">Regards, Tomas</p>
]]></description><link>https://forum.rexygen.com/topic/100/best-way-to-send-commands-over-ethernet-to-a-2dcode-qrcode-reader</link><guid isPermaLink="true">https://forum.rexygen.com/topic/100/best-way-to-send-commands-over-ethernet-to-a-2dcode-qrcode-reader</guid><dc:creator><![CDATA[cechurat]]></dc:creator><pubDate>Fri, 20 Mar 2020 15:38:43 GMT</pubDate></item><item><title><![CDATA[Connecting Racing Wheel to REXYGEN]]></title><description><![CDATA[<p dir="auto">Thanks for the explanation, now I understand. Nice solution.</p>
<p dir="auto">Jaroslav</p>
]]></description><link>https://forum.rexygen.com/topic/61/connecting-racing-wheel-to-rexygen</link><guid isPermaLink="true">https://forum.rexygen.com/topic/61/connecting-racing-wheel-to-rexygen</guid><dc:creator><![CDATA[jaroslav_sobota]]></dc:creator><pubDate>Wed, 18 Sep 2019 08:33:02 GMT</pubDate></item><item><title><![CDATA[Telegraf (influxDB) integration]]></title><description><![CDATA[<p dir="auto">Hi <a class="plugin-mentions-user plugin-mentions-a" href="https://forum.rexygen.com/uid/12">@Scoobsalamander</a>, thanks for info, I will look into it.</p>

<p dir="auto">Hubert</p>
]]></description><link>https://forum.rexygen.com/topic/59/telegraf-influxdb-integration</link><guid isPermaLink="true">https://forum.rexygen.com/topic/59/telegraf-influxdb-integration</guid><dc:creator><![CDATA[hubert]]></dc:creator><pubDate>Thu, 29 Aug 2019 10:46:15 GMT</pubDate></item><item><title><![CDATA[Ethercat compatible?]]></title><description><![CDATA[<p dir="auto">No problem, it is only for some hobby-related stuff so no rush.</p>
<p dir="auto">Grtz,</p>
<p dir="auto">Kris</p>
]]></description><link>https://forum.rexygen.com/topic/55/ethercat-compatible</link><guid isPermaLink="true">https://forum.rexygen.com/topic/55/ethercat-compatible</guid><dc:creator><![CDATA[Scoobsalamander]]></dc:creator><pubDate>Mon, 05 Aug 2019 18:08:16 GMT</pubDate></item></channel></rss>