11-18-2025 04:14 PM
I'm adding some Modbus devices to an existing project using the NI Modbus Library. I'm trying to use the In Place Element Structure, but having trouble creating a Data Value Reference for the Modbus instance. Why would I not be able to create a DVR for this particular kind of object? It works ok for the Serial Slave object, but not a Serial Master or TCP Master.
I'm working in LabVIEW 2019, because this is an older cRIO processor.
Solved! Go to Solution.
11-18-2025 06:43 PM
Why you want to use DVR? The modbus instance refnum is already an address refnum.
11-19-2025 12:41 AM
@eaolson wrote:
Why would I not be able to create a DVR for this particular kind of object?
If you open the error window and look at the details for that error, you will see the following:
This class or an ancestor class has restricted the creation and deletion of data value references to the class. You must call a member VI in order to obtain or delete a reference or change the properties of this class.
If you go and look at the class properties, you will see that there's a checkbox in the Inheritance page which restricts creation of DVRs of the class. You can read the help there to see more details about what this is about.
I don't know why this was checked in this specific class, but that's your answer.
11-19-2025 12:58 PM
Hi eaolson,
A workaround could be to bundle your object in a cluster:
Note: I have the Modbus library installed with the RT Module, not the VIPM one, but they both have the same issue.
The downside is that you won't be able to wire the DVR directly to a property node, which is the case when the DVR contains the object directly.
Regards,
Raphaël.
11-19-2025 03:03 PM
If you go and look at the class properties, you will see that there's a checkbox in the Inheritance page which restricts creation of DVRs of the class. You can read the help there to see more details about what this is about.
You're right, that's exactly why. Not sure why it's like that, but it is.
11-20-2025 10:19 PM
I've often wondered why this checkbox exists, when it is so easily bypassed with the cluster trick.
11-23-2025 05:12 AM
@avogadro5 wrote:
I've often wondered why this checkbox exists, when it is so easily bypassed with the cluster trick.
Looks like NI was aware of it, so I guess it's mainly a matter of placing a hurdle, not preventing this entirely. I agree that this doesn't make much sense if the goal was to allow the developer of the class to force the initialization of the object in the DVR, but I can't say I thought too deeply about it. I personally wasn't aware of the cluster trick and don't think I ever had the need for it.