Terry Posted December 8, 2021 Share Posted December 8, 2021 I have an existing Channel Event controlling a DO to toggle a valve based on an analog tank level signal. I want to add an HOA switch to open or close the valve at will or allow the Event to do its thing. I have very little coding experience. Thanks, Terry Quote Link to comment Share on other sites More sharing options...
AzeoTech Posted December 9, 2021 Share Posted December 9, 2021 You'd have to use a variable or a Test D/A channel to hold the HOA state. Let's say you did a variable. Initialize it in a sequence marked Auto-Start: global HOA = 2 // 0 = off, 1 = on, 2 = auto. Default is auto Then in your Channel Event, let's say you had: if (tankLevel[0] > 10) DO = 1 endif if (tanklevel[0] < 9) DO = 0 endif Replace that with: if (hoa == 2) if (tankLevel[0] > 10) DO = 1 endif if (tanklevel[0] < 9) DO = 0 endif else DO = HOA endif Quote Link to comment Share on other sites More sharing options...
Terry Posted December 9, 2021 Author Share Posted December 9, 2021 Thanks. So how do I create the HOA switch? I suppose I have to configure a 3-postion switch for that. What would that look like? Quote Link to comment Share on other sites More sharing options...
AzeoTech Posted December 9, 2021 Share Posted December 9, 2021 That is really up to you. If you have Pro you there is a 3 position switch in the symbol library, or I should say, three different images you can use to create a three position switch. But you can do it with your own images, or just use 3 buttons. It just depends on what you want it to look like. Quote Link to comment Share on other sites More sharing options...
Terry Posted January 5, 2022 Author Share Posted January 5, 2022 Just getting back into this after the holidays. I'm using Pro 19.1. 3 images to create a 3 position switch? What do you mean? Do you somehow lay the images on top of each other? How do you make this a 3 position switch? Quote Link to comment Share on other sites More sharing options...
AzeoTech Posted January 5, 2022 Share Posted January 5, 2022 Use a single Symbol component and add the three images, giving each image a different threshold depending on your coding. I recommend 0 for off, 1 for hand and 2 for auto. Then in the action, if you just want to step through the states put script like this (assuming "hoa" is the variable/channel with the hoa status): private temp = hoa+1 if (temp > 2) temp = 0 endif hoa = temp Quote Link to comment Share on other sites More sharing options...
Terry Posted January 6, 2022 Author Share Posted January 6, 2022 Thanks for your help. So if I understand correctly, there is no animated symbol that rotates between left, up, and right like a real HOA switch, and I have to, for example, place three separate symbols on the screen showing the L, U, and R positions configured to produce the H, O, and A actions when each is pressed? Quote Link to comment Share on other sites More sharing options...
AzeoTech Posted January 6, 2022 Share Posted January 6, 2022 Yes and no. There isn't a built in HOA switch, but you can easily create your own using symbols from the Symbol Factory (or any other image you want to use). I've attached a sample showing it. It is made of 4 components to provide labels. The main component is a symbol component that contains three symbols, one for each possible switch position. Which is displayed is determined by the HOA channel. Clicking the symbol steps through the options, Off then Hand then Auto then back to Off. There are then 3 labels for each of the positions. If you click on the label it will jump to that state. You can, if you expect to use the switch a lot, group it and basically make your own component out of it. I would likely add script to allow for changing of the output channel, but that is a bit more involved. If you are only going to use a few of these, you can just copy and paste the four components and manually change it. hoaSample.ctl Quote Link to comment Share on other sites More sharing options...
Terry Posted January 7, 2022 Author Share Posted January 7, 2022 Thanks for your help and patience. I was able to add this to my CTL file and it's functioning on my screen. Now to try incorporating it into the "auto" channel event. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.