Our offices will be closed Saturday December 23rd through January 1st for the Holidays. Dismiss

LabVIEW Relay controller Basic Configuration

In this LabVIEW Relay controller Basic Configuration manual we will learn how to automatically and manually refresh the relays, how to set and relay relay bank, set and read default relay state.

A) Automatic vs Manual Refresh

This example illustrates how to Disable Automatic refreshing and refresh Relays Manually.

Related Example in Driver: Relay Refreshing.vi

It works as follows,

  1. Turns OFF automatic refreshing
  2. Reads back Refreshing Status to verify.
  3. Turns on Relay 2 and 3 in Bank 1, then waits 5 seconds
  4. Manually Refreshes Relays, again waits 5 seconds
  5. Turns on Automatic Relay Refreshing
  6. Turns Off Relay 2 and 3 in Bank 1 in automatic refreshing mode

This VI handles relay with Bank selection.

VIs Required:

–> Initialize (Main Palette)

–> Set Automatic Refreshing (Configuration Palette)

–> Relay On Off (Action Status->Selectable Bank Directed Palette)

–> Read Automatic Refreshing (Configuration Palette)

–> Manual Refresh (Action Status Palette)

–> Close (Main Palette)

Following figure shows the steps for this guide. Their detail follows the figure.

Details of steps is as under.

  1. Port is initialized in Initialize VI with fixed baud rate of 115200.
  2. Set Automatic Refreshing VI is placed and a false value is provided to on/off terminal to switch automatic refresh off. It sends the command and also verifies the returned status.
  3. Read Automatic Refreshing VI is placed which reads back the saved value of automatic refreshing for verification.
  4. Relay 2 and 3 in bank 1 are switched On using Relay on off VI (Using Relay On Off Poly VI, already covered in previous guide).
  5. A delay of 5 seconds is provided.
  6. Manual Refresh VI is placed which sends the manual refresh command, all previously set relays switch on at this command.
  7. A delay of 5 seconds is provided.
  8. Same as step 2 but a true value is provided to turn On automatic refreshing
  9. Same as step 4, but the relays are switched Off now.
  10. Same as step 3.
  11. Port is closed.
  12. Text boxes for TX and RX data are placed and their references are passed to the Instrument VI which display the serial data sent and received by the instrument driver.

 

Front Panel during Operation (1)

Automatic refresh is turned Off, Relay 2 and 3 are set, waiting 5 seconds to manually refresh.

Front Panel during Operation (2)

Relays refreshed, waiting 5 seconds to turn On automatic refreshing.

Front Panel during Operation (3)

Automatic Refreshing turned On and status read back into Automatic refresh status LED, relays 2 and 3 are turned Off.


B) Set and Read Current Bank

This example illustrates how to set bank value which is used by current bank directed commands.

Related Example in Driver: Bank Selection.vi

It works as follows,

  1. Sets a bank value
  2. Reads back bank value and displays it.
  3. Send a Relay On command on this bank

VIs Required:

–> Initialize (Main Palette)

–> Set Relay Bank (Configuration Palette)

–> Read Relay Bank (Configuration Palette)

–> Relay On Off (Action Status->Current Bank Directed Palette)

–> Close (Main Palette)

Following figure shows the steps for this guide. Their detail follows the figure.

Details of steps is as under.

  1. Port is initialized in Initialize VI with fixed baud rate of 115200.
  2. Set Relay Bank VI is placed and a bank value is provided to set current bank. It sends the command and also verifies the returned status.
  3. Read Relay Bank VI is placed which reads back the saved value of bank for verification.
  4. Relay 8 in current bank is switched On.
  5. Port is closed.
  6. Text boxes for TX and RX data are placed and their references are passed to the Instrument VI which display the serial data sent and received by the instrument driver.

 

Front Panel during Operation


C) Set and Read Power Up Default Relay Status

This example illustrates how to set Default Relay Status at power up and read it back to verify

Same procedure can be followed with current bank version of the function for setting up and reading in current bank.

Related Example in Driver: Power Up Default Configuration.vi

It works as follows,

  1. Sets 2 Relays in first bank
  2. Then Saves this as power up default state for this bank
  3. Reads this Power up Default state and displays for user
  4. User is required to reset the board and verify this Status.

VIs Required:

–> Initialize (Main Palette)

–> Set Power Up Default (Configuration Palette)

–> Read Power Up Default (Configuration Palette)

–> Relay On Off (Action-Status->Selectable Bank Directed Palette)

–> Close (Main Palette)

Following figure shows the steps for this guide. Their detail follows the figure.

Details of steps is as under.

  1. Port is initialized in Initialize VI with fixed baud rate of 115200.
  2. Relay On Off VI is placed twice to set 2 relays.
  3. Set Power Up Default VI is placed which stores the status of selected bank relays as power up default.
  4. Read Power Up Default VI is placed which reads back power up default status for verification.
  5. Port is closed.
  6. Text boxes for TX and RX data are placed and their references are passed to the Instrument VI which display the serial data sent and received by the instrument driver.

 

Front Panel

Labview RS232 Relay controller

To Download the Labview Relay Driver and relay controller checkout Installing Labview relay controller Driver.

ControlAnything.com and ControlEverything Site Migration Notes

©2017 National Control Devices, LLC

ncd.io

To learn something new, take the path that you took yesterday. ~John Burroughs

Log in with your credentials

or    

Forgot your details?

Create Account