05-26-2019 11:17 PM
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?
Solved! Go to Solution.
05-26-2019 11:33 PM
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.
05-27-2019 01:20 AM
Hi RavensFan thanks for your suggestion . It solved my problem and does not return any error in the error out!
05-27-2019 03:45 AM
@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?
05-27-2019 07:57 AM
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
2)Yes you are right the starting address means which Modbus address we want to start reading from
05-27-2019 10:14 AM
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.)
05-27-2019 11:17 AM
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.
05-27-2019 11:45 PM
Thank you! @RavensFan and @edmund99