NISystemsEngineering / LabVIEW-Modbus-API

66 stars 38 forks source link

Exposes the listening net address on New TCP Slave #14

Open MathieuR-Iolas opened 1 year ago

MathieuR-Iolas commented 1 year ago

Hello,

I'm working on a project in wich I have to emulate several TCP slaves. And I am wondering how to get this using the LabVIEW-Modbus-Library, because I didn't find any way to specify a network interface (or address) when instanciating a new TCP slave.

I just discover that it is possible on TCP Create Listener function to specify a net address. Fine, it should be the way to have independant multiple slaves !

I finally reach this GitHub repo, then the issues, including the #6 mentionning the password applyed when building the package (with a pro version of VIPM). So diving into the code using this password, I reach the diagram of TCP Slave.lvclass:Create Listener.vi

TCP Slave lvclass_Create Listener vi

Nice! So this functionnality is already implemented. The only missing entry point is a way to set the value of listening net address when creating a new TCP slave. I guess it could be an optional terminal on the Create TCP Slave.vi connector:

Create TCP Slave (modified)

I don't have a 2014 LV config at this time. I'll try to find a moment to set up one, in order to implement this (implementation shouldn't be long, compared to to the LV setup time)

MathieuR-Iolas commented 1 year ago

Note that a quick workarround is to duplicate the Create TCP Slave.vi to have a custom one. I didn't get any issue doing so: none of the VIs called in Create TCP Slave.vi are in private or protected scope.