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.
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.
08-13-2020 07:48 AM - edited 08-13-2020 08:13 AM
Is this the correct way to read register values if they are located separated by more than 125 registers? Some values that I want to read are in the first 125 registers but some start from 600.
This seems to work but sometimes I get the error 528193 and then I have to restart the VI for it to work again, so I am not sure if this is right or wrong.
https://github.com/LabVIEW-DCAF/ModbusModules/issues/68
This is how the register table looks:
08-13-2020 07:59 AM
Break it down into 2 different reads.
08-13-2020 08:10 AM
@RavensFan wrote:
Break it down into 2 different reads.
Could you please elaborate? Two different reads in the sense that I create new TCP Master and read the values or?
08-13-2020 10:05 AM
Actually, looking more closely at the image you attached, they appear so small that sometimes it is hard to see, you already did exactly what you should do.
I'm not familiar with that error code 538193 (or 528193 which you stated in your message). So I don't know what would cause that.
If you get that error, then you can do some error handling. No need to stop and restart the VI. Put your light blue reference wire on a shift register. In the error case of a case structure, close the existing reference and open a new Modbus Master. The new reference number will be carried to later iterations of the while loop via the shift register.
08-17-2020 08:50 AM - edited 08-17-2020 08:50 AM
If you get that error, then you can do some error handling. No need to stop and restart the VI. Put your light blue reference wire on a shift register. In the error case of a case structure, close the existing reference and open a new Modbus Master. The new reference number will be carried to later iterations of the while loop via the shift register.
I don't see any option to close reference in NI Modbus library.
Do you mean something like this? I tried this way, but I am getting some errors.
TCP: Connect in TCP Master.lvclass:Initialize Master.vi->Modbus Master.lvclass:Initialize.vi->API Main.lvlib:Create TCP Master.vi->Unnamed 1.vi
08-17-2020 12:00 PM
Yes. That is what I was thinking.
Are you getting the same errors or different errors?
Have you figured out what your original error means?
08-18-2020 10:40 PM
You can do as per this. Multiple read
08-18-2020 11:21 PM - edited 08-18-2020 11:31 PM
@PBP wrote:
You can do as per this. Multiple read
I will try this out today. What is the function of Set Unit ID.vi? I thought entering starting address and number of inputs would be enough to read the register values.
(oops replied from my other account that i created recently)
08-18-2020 11:33 PM - edited 08-18-2020 11:34 PM
Set Unit ID is more commonly used for serial based Modbus. You use that to set tell LabVIEW what is the slave address of the device you want to communicate with. It really should have a constant wired into it.
For Modbus TCP/IP, it usually isn't used because the IP address defines the device you are talking with. Occasionally you might need to use it. For example, an ethernet Modbus to serial modbus converter might have several different serial devices that are connected to the device and would thus all share the same IP address, but would have different "Unit ID's" or slave addresses on them.
For your situation, I don't think you'll need to use that function.
That said, I don't see how PBP's message adds anything to this message thread. It just reiterates previous messages.
08-18-2020 11:39 PM - edited 08-18-2020 11:59 PM
Set Unit ID is only applicable if you have multiple device connected or you can omit it. I have intentionally Unit ID is not wired as i don't know what is your MODBUS network configuration.
Check attached VI where connection is reopened if error is generated.