Date format: day / month / year on the same row

hi I’m a beginner, I would like to make appear on the same line the date that is read in the home automation system to the word

640 Day of the week Beginning of the Date and Time map of DFCK bus module (Note 6)
641 Hour (Note 6)
642 Minutes (Note 6)
643 Date (Note 6)
644 Month (Note 6)
645 Year (Note 6)

Note 6: The Words from 640 to 645 contains a copy of the current date and time of DFCK or DFCKII module (if connected and if its ID
is set to 1); these Words may be also written, and in this case the clock of DFCK or DFCKII module will be updated according to the
new parameters. This feature allows the reading and the writing of the clock using the reading and writing functions of the RAM
registers. The change of each one of these parameters will reset the field of the seconds of DFCK or DFCKII module. The day of the
week is coded as number in the range 0 to 6, where 0=Sunday, 1=Monday and so on. The Words related to Hour, Minutes, Date, Month
and Year are coded in BCD format

I can see the data on the same line but with incorrect values.
My configuration is as follows:

#config

#DFCK - GIORNO DELLA SETTIMANA
#bit0=Domenica, bit1=Lunedi, bit2=Martedi, bit3=Mercoledi, bit4=Giovedi, bit5=Venerdi, bit6=Sabato
modbus:serial.dfckgiorno.connection=COM1:19200:8:none:1:rtu
modbus:serial.dfckgiorno.id=1
modbus:serial.dfckgiorno.start=640
modbus:serial.dfckgiorno.length=1
modbus:serial.dfckgiorno.type=holding
#modbus:serial.dfckgiorno.valuetype=bit

#DFCK - ORA
modbus:serial.dfckora.connection=COM1:19200:8:none:1:rtu
modbus:serial.dfckora.id=1
modbus:serial.dfckora.start=641
modbus:serial.dfckora.length=1
modbus:serial.dfckora.type=holding

#DFCK - MINUTI
modbus:serial.dfckminuti.connection=COM1:19200:8:none:1:rtu
modbus:serial.dfckminuti.id=1
modbus:serial.dfckminuti.start=642
modbus:serial.dfckminuti.length=1
modbus:serial.dfckminuti.type=holding

#DFCK - DATA
modbus:serial.dfckdata.connection=COM1:19200:8:none:1:rtu
modbus:serial.dfckdata.id=1
modbus:serial.dfckdata.start=643
modbus:serial.dfckdata.length=1
modbus:serial.dfckdata.type=holding

#DFCK - MESE
modbus:serial.dfckmese.connection=COM1:19200:8:none:1:rtu
modbus:serial.dfckmese.id=1
modbus:serial.dfckmese.start=644
modbus:serial.dfckmese.length=1
modbus:serial.dfckmese.type=holding

#DFCK - ANNO
modbus:serial.dfckanno.connection=COM1:19200:8:none:1:rtu
modbus:serial.dfckanno.id=1
modbus:serial.dfckanno.start=645
modbus:serial.dfckanno.length=1
modbus:serial.dfckanno.type=holding

#rules

rule "Giorno/Mese/Anno changed"
when
Item DATA changed
or Item MESE changed
or Item ANNO changed
then
Data_Mese_Anno.postUpdate(DATA.state.toString + “/” + MESE.state.toString + “/” + ANNO.state.toString)
end

rule "Ora/Minuti changed"
when
Item ORA changed
or Item MINUTI changed
then
Ora_Minuti.postUpdate(ORA.state.toString + “:” + MINUTI.state.toString)
end

#items

Number GIORNO “Giorno [MAP(giorno.map):%s]” (Statobus) { modbus = “dfckgiorno:0” }

Number DecimalType
Number ORA “Ora [%s]” (Statobus) { modbus = “dfckora:0” }
Number MINUTI “Minuti [%s]” (Statobus) { modbus = “dfckminuti:0” }

Number DATA “Data [%s]” (Statobus) { modbus = “dfckdata:0” }
Number MESE “Mese [%s]” (Statobus) { modbus = “dfckmese:0” }
Number ANNO “Anno [%s]” (Statobus) { modbus = “dfckanno:0” }

