Page 1 of 1

RS485 communication test

Posted: Wed Mar 05, 2025 1:34 pm
by walbeek
Hi there,

I have made two FC10 programs.
The first one has 32 inputs and when a input is high, data is send to UART.

The second one has 32 outputs and checks the UART continiously.
When data is received the outputs should change.

When I run both programs one One PC, I would like to test the communication.
The transmitter seems to send data and I have included a VNET injector.

The receiver doesn't react at all.
I have tested all kind of settings in the injectors parameters, however no result.
Can anyone show me how the settings have to be changed?

Both FC10 programs are included.

Re: RS485 communication test

Posted: Wed Mar 05, 2025 2:37 pm
by walbeek
Update!

I found a Modbus Master and Slave example on the Matrix site.
After copying the settings of the VNET injectors, there seems to be communication.
However, the tests doesn't run as expected for now, the data seems corrupted.

When the TX has data to send, I first send 0xAA (170 or 10101010) as start address
Than the four data-bytes and at the end 0X55 (85 or 01010101) as stop address.
When I check re variable RECEIVE[0] for 0xAA, the leds stay off.
When I move "writing the data" above the decision for this, lots of the leds turn on.
So I need to do some more checking on this incoming data.

Does anybody have suggestions on how to improve the reliability on this?
For now it looks like random leds turn on.

Thanks for your help already.

Rinie

Re: RS485 communication test

Posted: Thu Mar 06, 2025 2:33 pm
by medelec35
Hello.
It looks like you are send an eight bit address and receiving a seven bit address.
You can try RECEIVE[0] = RECEIVE[0] <<1 to shift back to an 8 bit address.
If this is not the issue, then I will look into this further.

Re: RS485 communication test

Posted: Mon Mar 10, 2025 1:54 pm
by walbeek
Hello Martin,

Thanks for your reply.
I have tried the bit-shift on several places in the code but I can't find any changes so far.
I have also tried to change the RX and TX lines, and the direction HI or LOW on C5.
Also no changes as far as I can see, but in simulation, I didn't expect them to have use anyway.
I'm stuck for now...

Rinie