01-31-2017 10:46 AM
With Modbus, the master (client) sends out requests and the slave (server) responds to these requests. The slave API is provided to implement a modbus slave. When you use the read multiple coils VI on the modbus slave wire, it just returns the values of the coils from its intermal data model. No network communication is initiated.
02-01-2017 05:15 AM
hi
i have understood very clearlyi have encountered problem while doing an experiment yesterday i tried to connect two plc which gives data by Rs-485 from RJ45 port i have used multiplex a data from two plc to one.I have used Used RS 485 to USB converter to get the data the following code to get coil data from communication,the problem i only get right answer when i enable highlight execution else the program is responding with error 56 please help to fix this
02-01-2017 09:43 AM - edited 02-01-2017 09:43 AM
As far as I know, this Modbus library doesn't do anything to protect the serial port from simultaneous access. Therefore, when you are trying to communicate with more than one slave on the same COM port in parallel, they will conflict with each other. To avoid this, you can use one modbus master wire and use the Unit ID property node to specify which slave to communicate with. You then alternate between the two slaves in sequence. See "modbus serial two devices same com_fixed.vi" attached.
Alternatively, you could use semaphores to protect the COM port from simultaneous access. The Plasmionique Modbus Master library has this functionality built-in. You can download the latest version of the library here: https://lavag.org/files/file/286-plasmionique-modbus-master/
See "modbus serial two devices same com_plasmionique.vi" attached.
02-01-2017 12:37 PM
Hi
I use a similar installation and your program generate exactly the same result. For simultaneous access on the same port I use Plasmionique-modus-master library without problem.
02-01-2017 11:42 PM - edited 02-02-2017 02:24 AM
The program is working fine but the thing is I would like to know is that
#this plasmionique library is a free library or not
# the link of plasmionique library does not match because i use labview 12 would you please send a link for 12 version
thanks
02-02-2017 10:38 AM - edited 02-02-2017 10:39 AM
LabVIEW 2012 versions attached.
Plasmionique Modbus Master is a free and open source library.
02-03-2017 05:24 AM
hi porter
I tried installing plasmionique library but my Vi package manager says that is not compatible with my software what should i do now
02-03-2017 10:10 AM
You probably need to update VI package manager. The library's package was built using VI package manager 2014.
02-03-2017 10:37 AM
Hi,
You can also use NI library.
You must only avoid to read slave 1 and slave 2 at the same time.
I modified your last program and test it on my installation; it works fine.
The code is not nice, but it is only to show you where is the problem.
02-14-2017 12:37 PM - edited 02-14-2017 12:38 PM
Hi,
Is it possible to get the raw modbus response packet from the device after sending a write request using this protocol? The basic problem I am trying to solve is as follows:
I want to check that a particular modbus slave is responding with the correct modbus exception code when I send a wrong query (Example: I send a PDU with an illegal address from the master). When using the write functions in the API, only feedback I have when something is not right is through the error out of the write VI. Is there any way of getting to the raw reply PDU from the slave? or is there a one to one correspondence between the exception errors defined in the modbus standard and the LabVIEW error codes?
Thanks and Regards,
Supreeth