LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

I/O server modbus frame error in UINT16

Hello,

I created a project in which I have inserted a Modbus serial I / O server to control a analyzer.

 

I need to create a bound variable to write the Holding register 226 0xDEAD word (16 bits) , the function of writing in this register the word it is to produce a reset in the analyzer.

 

When I declare the bound variable as Uint16 the VI generates the following frame :

 

1B 10 00 E2 00 01 DE AD 20 BE

 

In the frame we can see that is not the byte count after the register to write (0001) , so the analyzer is not reset.

 

When I declare the bound variable as Uint32 the VI generates the following frame :

 

1B 10 00 E2 00 02 04 DE AD 00 00 A2 EF

 

in the frame we can see that the byte count  is generated  ( in red ) and the analyzer has been reset , but I had to write two registers instead of one .


Why when declare uint32 Byte count is generated and when declared Uint16 the byte count is not generated ?

 

 

 

Thanks in advance and sorry for my english..... i only speak a bit.

Programa.jpg

0 Kudos
Message 1 of 3
(2,596 Views)
Where is the code that shows where the command frame is being generated? That is where the trouble looks to be.

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 2 of 3
(2,560 Views)

Hello Mike and thanks for your interest.

 

The code is in the image, the programa.vi ( top right), shows you how is the program, in the picture you can see on the left the Modbus serial I/O server , in the top right the programa.vi with constant " Valor de reset" ( 0xDEAD-->57005) connected to the Bound variable Uint32 " D400227 " . In the case of the image the frame is generated by the I / O serial Modbus with the Byte count , but if change the Bound variable " D400227 "  to Uint16 (which is what I need) , the I / O serial Modbus server generates the frame without the Byte Count.

 

 

Best regards.

0 Kudos
Message 3 of 3
(2,543 Views)