Schneider IHC IO modules - Modbus

Hello,

I'm planning to build a converter to talk over modbus to Schneider IHC input and output modules.
These modules are part of the Schneider home automation system, also known as LK IHC, Gardy IHC, Simonvis and ELKO.

The modbus part is easy, as I use the existing libraries.
However I do not understand how to output the IHC protocol to control the relay modules or to read the IHC protocol to read the input modules.

There are a few sources with information:

https://www.dingus.dk/ihc-inoutput-protokol/
https://www.dingus.dk/arduinoihc/

Can anyone put me on the right track, maybe with an example of sending a 8 bit value to the output module? I'm totally lost with this one.
Thanks

Have you run the BasicOutput demonstration program in the arduinoihc library?

I think the BasicOutput simulates an output module.
I want to control this output module

The documentation says, "This example will create 2 IHCOutput on arduino port 2 and 3. Port 2 will count,
and port 3 will shift 1 bit."

Does it generate a waveform on pins 2 and 3?

allright, one part of the job done, I've created a modbus to IHC output converter.
With one arduino it is now possible to control 7x8 IHC outputs over modbus TCP.

With the BasicInput example, I get no readings on the serial monitor, even with the exact same sketch.
For now, I'm stuck...

bartmarchand:
With the BasicInput example, I get no readings on the serial monitor, even with the exact same sketch.
For now, I'm stuck...

The documentation for the BasicInput demo says
"This example will create an IHCInput on arduino port 2, and print the input value (binary) on the serial port when it changes."

Are you sending it data that changes?
Does the baud rate of your serial monitor match the baud rate set in the program?

I have connected a IHC input module to pin 2 of the arduino.
On this module input 1 is active.

Nothing is shown on the serial monitoring, with the right baudrate

As a test I loaded the pulsein sketch from the reference, this give me a flow of numbers, so I think the arduino and IHC module are communicating.

bartmarchand:
... so I think the arduino and IHC module are communicating.

So the library output and input works as per the documentation?

library output with 8 relay IHC output module works, no results with the input library.

Maybe the setup is wrong:
Data from the IHC 16 input module connected to pin 2 of the arduino.
Sketch BasicInput loaded.
Is this correct?

The BasicInput program only sends data to the terminal when the input data from the IHC input module changes. If the signals going into the input module are always the same then you will not see any data in the terminal window.

If you want it to continuously send data to the terminal then you will need to modify the program.

I adapted the program to detect if the value of the input variable has changed.
There is no change detected.
I think there is something fundamentally wrong but I cannot see it...

So strange, I only want to read the puls train from the IHC input module with an arduino.

To debug this further you will need to use a logic analyser or oscilloscope to capture the data stream from the IHC input module.

With the oscilloscope, I have the signals as discribed by Dingus
When an input on the IHC module is activated, the signal changes for the time the input is active.

I'm stuck I think

The next step is to analyse the decode behaviour of the IHCInput.cpp file.
Find someone locally who can walk you through the steps of instrumenting the code bearing in mind that most of the activity is inside an interrupt so you cannot use Serial.print().

I was thinking the same... no one near me with this knowledge.
I have also contacted the autor of ArduinoIHC, maybe I can get some support from him.

I've connected the output of the arduino directly to the datainput of the IHC outputmodule.

Same for the input, I connected the dataoutput of the IHC intputmodule directly to the input of the arduino.
Do I need to place a pull up resistor on the input of the arduino?

bartmarchand:
Do I need to place a pull up resistor on the input of the arduino?

If you see TTL voltage levels on the oscilloscope trace then, you don't need a pull up resistor.

So strange:

IHC inputmodule connected to IHC outputmodule: OK

Arduino BasicOutput connected to IHC outputmodule: OK

Arduino BasicOutput connected to Arduino BasicInput: OK

IHC inputmodule connected to Arduino Basicinput: NOK

I'm lost...

I did some scope measurements, signal is exactly the same.