Author Topic: Controlling USB Relays via AdvancedHMI?  (Read 6930 times)

nittanyrawrlion

  • Newbie
  • *
  • Posts: 7
    • View Profile
Controlling USB Relays via AdvancedHMI?
« on: October 30, 2014, 02:18:20 PM »
I was wondering if anyone had any experience using AdvancedHMI for controlling USB-connected relays? It seems like immersible powerful software but for my applications simple relays will suffice; PLC is a bit overkill. At the same time, I'm worried the AdvancedHMI might be too powerful to control this too. I do like the graphical design and I'm familiar with VB so it seems like my easiest solution for our application.

I found this particular relay that seems like it would work perfectly for my application: http://numato.com/32-channel-usb-relay-module

I would like to use maybe two of these relay boards. My concern is whether or not I would be able to install the driver the manufacturer provides to use within AdvancedHMI and if so, would I be able to identify each board via a set COM port? I know AdvancedHMI is built for MODBUS and TCP/IP so I don't know how that would fly.

If it would be a no-go, any tips on what software or hardware? I'm looking to have just on/off switches for equipment with a very simple interface for my operators.

Thank you!

Mikefly95

  • Jr. Member
  • **
  • Posts: 80
    • View Profile
Re: Controlling USB Relays via AdvancedHMI?
« Reply #1 on: October 30, 2014, 03:09:15 PM »
Have you looked into using Arduino boards. I know there are a few people out there that have gotten them to work with AdvancedHMI and my self i have some basic stuff set up with just VB.net and the
Arduino programming environment.

nittanyrawrlion

  • Newbie
  • *
  • Posts: 7
    • View Profile
Re: Controlling USB Relays via AdvancedHMI?
« Reply #2 on: October 30, 2014, 04:24:46 PM »
I did look into it a bit but unfortunately all the Arduino boards are maybe 8 channels max. I think I saw one that is 16 channels but I'm not sure it would be fully compatible. I feel like the more boards I have I'd be asking for more trouble in terms of failure and keeping things straight.

Noe

  • Full Member
  • ***
  • Posts: 205
    • View Profile
Re: Controlling USB Relays via AdvancedHMI?
« Reply #3 on: October 30, 2014, 06:55:55 PM »
For what I see, the USB relay system uses ASCII comms thru Hyperterminal or any software capable of sending text through serial ports. So AHMI has no sense to be used here, as it is a communication brigde between PLC's, OPC servers and other hardware capable of use a specific communcination protocol as Modbus RTU, CIP & DF1 (Allen Bradley's), to mention some.

If the USB relay are capable to achieve what you want, taking in count that software is not as safe/robust as hardware (VB vs PLC CPU), then use it. Everything depends on your requirements, but sounds like USB relays and a simple VB (without AHMI) is what you need.

Mikefly95

  • Jr. Member
  • **
  • Posts: 80
    • View Profile
Re: Controlling USB Relays via AdvancedHMI?
« Reply #4 on: November 03, 2014, 07:10:43 AM »
Operators? Are you building some type of industrial application? If so think you are going down the wrong path!

Noe

  • Full Member
  • ***
  • Posts: 205
    • View Profile
Re: Controlling USB Relays via AdvancedHMI?
« Reply #5 on: November 03, 2014, 12:15:18 PM »
Operators? Are you building some type of industrial application? If so think you are going down the wrong path!

Can you explain your point? Just curious about it, because I never had used USB relays, if that is what you are stating.

Mikefly95

  • Jr. Member
  • **
  • Posts: 80
    • View Profile
Re: Controlling USB Relays via AdvancedHMI?
« Reply #6 on: November 03, 2014, 12:28:02 PM »
I looked at the USB relays he is referring to and they look similar to something you can pick up at Radio Shack. Something i could not see being used in an industrial application, and probably is not designed for it.

fohdeesha

  • Newbie
  • *
  • Posts: 46
    • View Profile
