01-27-2020 05:04 AM
Hello friends,
We are trying to control a relays board (R421A08) with LabView using a Modbus (RS485).
We are beginners with LabView, so we would appreciate if someone gives us some information about how to design the LabView schematic.
We just want to close and open the different relays using RTU connection.
We also attach two pictures with a close view of how we have connected the Modbus with the relays boards.
Relays board: http://www.canton-electronics.com/mcu-relay-controller-c-53/uart-relay-modules-c-53_54/8-channel-dc-...
05-15-2020 09:10 AM
From the images I see a USB converter to RS485. In this case you'd need to just sends commands over VISA in LV.
05-15-2020 01:19 PM
LabVIEW has some Modbus libraries you can use. If they are not built in, then you can find the downloads on ni.com.
05-15-2020 02:43 PM
Unfortunately, there doesn't appears to be an on-line manual. The website does mention :
- "open" "close" "Momentary" "Self-locking" "Interlock" "Delay" 6 Commands
I would avoid using Modbus if simple RS485 command would work (one less layer of SW)
As for the LabVIEW code (not schematic), as Gevor mentioned, use VISA commands to open a COM port and issue the commands above.
Again, I really hope you have a printed manual as the open and close command obviously need some parameters to indicate which relays you want to operate.
Good luck!
02-28-2025 05:51 AM
Downloading a NI driver called MODBUS we can program these relay channels
02-28-2025 01:23 PM - edited 02-28-2025 01:28 PM
I suggest you do some reading on Modbus as there are some Modbus specific terminology you need to understand. https://modbus.org/
For instance to get a measurement from a Modbus device you read one or more registers. To change settings or other parameters of the device your write a register. To open or close relays you write to a "coil" to check the status of a relay you read a coil. Your modbus device should come with a register map that gives you all the register and coil addresses, scaling factors, etc.
Don't get hung up on the Modbus communication protocol or try to use VISA to do it yourself.
The LabVIEW Modbus API takes care of all that as an abstraction layer. You can install the Modbus API through VIPM or from the link I provided.
The LabVIEW Modbus API discussion thread is a good place to get specific questions about the Modbus API answered