Повідомлення створено: 24. 02. 2017 [22:11]
|
cvillegas
Claudio Villegas
Автор теми
Зареєстрован(а) с: 26.10.2016
Повідомлення: 14
|
Dear Roman
I have tried to find a way to solve a need to perform a conditional polling of certain MODBUS registers, to be executed only when a certain flag (coil) has a value of 1, since it represents the alarm state and a series of registers deliver the related information .
The data link is very precarious and the option of maintaining constant polling of the records is not feasible.
I found the "messIO ()" function that allows to send PDU's through the associated Transport, so I am trying to make a program using this messIO () function to send a modbus PDU with the records query only when the flag is in 1 , Which I have achieved without problems, but the complex is that the response is also a PDU which must be interpreted according to the MODBUS protocol.
From here I have the following queries, that you would like to answer me:
Is there any other way to do the MODBUS queries conditionally, this, without it being associated with the sheduler of the controller?
As the messio () response delivers a PDU in hexadecimal format, I would need to convert the values to their human representation (float, string, int, etc), but I have not found a function that allows me, for example, to convert the hex into float (Eg: 0x4022c3ca -> 2.5432).
Obviously within the Openscada these conversions are usually done so it seems logical that this function is available.
I appreciate your response.
Best regards
Claudio Villegas.
|
Повідомлення створено: 25. 02. 2017 [20:01]
|
roman
Roman Savochenko
Moderator Contributor Developer
Зареєстрован(а) с: 12.12.2007
Повідомлення: 3750
|
"cvillegas" wrote:
Dear Roman
Don't address to me directly in the forum!
"cvillegas" wrote:
I have tried to find a way to solve a need to perform a conditional polling of certain MODBUS registers, to be executed only when a certain flag (coil) has a value of 1, since it represents the alarm state and a series of registers deliver the related information .
The data link is very precarious and the option of maintaining constant polling of the records is not feasible.
Do that into the Logical parameter type of the DAQ.ModBus module in the conditional processing way but not in polling one.
"cvillegas" wrote:
Is there any other way to do the MODBUS queries conditionally, this, without it being associated with the sheduler of the controller?
A conditional queries aren't typical to real time of data acquisition systems at all and they aren't needed mostly, see in the top!
"cvillegas" wrote:
As the messio () response delivers a PDU in hexadecimal format, I would need to convert the values to their human representation (float, string, int, etc), but I have not found a function that allows me, for example, to convert the hex into float (Eg: 0x4022c3ca -> 2.5432).
Obviously within the Openscada these conversions are usually done so it seems logical that this function is available.
Into the standard library of OpenSCADA you can see various examples for the like parsing ones.
Shortly. see to:
- floatMergeWord()
- Object IO
Learn, learn and learn better than work, work and work.
|