From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Error Out 538179 using Modbus RTU

Solved!
Go to solution

Hi all i have a code that uses  a state machine to acquire values from two different Modbus slave devices with different Unit ID (ADAM-4017 Analog Input devices) using Modbus RTU and also using the Official  LabVIEW Library VIs. I  am able to acquire the values but i receive this error out code of 538179. Any idea on how to resolve this issue? 

Download All
0 Kudos
Message 1 of 8
(4,123 Views)
Solution
Accepted by topic author edmund99

One thing I see in your block diagram is that you failed to wire your blue reference wire through all of the cases.  And because you made the mistake of using a tunnel set to "Use Default if Unwired", the VI will have an unbroken run arrow, but you'll get run-time errors when your code acts on an empty default reference.

 

Uncheck "Use Default if Unwired" on all your tunnels.  Wire across all the case structures that are missing reference wires.

Try again.

Message 2 of 8
(4,115 Views)

Hi RavensFan thanks for your suggestion . It solved my problem and does not return any error in the error out!

0 Kudos
Message 3 of 8
(4,097 Views)

@edmund99 wrote:

Hi all i have a code that uses  a state machine to acquire values from two different Modbus slave devices with different Unit ID (ADAM-4017 Analog Input devices) using Modbus RTU and also using the Official  LabVIEW Library VIs. I  am able to acquire the values but i receive this error out code of 538179. Any idea on how to resolve this issue? 


1. May I know how to assign unit ID?

2. Is starting address means where we start to reading the address from Modbus module?

0 Kudos
Message 4 of 8
(4,089 Views)

Hi Sabari.

1)Are you using ADAM-4000 series device? If yes then you can change the Unit ID by installing the ADAM-4000 series utility application on your computer, hook up your ADAM device to the computer and change the Unit ID in that utilities application.

 

The device by itself has been factory configured to ADAM ASCII so if you want to use Modbus RTU follow the instructions in the ADAM-4000 series manual's Appendix H which states how to change the ADAM Device to Modbus RTU mode

 

http://advdownload.advantech.com/productfile/Downloadfile2/1-1NW8O4V/ADAM-4000_Series_User_manual_Ed...

 

 

2)Yes you are right the starting address means which Modbus address we want to start reading from

 

0 Kudos
Message 5 of 8
(4,042 Views)

1.  Dig down into the palettes.  You'll see a sub VI called "Set Unit ID".

2.  The starting address is the first register you want to read in a group from the device.  Note that if it is the full address listed like 400101, you'll drop the 4 and subtract 1.  So it would be address 100.  (The naming of registers in manuals is usually 1-based and has the prefix, but in LabVIEW and the actual message sent, it is 0-based and does not include the prefix.)

0 Kudos
Message 6 of 8
(4,073 Views)

Hi Sabari 

1) Are you also using ADAM-4000 series device? If you are then you can manually change the Unit ID of the ADAM device through a desktop application called ADAM- 4000 series utility which would allow you to change the Unit ID, serial settings & also view the live data of all your AI/AO/DI/DO ports of your ADAM device. Connect your ADAM device to any PC with the utility app installed .

 

If you just bought the device i would suggest you take a look at the ADAM 4000 series manual's Appendix H. It is stated there that by factory default the ADAM devices are configured to "ADAM ASCII" mode and in Appendix H it will show you how to change from "ADAM ASCII" to "Modbus RTU"

 

2) Yes starting address is the Modbus address which you want to start reading from.

0 Kudos
Message 7 of 8
(4,067 Views)

Thank you! @RavensFan and @edmund99

0 Kudos
Message 8 of 8
(4,048 Views)