Re: Controlling USB Relays via AdvancedHMI?
« Reply #7 on: November 03, 2014, 03:57:06 PM »
For that price pick up a Click PLC. Even the analog model with two 4-20ma inputs and two 4-20ma outputs is cheaper than that simple board of relays. then you get a nice fully featured PLC that is easily controllable with AdvancedHMI via modbus RTU (this is what I'm doing for my home automation project). If you need more on/off outputs out of the click, just spend an additional 30 dollars ands get 16 more ins or outs with a input/output card. Then you have the advantage of having 4-20ma inputs so you can hook up things like temperature and pressure etc sensors, and you have a full plc so you can build in some logic/control that doesn't require constant human intervention via the HMI

PLC - http://www.automationdirect.com/adc/Shopping/Catalog/Programmable_Controllers/CLICK_Series_PLCs_(Stackable_Micro_Brick)/PLC_Units/C0-02DD2-D

Expansion modules - http://www.automationdirect.com/adc/Shopping/Catalog/Programmable_Controllers/CLICK_Series_PLCs_(Stackable_Micro_Brick)/DC_I-z-O

Can't recommend those things enough for small projects like this

nittanyrawrlion

  • Newbie
  • *
  • Posts: 7
    • View Profile
Re: Controlling USB Relays via AdvancedHMI?
« Reply #8 on: November 03, 2014, 06:36:23 PM »
I finally got my hands on a board and I'm working on writing the software on my own based on some other samples I've found.

It is a (light) industrial application. A PLC may be overkill for this application, though. We have some other equipment that is controlled by AB PLCs and some proprietary software, but the project I'm looking to do doesn't actually involve any automation. It's simply a matter of consolidation and centralization of controls, so instead of 60+ physical buttons and switches in a control center, I can have them all on one screen. It will also give me the option for remote access.

It seems like for my application the relays will work well. I've got my handle on the communication with the board, getting and setting relay status. I need to plan the layout and functionality well so that it will be intuitive/simple, but I think it will work well. Part of what I like about AdvancedHMI is the built-in interface options it offers. I would say the relays will change state twice a day at most on average, so in terms of longevity I think they would be okay as well.

fohdeesha, I'm looking at the Click PLC. Only thing that would worry me is having one PLC to control everything, because if it goes down, everything will go down in our shop. If I wanted to have one PLC per piece of equipment (cost aside) could I theoretically control everything from one computer? If each critical piece of equipment was individually controlled, I would have some 10 PLCs.
« Last Edit: November 04, 2014, 07:18:46 AM by nittanyrawrlion »

fohdeesha

  • Newbie
  • *
  • Posts: 46
    • View Profile
Re: Controlling USB Relays via AdvancedHMI?
« Reply #9 on: November 04, 2014, 07:16:07 PM »
fohdeesha, I'm looking at the Click PLC. Only thing that would worry me is having one PLC to control everything, because if it goes down, everything will go down in our shop

How is that any different than using one relay board to control them? Except with just a board of relays (that is by it's own admission not intended for industrial/high reliability applications), you're also totally dependent on a (by industrial standards) super unreliable pc with a bunch of moving parts (fans) a non-realtime OS etc, so if that goes down your relay board is now useless. Versus a PLC designed from the ground up to run in these conditions. I know a few people that have Automation Direct PLC's (including Clicks) sitting in the bottom of sewer lift stations for up to 8 years cycling pumps and they haven't had to touch them since install.

If you're talking about using a PLC to replace ALL the non-automated controls in your entire building, the typical thing to do would be to spec a PLC in a slot chassis that allows the use of redundant CPU cards. Even then, it's quite rare for a plc to magically go down, they're essentially designed to run in awful conditions forever.

And you say the plc might be overkill, there's nothing wrong with overkill if it comes out cheaper and more reliable than barely getting by : )
« Last Edit: November 04, 2014, 07:18:39 PM by fohdeesha »

nittanyrawrlion

  • Newbie
  • *
  • Posts: 7
    • View Profile
Re: Controlling USB Relays via AdvancedHMI?
« Reply #10 on: November 04, 2014, 08:44:08 PM »
My line of thinking was that if I had a few relay boards on hand, I could swap them out quicker than a PLC.

Giving it more thought, I do think a PLC would be better in terms of reliability, but the issue I'm still running into is scalability. I don't have an exact number yet, but I would need to control around 64 (ballpark figure) various switches. Well, what are now physical switches but I would like to control with a PLC. These are 120V AC switches, and it seems the ClickPLC would allow me some 8 outputs per module so I'm not sure if I'd even be able to construct something so grotesquely large.

I have nothing against overkill! Better safe than sorry. The scale of this project is growing by the minute which makes me have to rethink on the fly.

Edit: I may be able to get away with under 50 outputs, so I could make a Click PLC work. Is AdvancedHMI working well with Click now? From what I saw in a forum post doing a quick search said there was some issues and the support was light due to a lack of need. Have you had any experience with the Click software itself? I'm sorry to pepper you with questions but as my post count indicates I am a complete newbie.
« Last Edit: November 04, 2014, 09:15:02 PM by nittanyrawrlion »

fohdeesha

  • Newbie
  • *
  • Posts: 46
    • View Profile
Re: Controlling USB Relays via AdvancedHMI?
« Reply #11 on: November 04, 2014, 10:00:19 PM »
I'm sorry to pepper you with questions but as my post count indicates I am a complete newbie.

No problem! I'm somewhat of a newbie myself, I work in post production in the film industry and recently delved into the industrial automation world for a rather large home automation project (Click PLC based with AdvancedHMI on a wall-mounted touch screen).

If you check the previous link to the click expansion modules, you can get cards with 16 outputs (or 16 inputs) on one card. There are also combo cards that split it so you get 8 inputs and 8 outputs on one card. The Click supports up to 8 expansion cards, so that's 128 outputs on one PLC. The amazing thing with PLC's however, is a simple serial connection between them (eg over rs485 or rs232), the systems can now address each others inputs and outputs and a myriad of other things. So if you max out one plc with 128 outputs and need more, You can drop in another Click PLC with it's own expansion cards quite easily and have your hmi plugged into one plc be able to address and control the other plc as well, all on the same system.

Keep in mind PLC's were designed with this exact kind of application (high reliability, unpredictable scalability needs, etc) in mind. So things like adding another plc to the system is very easy and is done often.

EDIT: I just realized where you got the 8 output number, you're looking at the modules with built in high voltage relays. That can be convenient for controlling small numbers of things, but how it's done 99% of the time is using the typical low voltage solid state outputs (like on the normal output cards) to control external relays, either mechanical or solid state. This way you don't have to home run nearly a hundred different 120v lines all the way to your plc to be switched and then back again. You would usually run control wiring from the plc's low voltage output to whatever needs to be switched and have relays locally mounted there. This is how I'm controlling all the lighting in my house, I have a bank of solid state relays in the attic that intercepts all the lighting wiring locally, and a simple run of cat6 ethernet running from the relays back to the plc in the utility closet. (Cat6 turned out to be a great choice for a home project anyway, it's 8 full conductors (so control of 7 relays all sharing a common) and getting 200 feet for less than 20 dollars is incredibly easy on ebay. the 23 or 24awg is more than enough to carry the 50ma~ current required to switch a relay.)

Another thing to keep in mind is mechanical relays (like in the Click's AC output module) do have a lifespan due to moving parts and will eventually fail. So if you're using nothing but cards this means one input means replacing the whole card, however if you have external relays distributed around your building you can only replace what needs replacing. Better yet, if you use solid state relays, they will have a near-infinite lifetime assuming you use them at or below the rated current and do not let them get above their recommended max temp. If you want some suggestions on some cheap and reliable SSR's let me know.

Regarding Click and AdvancedHMI - With AdvancedHMI you use the ModbusRTU driver to talk to the click, which is just modbus over serial. The driver was pretty wonky a few months ago but I tested it as much as I could for Archie with a couple other Click users and he pretty quickly got it working perfectly. It's now plug and play and doing things like just turning things on and off is very easy. I'm currently using it with some on and off switches, temperature display and controls, and house power consumption monitoring displays. It was pretty easy to do now that the RTU driver is working well. No altering of the program was necessary which is good because I can't code for the life of me.

Hope that helps!
« Last Edit: November 04, 2014, 10:04:22 PM by fohdeesha »

nittanyrawrlion

  • Newbie
  • *
  • Posts: 7
    • View Profile
Re: Controlling USB Relays via AdvancedHMI?
« Reply #12 on: November 05, 2014, 07:43:44 AM »
That is awesome! I didn't realize I could add another CPU board! That would be great if needed.

The only reason I would want to do the 120V line option because that's how it is connected right now and I already have all the wires right where I would need them (currently connected to a massive switchboard). I realize it might not be the greatest option, but it would be a massive undertaking to change it. I think mechanical relays are rated for something like 100,000 operations, so I figure conservatively that the relays will be operated 4 times a day every single day (which it wouldn't be), it should still last me at least 50 years. I was already planning on buying at least one PSU, CPU, and output board to have on hand at all times, but I could get an extra dozen output cards or something and sleep easy.

I took at the Click software and it seems a little bit convoluted, much more so than AdvancedHMI, so AdvancedHMI would definitely be my first choice. My project here is essentially to control production ovens at work, which I will need about 4 to 5 controls per oven. Knowing now that I have the option to add another CPU and more boards, I could definitely do more stuff down the line such as bring in 4-20mA inputs to show me the current temperatures, get power consumption data, etc., though initially I'll keep it simple.

For each oven I will need to be able to switch four outputs on and off (maybe just turn all four on/off at a time in an 'auto' mode and individually in manual mode) and show status of the relays. I need to create an operator-friendly HMI for it as well, which I think AdvancedHMI gives me the best option for that. A timer for one of the switches would be perfect too. So it's not 'automation' per se but centralization and modernization; putting everything in one place would help us reduce operator mistakes as well. We're updating a lot at work (LED lighting, etc) so this is another thing that would help bring us up with the times.

Noe

  • Full Member
  • ***
  • Posts: 205
    • View Profile
Re: Controlling USB Relays via AdvancedHMI?
« Reply #13 on: November 05, 2014, 09:41:36 AM »
fohdeesha, I'm looking at the Click PLC. Only thing that would worry me is having one PLC to control everything, because if it goes down, everything will go down in our shop

How is that any different than using one relay board to control them? Except with just a board of relays (that is by it's own admission not intended for industrial/high reliability applications), you're also totally dependent on a (by industrial standards) super unreliable pc with a bunch of moving parts (fans) a non-realtime OS etc, so if that goes down your relay board is now useless. Versus a PLC designed from the ground up to run in these conditions. I know a few people that have Automation Direct PLC's (including Clicks) sitting in the bottom of sewer lift stations for up to 8 years cycling pumps and they haven't had to touch them since install.

If you're talking about using a PLC to replace ALL the non-automated controls in your entire building, the typical thing to do would be to spec a PLC in a slot chassis that allows the use of redundant CPU cards. Even then, it's quite rare for a plc to magically go down, they're essentially designed to run in awful conditions forever.

And you say the plc might be overkill, there's nothing wrong with overkill if it comes out cheaper and more reliable than barely getting by : )


I do not think he meant by this that Click PLC can support dual CPU board for redundancy. So far this feature is developed only for higher level systems. I think the only option available for Click PLC is to expand the I/O by assembling another full system and getting it in communication with your first one, in a way to "share" its I/O.

Please fohdeesha, correct me if I'm wrong. A cheap redundat PLC would be something very interesting to know of.

fohdeesha

  • Newbie
  • *
  • Posts: 46
    • View Profile
Re: Controlling USB Relays via AdvancedHMI?
« Reply #14 on: November 05, 2014, 10:07:55 AM »
yeah I didn't mean automatic redundant control with multiple CPU's controlling the same set of cards, I meant that you can simply connect multiple click PLC's (and even PLC's from different manufacturers, different devices etc, if they support modbus RTU) so they can talk to each other and all be addressed and controlled either by each other or your HMI software like advancedHMI.

If you already have all the 120v wiring home ran and in one place than the built in AC relay cards can work well, just be sure ot note their max amperage and be sure you're under it (ovens draw a LOT of power and the AC cards are really only designed to switch low amperage things like lighting or large relays/contactors)

The software you were looking at for the click is simple ladder logic, that's how 99% of PLC's and industrial automation/control is programmed. It looks kind of goofy but makes sense pretty quickly. You can keep it simple and just interface advancedhmi directly to the output bits, or program in some logic on the plc so it can do things on it's own like shut off safety outputs if it detects a loss of HMI connection, shut certain outputs off after a certain time of day or if they haven't been toggled in a certain amount of time, monitor 4-20ma inputs like temperature and turn things on or off based on temperature, turn things off if they reach a safety temp threshold etc, all contained within the plc.

The type of control you mentioned with timers and things would be incredibly simple to do all on a single plc, and then build an HMI with advancedHMI and have it tell the plc what you want to do and have the plc intelligently carry the request out with safeties and checks etc instead of directly controlling single on/off relays with an HMI directly. If you can take the short time to make some sense of ladder logic I can guarantee you you'll be very happy you did and blown away at the possibilities : ) what you said of adding other CPU's later down the line with 4-20ma inputs and reading the temperature and even using that to alter what your inputs and outputs are doing would be very simple. Two months ago I had never heard of any of this and now I have a home automation system that monitors and controls my HVAC, heaters, air circulation, interlocks them so they can't run on top of each other, zones out all the climate control and allows individual control also based on time of day and outdoor climate, monitors smoke alarms and shuts off hvac and turns on specific lights and alarms if they go off, fires heaters near pipes prone to freezing when the outdoor temp gets too low, etc

You're kind of approaching an industrial automation/control project (from what it sounds like anyway) with a very non-industrial control approach which I think is what is throwing everyone off. As long as there's nothing critical being controlled then there's nothing inherently wrong with that, just expect to be very limited now and in the future with regards to what you can do and expand. However if it's controlling anything that can be remotely hazardous if operated incorrectly (like large ovens) then I highly recommend either bringing an automation/instrumentation guy in to oversee everything or spend a week or so learning ladder logic (it's really not that hard), build out the system and have someone look over it. Hope that helps I don't mean to discourage you heh
« Last Edit: November 05, 2014, 10:17:00 AM by fohdeesha »