Page 1 of 2

App Developer/ SCADA Question

Posted: Wed Mar 03, 2021 12:49 pm
by steve001
Afternoon All,

Re The app developer / SCADA using Modbus RTU looking at integrating a Mains harmonic meter for a test application

The data formats are :

32-bit float format - bit float type data follows IEEE 754 format.
16 bit integer format - Byte sequence of data adopts big endian mode.
32 bit long integer format - Byte sequence of data adopts big end mode.

Dose the Modbus component cope with these or do i have to get creative and read registers and put them back together ? :?

Steve

Re: App Developer/ SCADA Question

Posted: Wed Mar 03, 2021 2:31 pm
by BenR
Hi Steve,

The Modbus components deal with single bits or 16-bit registers.

If you use the Type conversion component then this works with App Dev and Embedded and will efficiently convert between 16-bit and Long or Float values hopefully saving you some headaches.

Re: App Developer/ SCADA Question

Posted: Wed Mar 03, 2021 5:11 pm
by steve001
Hi Ben,

How do deal with the 32 bit registers ? - these are big endian and integers
These have caused big headaches and nightmares in the past

Steve

Re: App Developer/ SCADA Question

Posted: Thu Mar 04, 2021 11:22 am
by BenR
Hi Steve,

That should be fine.

Simply use two registers and use the type conversion component to convert your 32-bit value into the two 16-bit register values.

Then at the other end do the opposite take the two 16-bit register values and use the type conversion to convert back into a 32-bit value.

Also works for IEEE 754 floats.

Let us know if you have any problems or want an example putting together.

Re: App Developer/ SCADA Question

Posted: Thu Mar 04, 2021 7:19 pm
by steve001
Hi Ben,

Are there any examples on implementing a Modbus Master system for the app developer ?
The ones i have found use Nano as the master i would like to use a pc or laptop.

On having a play tonight - is it possible to be able to set the coms port parameters via the app you are developing - as your device may not be on that particular com port or may have different addresses (i may have got this wrong as i am am still finding my feet with the SCADA)

Could i take you up on your offer of an example for a convertor as i wasn't sure where to start

using winbus to read L1 Volts

period 500
send 2 3 0x00 0x06 0x00 0x02

Date: 04/03/2021 18:45:28:877 Tx: 0x02 0x03 0x00 0x06 0x00 0x02 0x24 0x39
Date: 04/03/2021 18:45:29:378 Rx: 0x02 0x03 0x04 0x43 0x6D 0x05 0x1F 0x0F 0xF2

using - 43 6D 05 1F = 237.02

scadacore's online convertor confirmed that the value is correct

Steve

Re: App Developer/ SCADA Question

Posted: Sun May 16, 2021 1:42 pm
by steve001
Hi Ben,

Could you please put an example together for me ?
Can you put comments in also please so i know what is happening and why.

Looking to read L1 Volts for now :?

Regards

Steve

:Edit - my attempt added - didnt work, tried to follow an example i was looking at and modify it to suit.

Float Big endian result is correct

not sure how 240.49 was obtained as adding the results together in HEX, then converting back to DEC gives 415 (on a calculator)
and adding 43 70 & 7d 71 together in HEX, then converting back to DEC gives 49,377 (on a calculator)

Re: App Developer/ SCADA Question

Posted: Fri May 21, 2021 12:09 pm
by BenR
Hi Steve,

Try this and I'll keep my fingers crossed :D .
Modbus Test RI-F550 Read Voltage.fcsx
(15.82 KiB) Downloaded 709 times

Re: App Developer/ SCADA Question

Posted: Sat May 22, 2021 2:32 pm
by steve001
Hi Ben,

This is the result i get ?

Volts =245.7

Steve

Re: App Developer/ SCADA Question

Posted: Tue May 25, 2021 9:30 am
by BenR
Hi Steve,

If you look at the console window it should show you the data that is being received. We can then try ad figure out what isn't quite right. Maybe we aren't assembling the float quite correctly? the ints or bytes within the ints might need to be rearranged?

Re: App Developer/ SCADA Question

Posted: Tue May 25, 2021 11:36 am
by p.erasmus
Hi All,

To determine the problem here (as Ben indicated) we need to see the MODBUS device protocol for the Voltage data - lengh,byte order scaling factors these are all things the User of the Modus compoment needs to apply to get the correct value .

Steve to help you you need to supply these info's with out it we all will be chaseing our tails around something that we do not know.