07-04-2024 09:33 AM
Here I come again.
I have been trying to write a certain value in a register but it's not working.
Attached you can find the manual.
On page 4 it says I should write on register 142.
Perhaps I am setting it wrongly in Labview. First I read the value (register 296) after I try to write a different value but it does not work.
Thank you.
Solved! Go to Solution.
07-04-2024 09:39 AM
Hi,
Writing 2 registers (142 and 143) mean you should use an array of only 2 elements.
Starting address = 142
Holding register values = [0,0]
Currently, you're writing an array of 143 elements of value 0.
07-05-2024 01:43 AM
Hi PinguX,
I have changed it and still the value in the device remains the same. I have tried to write a setpoint value of 0 [0,0].
07-05-2024 01:47 AM
Hi Henk,
@henk1000 wrote:
I have tried to write a setpoint value of 0 [0,0].
Where do you try that?
The array control in your image shows an empty array…
07-05-2024 01:59 AM
I have been trying to write a value of 0 to the setpoint as a test. I tried 2 columns array and two rows array. No change in the device.
07-05-2024 02:21 AM - edited 07-05-2024 02:22 AM
Hi Henk,
@henk1000 wrote:
I tried 2 columns array and two rows array.
A 1D array has no "columns" or "rows", it only has "elements". (Rows or columns are just display cosmetics!)
@henk1000 wrote:
I have been trying to write a value of 0 to the setpoint as a test. … No change in the device.
Do you get any error from ModbusWrite function?
Is the value 0 allowed for that register?
Which data format does your device expect for the value in those 2 registers? Does it expect a SGL float value or an U32 integer value?
07-05-2024 02:32 AM
Hi,
No error from the device.
The device allows 0 value.
U32 float I guess.
07-05-2024 03:08 AM - edited 07-05-2024 03:11 AM
Hi Henk,
@henk1000 wrote:
U32 float I guess.
There is no "U32 float" - and there is no need to guess!
The manual clearly says "float", which is a SGL in LabVIEW!
Yesterday I explained TO YOU how to convert two U16 values into a SGL value, now you fail in converting a SGL value into two U16 values?
07-05-2024 03:23 AM
Well, 0 SGL 00000000 00000000 00000000 00000000
two U16 : high 00000000 00000000
low 00000000 00000000
0 should be 0 right?
07-05-2024 03:33 AM
Hi Henk,
@henk1000 wrote:
0 should be 0 right?
Yes, in this very specific case you are right.
But in any other case you are not - despite explaining the concept just yesterday…
Do you have other software where you can verify your device does accept the zero value for this register?