Sign in to follow this  
Followers 0
Studiologe

WinCCFlex Cross Output Access

2 posts in this topic

Hello People of the Forum I have a really tricky question about VBS in WinCCFlexible. What I'm trying to do is controlling 8 Outputs based on Selection and event. I don't want to do it in the PLC with a DB, since I have really limited Memory and I'm already on the brink of exceeding it. I have 8 Doors, 8 Windows, 8 Panic Buttons, 8 Smoke Detectors, 8 Motion Detectors In my HMI I can select/deselect each Door, Window, MD.... I also want to be able to assign one or more of the 8 Outputs (Byte 310) to each Door, Window... So there will be some kind of CROSS-ACCESS As you can see in the picture, Output Bit 0 is controlled by Door_2, Door_5 but can also be controlled by one of the other sensors (Window, Motion, Smoke, or Panic) each of the red/green squares accesses a Bit of an individual Byte in the HMI, see next screenshot. I don't have all Tags programmed, yet since I want to know if that is going to work this way or not first. So it is going to be a huge amount of data and calculation. I'm not familiar with the VBS language, but took an approach already and don't know how to cross access the Tags from my script and how to call the script. How do I do something like the following (trying to access single bits in my Door_3.1, Door_3.2... Bytes) Output_3_0 = ((Door_3.1(Bit0)) & (Door_3.1 Selected) &! (Door_3.1 Feedback) ) OR ((Door_3.2(Bit0)) & (Door_3.2 Selected) &! (Door_3.2 Feedback) ) OR ((Door_3.3(Bit0)) & (Door_3.3 Selected) &! (Door_3.3 Feedback) ) OR . . . ((Window_3.1(Bit0)) & (Window_3.1 Selected) &! (Window_3.1 Feedback) ) OR ((Window_3.2(Bit0)) & (Window_3.2 Selected) &! (Window_3.2 Feedback) ) OR ((Window_3.3(Bit0)) & (Window_3.3 Selected) &! (Window_3.3 Feedback) ) OR . . . ((MD_3.1(Bit0)) & (MD_3.1 Selected) &! (MD_3.1 Feedback) ) OR ((MD_3.2(Bit0)) & (MD_3.2 Selected) &! (MD_3.2 Feedback) ) OR ((MD_3.3(Bit0)) & (MD_3.3 Selected) &! (MD_3.3 Feedback) ) OR And so on for all Sensor Types (Door, Window, Motion, Panic, Fire) and then for each output Any idea? I tried to access the single bits in my Door_3.? Byte via ShiftAndMask, but that was a desperate try that didn't ended in anything usefull... Please help me before Burglar break in lol Any ideas appreciated

Share this post


Link to post
Share on other sites
Hello, any ideas how I could access a single bit inside my byte? I know how it would be done with an array Dim test 'This accesses Element 0 of an Array test = SmartTags("Area_03\Doors\Area3_Door_Selections")(0) So if my SmartTag "Area3_Door_Selections" was a Byte, how would I do it then? 'This assigns the value of Bit 0 in Byte "Area3_Door_Selections" to Tag "test" test = ???? Please help

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0