LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

MODBUS RTU how to skip error read

Solved!
Go to solution

Hi,

 

i have problem, how to skip when the communication error if i use Modbus Library ? i wanna this measurement smoothly without any errors on the chart.

watch this video i record my problem:

https://drive.google.com/file/d/0B_94Z4CwsTYeWEJpZUx2cVJ0a2c/edit?usp=sharing

i tried to mod on MB Serial Master Query Read Input Register.vi by using Case Structure on Error. see that video and still didnt work. any suggestion ?

 

Thanks~

0 Kudos
Message 1 of 5
(3,481 Views)
Solution
Accepted by topic author rhiesnand

You put the error case structure in the wrong VI.

 

Put it in the main VI, and the chart inside the no error case.

 

When you have it in the subVI, the subVI always has to return something.  So it either returns your data when there isn't an error because you put the indicator in the No Error Case.  Or if there is an error, it returns the default data for the indicator because you aren't writing any data to it.

0 Kudos
Message 2 of 5
(3,476 Views)

Hi Ravens,

 

Thank you it work perfect ! !

 

CVM.jpg

 

 

 

i wanna ask again this is my last question,

on that program i request 10 register to be read, its need 2 register per variabel (such as volt,ampere,watt,kVar,cosphi) so i need 10 register to read 5 variable,  how to extract it so i can read 5 variable ?

 

Thanks~

0 Kudos
Message 3 of 5
(3,457 Views)

There are a couple of ways to do it.  Here is one I've used.  Decimate the array into to parts, then Join the numbers to turn the two U16 numbers into an U32 number.  You may need to cross the wires going into the Join Numbers function depending on the endianess of the registers, whether the most significant word (U16) comes first or the least significant word comes first.  An advantage of this is thatthe Join Numbers function works on arrays as well.

 

 

Message 4 of 5
(3,422 Views)

Hi Ravens,

 

Thank you very much ! it's work perfect on my project !

 

Thanks~

0 Kudos
Message 5 of 5
(3,393 Views)