LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

modbus tcp - receiving messages from slave

One more thing Raven, for the Modbus API Library provided by NI the output register value does not include the unit ID, function code and the byte count in this case? Normally this will be in a typical Modbus Message...

0 Kudos
Message 21 of 25
(68 Views)

@cyongjed wrote:

Ok thanks Raven got it, can I ask why did you use a for loop in this case?

So it can process each byte.

 


@cyongjed wrote:

One more thing Raven, for the Modbus API Library provided by NI the output register value does not include the unit ID, function code and the byte count in this case? Normally this will be in a typical Modbus Message...


What do you mean by it doesn't include?  It is in the message it sends to and the response it gets back from the device.  It is within the protocol.  Are you expecting it to be output from the VI's as well?  That wouldn't make sense because it would be more stuff you'd have to strip off to get to the data you are trying to read from the messages.

 

If you want to show, then you can get it from your inputs and concatenate it to the beginning of your output string.

0 Kudos
Message 22 of 25
(62 Views)

Hi Raven,

Sorry to bother the no of bytes count in the message and function code how do I link it from the input to form the message?

0 Kudos
Message 23 of 25
(44 Views)

I'd have to see a VI where you point out what you are asking.

 

But I don't think you need to worry about it at all.  If you use the NI Modbus library has it's designed, it takes care of reading the proper number of bytes for you!

0 Kudos
Message 24 of 25
(39 Views)

Thanks again Raven, appreciate the help given

0 Kudos
Message 25 of 25
(29 Views)