Hello Marko,
that’s exactly what I was looking for. As usual you are a genius. THANK YOU!!!
As Artisan evaluates its arguments you can make use of
Python to compute the 16-bit two-complement from your original value -252 using
bit-shifting like this
write(1,27,-252 & 0xFFFF)
Not sure if this works for you as expected. Note that I make some assumptions above on
the interpretation of those unsigned 16bit register values and the decimal handling by the
device which could be wrong.
I will test this tomorrow and see if it works. But It seems to be the most logical
approach.
I stopped writing the email and just went to replug everything as otherwise I probably
would have dreamt about it.
It works.
Now, sleep.
And next step will be to start the magic (or nightmare.. will see) of P-I-D optimisation.
As you said, it’s an art. And I am no master at it yet. ;-)
Nico
> On 10 Nov 2020, at 22:30, Marko Luther <marko.luther(a)gmx.net> wrote:
>
> Nico,
>
> MODBUS holding registers values are by specification 16bit unsigned integers (0 to
65535). Vendors may use non-standard encoding to fit signed integers (−32768 to 32767) in
those registers. After all is a matter of interpretation of the bit vectors. Often
two-complements are used.
>
> I assume you use a custom button with a MODBUS Command like the following
>
> write(1,27,<value>)
>
> to write the <value> into the Proportional reset rSt register 27 (001BH) on
slave 1.
>
> If I interpret the device specification you linked correctly, the values can have one
decimal or zero decimal (maybe this depends on the device setup). Let's assume we have
one decimal thus valid values from -30.0 to 30.0. Decimals are usually transported by
multiplication. Thus the (signed-)integer range is -300 to 300.
>
> Let's assume you want to set the rSt to -25.2, thus you have to write -252 into
register 27. The corresponding two-complement unsigned integer of -252 is 65284. So you
could use the command
>
> write(1,27,65284)
>
As Artisan evaluates its arguments you can make use of
Python to compute the 16-bit two-complement from your original value -252 using
bit-shifting like this
write(1,27,-252 & 0xFFFF)
Not sure if this works for you as expected. Note that I make some assumptions above on
the interpretation of those unsigned 16bit register values and the decimal handling by the
device which could be wrong.
>
> Stay safe,
> Marko
>
>> On 10. Nov 2020, at 21:22, Nico Bigler via Artisan-User
<artisan-user(a)lists.einfachkaffee.de> wrote:
>>
>> Hello Brett,
>>
>> thank you for your response,
>>
>> The reason of wanting to edit such parameters may sound silly but it’s for my
personal confort ;-) I’ll explain.
>>
>> I am just changing the PID on my roaster as the one that came on it could not be
controlled. It’s been on my to-do list for a coule of years and I finally starting this.
>>
>> As I am not a PID guru, it will probably take me a lot of time (too much) to do
the magic of fine tuning the P-I-D.
>>
>> My main “problem” is that my roaster is setup in my shed outside. As we are
getting close to winter it is starting to be painfully cold when spending hours out there
at night to try to adjust the beast.
>> So the best option when I work on tasks such as configuring the PID where I am
just looking at how much I can stabilise the temperature control, is to run the roaster
empty and use VNC to remote control Artisan from inside my house where it is nice and
warm.
>>
>> Back to the value I want to change:
>> Other than the standard P-I-D values, I can also tune some other parameters
(which may get useful in optimising the results) such as the Proportional Reset (rSt)
which has a range of -199 to 200 (Full list in this file 192.pdf)
>> <PastedGraphic-3.png>
>>
>> I would like to have a few buttons with different values and be able to set them
remotely.
>>
>> The Modbus command list for the MaxWell MTA is available at
https://www.maxwell-fa.com/upload/files/base/5/r/208.pdf
>>
>> I hope that my question makes more sense now.
>>
>> Nico
>>
>>
>>> On 10 Nov 2020, at 21:04, Brett Pound <brett_pound(a)hotmail.com> wrote:
>>>
>>> Hi Niko,
>>>
>>> I don’t know whether this is possible or not, others will see this and
respond, but can I ask why you’re trying to do this – what are you trying to achieve ? You
mention "a range”, do you mean you need multiple buttons, one for say -5 and one at
-15? I think understanding what you’re trying to do will greatly help relevant
suggestions about how you can achieve that.
>>>
>>>
>>> From: Nico Bigler via Artisan-User
>>> Sent: Wednesday, 11 November 2020 6:50 AM
>>> To: Artisan Mailing List
>>> Subject: [Artisan-user] Question on Modbus with negative values
>>>
>>> Hello list,
>>>
>>> I would like, if possible, to be able to change some of the settings in my
PID configuration using buttons in Artisan.
>>> I am using a MaxWell MTA communicating via Modbus.
>>>
>>> Here is my question:
>>> Some of the PID configuration I would like to control with a button cover a
range from negative values (the value range for this parameter is from -199 to 200, and I
want to select a value in my case at -5).
>>> How can I send a Modbus negative value?
>>> write(5,27,negative value here)
>>> Any idea? Is it possible? I tried to search but no luck so far.
>>>
>>> My Modbus config:
>>> <298D8F0961014487A9F3C42F9CA4A237.png>
>>>
>>> What I was trying to do (but does not work when I use a negative value:
>>> <DFE515E2BC8F40358CAAFA55BE6AB040.png>
>>>
>>>
>>> Nico
>>
>> _______________________________________________
>> Artisan-User mailing list -- artisan-user(a)lists.einfachkaffee.de
>> To unsubscribe send an email to artisan-user-leave(a)lists.einfachkaffee.de
>> unsubscribe via
https://mailman.ghostdub.de/postorius/lists/artisan-user.lists.einfachkaffe…
>