S7-in scaling and MinConnect reading issue

Hi all,

I have a Logo PLC and I'm sending temperature data, collected from a sensor, to MindSphere using the MindConnect node.

Recently, I have made adjustments on Soft Comfort in order to have the temp. with a one decimal place ( it used to be 24, 25, etc., and now is 24.1, 24.2, etc.). I can see the data on the PLC perfectly fine with the AX Amplified selected. However, when it comes to Node-RED, I'm having the data multiplied to 10 (like 241, 242, etc.).
When I try to fix it using a simple function, the MindConnect gives an error saying:

"Error: Data doesn't match the configuration! Errors: [{"keyword":"str_integer","dataPath":".value","schemaPath":"#/items/select","params":{"keyword":"str_integer"},"message":"should pass "str_integer" keyword validation"}]"

I'm a beginner. Can anyone help me out, please?

I know nothing about Logo or mindconnect - but the error message would indicate that now you have divided the 241 by 10 to get 24.1 that it is no longer an integer... and the keyword seems to say that it should be a str_integer... so either you need to round the number to an integer or somehow change the type to expect a float instead.

1 Like

Thanks for your help.

Yes, it is INT and I cannot divide it by 10. I am wondering how I can convert it to REAL or FLOAT?

That sounds like a question for the author of the mindconnect node

I've just realised that <toFixed()> converts INT to FLOAT itself. So I've just used it and divide it by 10.

No it doesn't, it converts a number to a string, which is not of number type at all.

There is only one number type in javascript, which may contain a whole number or a number with a fractional part. There is no difference in javascript between int and float, except that one happens to be a whole number.

Edit: Actually that is not true, there is also now the BigInt type which can represent whole numbers larger than 2^53 - 1, the limit of the Number type.