String Ora_Minuti “Ora / Minuti [%s]” (Statobus)
String Data_Mese_Anno “Data / Mese / Anno [%s]” (Statobus)

#Sitemap

Group item=Statobus label="Stato Impianto BUS" icon="keyring"

thank you for the help answers

Hi!

Can you please format your code according to instructions here: Auto highlighting/formatting on code blocks in posts

I notice you have a bit wrong quotes in your post. It should look like this

# config comment
this is code
inside backtics

I can see the data on the same line but with incorrect values.

Based on your description it sounds like the values do not come out correctly?

I recommend you first ensure that date/time components (DATA, MESE, ANNO, ORA, MINUTI) come out correctly from Modbus, and then look how to combine them to the same row. You can introduce the individual components to the sitemap.

What values do you get? What do you expect to have?

As always, please provide verbose logs, openHAB version, binding version etc.

Best,
Sami

Hello…
OH version 1.8.3
Binding Modbus 1.11.0

Here are the values ​​displayed on the clock display:
Day of the week: Tuesday
Time: 9
Minutes: 42
Day: 02
Month: 01
Year: 18

the values ​​displayed in OH are:
Day of the week: Tuesday
Time: 9
Minutes: 66
Day: 02
Month: 01
Year: 24

The Merge Now + Minutes and Day + Month + Year items return the same values ​​as the individual Items

I tried to change the format
Items from:% s to% x

Here are the values ​​displayed on the clock display:
Day of the week: Tuesday
Now: 10
Minutes: 12
Day: 02
Month: 01
Year: 18

the values ​​displayed in OH are:
Day of the week: Tuesday
Now: 10
Minutes: 12
Day: 02
Month: 01
Year: 18

but the Merge Now + Minutes and Day + Month + Year items return “Err”

I think that the correct format of the Items is:% s

As requested originally, check out the logs – they should be your starting point to diagnose errors.

File events log:

2018-01-03 21:16:30 - ANNO state updated to 24
2018-01-03 21:16:30 - MINUTI state updated to 23
2018-01-03 21:16:31 - ORA state updated to 33
2018-01-03 21:16:31 - DATA state updated to 3
2018-01-03 21:16:31 - MESE state updated to 1
2018-01-03 21:16:31 - GIORNO state updated to 3
2018-01-03 21:17:06 - ORA state updated to 32
2018-01-03 21:17:07 - Ora_Minuti state updated to 32:23
2018-01-03 21:17:12 - DATA state updated to 4
2018-01-03 21:17:12 - Data_Mese_Anno state updated to 4/1/24

DFTS_23MUK.pdf (143.1 KB)

DFCK module clock:

640 Day of the Week Beginning of the Date and Time Map of the DFCK Bus Module (Note 6)
641 Hour (Note 6)
642 Minutes (Note 6)
643 Dates (Note 6)
644 Month (Note 6)
645 Year (Note 6)

Pag 6 e) note 6) page 7

the openhab.log file is too large

I am sorry I do not see any “Err”. Everything works as expected?

apparently.
the data displayed is not correct

I recommend you verify this with other modbus reader, just in case. One example is modpoll. Nothing can be done if the data is such in when read with Modbus.

I recommend learning handling log files, cleaning out large log files, compressing them etc.

It’s almost impossible for anyone to help you otherwise in case of errors. In this case it seems there are no errors after all, just unexpected data.

I have tried with modpol and the data are the ones reporting openhab.

always with modpol I can activate the relays simply by pointing the word and modifying the single bit

What relays? I think you are now mixing up threads? Was this response to Modbus config thread?

If the data matches with openHAB – I’m sorry, the binding works as it should then. Can you contact device manufacturer for support?

I ran the 2 tests in modpoll and gave you the 2 answers

I contacted the manufacturer and the answer was:
standard modbus protocol.
read the instructions (which I attached in previous posts)

however I used this product with other video terminals and I have not encountered all these problems.

I set the communication driver and work with the word and bit

I’m completely confused what you refer with “2 answers”… I’m sorry but I think you need to recap the whole situation from the ground up, and explain your issue.

now I am attaching the test screens with Modbuspoll reading module DFCK clock
from word 640 to 645