LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Writing to a holding register _ Tension controller MODBUS

Solved!
Go to solution

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.

Download All
0 Kudos
Message 1 of 17
(388 Views)

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.

Message 2 of 17
(385 Views)

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].

 

0 Kudos
Message 3 of 17
(344 Views)

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…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 17
(342 Views)

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.

henk1000_0-1720162727093.png

 

0 Kudos
Message 5 of 17
(335 Views)

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?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 17
(329 Views)

Hi,

No error from the device.

henk1000_1-1720164643591.png

The device allows 0 value.

henk1000_2-1720164688849.png

U32 float I guess.

0 Kudos
Message 7 of 17
(321 Views)

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?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 8 of 17
(310 Views)

Well, 0 SGL 00000000 00000000 00000000 00000000

two U16 : high 00000000 00000000

                low   00000000 00000000

0 should be 0 right?

0 Kudos
Message 9 of 17
(300 Views)

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?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 10 of 17
(296 Views)