LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

RELAY CONTROL WITH MODBUS USING LABVIEW

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. 

IMG_20200127_125415.jpg

IMG_20200127_125436.jpg

 

 

Relays board: http://www.canton-electronics.com/mcu-relay-controller-c-53/uart-relay-modules-c-53_54/8-channel-dc-...

 

 

0 Kudos
Message 1 of 6
(3,501 Views)

From the images I see a USB converter to RS485. In this case you'd need to just sends commands over VISA in LV. 

0 Kudos
Message 2 of 6
(2,970 Views)

LabVIEW has some Modbus libraries you can use.  If they are not built in, then you can find the downloads on ni.com.

0 Kudos
Message 3 of 6
(2,955 Views)

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!

---------------------------------------------
Former Certified LabVIEW Developer (CLD)
0 Kudos
Message 4 of 6
(2,943 Views)

Downloading a NI driver called MODBUS we can program these relay channels

0 Kudos
Message 5 of 6
(220 Views)

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

 

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 6 of 6
(200 Views)